Re: [lldb-dev] lldb/test/API/commands/help/TestHelp.py not running just-built lldb

2021-01-20 Thread Greg Clayton via lldb-dev
Might be an easy fix to have our test suite unset the "LD_LIBRARY_PATH" env var 
if it is set?

> On Jan 19, 2021, at 5:38 PM, David Blaikie via lldb-dev 
>  wrote:
> 
> Jonas helped me out here (Thanks!)
> 
> Seems I was setting LD_LIBRARY_PATH for, so far as I recall, good reasons (I 
> have some things installed locally in $HOME/install and I thought somewhere 
> in the mists of time the executables ($HOME/install/bin) didn't naturally 
> find some shared libraries in $HOME/install/lib{,64}) but it was definitely 
> messing up the lldb test execution - so for now I've unset LD_LIBRARY_PATH 
> and I'll leave it that way/see if I rediscover what motivated me to set it in 
> the first place - if that comes up I'll have something more concrete to 
> discuss. But for now I'm unblocked/not hitting this issue anymore.
> 
> Thanks again,
> - Dave
> 
> On Tue, Jan 19, 2021 at 3:56 PM David Blaikie  > wrote:
> On Linux (Ubuntu) + cmake + ninja, it seems this test isn't testing the 
> checked-out lldb, but instead running the system (or user-dir, in my case) 
> installed lldb (see examples at the end of this email)
> 
> If I remove the user-dir installed lldb then the test fails differently - 
> complaining that it can't find the lldb python bindings, it seems. So it's 
> not even falling back to the just-built lldb, by the looks of it.
> 
> Any ideas? Anyone else come across this? Should something in the testing be 
> setting PYTHONPATH to include (preferentially/early) the just-built python 
> lldb package?
> 
> - Dave
> 
> 
> $ ./bin/llvm-lit -v tools/lldb/test/API/commands/help/TestHelp.py
> -- Testing: 1 tests, 1 workers --
> FAIL: lldb-api :: commands/help/TestHelp.py (1 of 1)
>  TEST 'lldb-api :: commands/help/TestHelp.py' FAILED 
> 
> Script:
> --
> /usr/bin/python3 
> /usr/local/google/home/blaikie/dev/llvm/src/lldb/test/API/dotest.py -u 
> CXXFLAGS -u CFLAGS --env ARCHIVER=/usr/bin/ar --env OBJCOPY=/usr/bin/objcopy 
> --env 
> LLVM_LIBS_DIR=/usr/local/google/home/blaikie/dev/llvm/build/default/./lib 
> --arch x86_64 --build-dir 
> /usr/local/google/home/blaikie/dev/llvm/build/default/lldb-test-build.noindex 
> --lldb-module-cache-dir 
> /usr/local/google/home/blaikie/dev/llvm/build/default/lldb-test-build.noindex/module-cache-lldb/lldb-api
>  --clang-module-cache-dir 
> /usr/local/google/home/blaikie/dev/llvm/build/default/lldb-test-build.noindex/module-cache-clang/lldb-api
>  --executable 
> /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/lldb --compiler 
> /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/clang --dsymutil 
> /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/dsymutil 
> --filecheck 
> /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/FileCheck 
> --yaml2obj 
> /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/yaml2obj 
> --lldb-libs-dir /usr/local/google/home/blaikie/dev/llvm/build/default/./lib 
> /usr/local/google/home/blaikie/dev/llvm/src/lldb/test/API/commands/help -p 
> TestHelp.py
> --
> Exit Code: -11
> 
> Command Output (stdout):
> --
> lldb version 12.0.0 (g...@github.com:llvm/llvm-project.git revision 
> d49974f9c98ebce5a679eced9f27add138b881fa)
>   clang revision d49974f9c98ebce5a679eced9f27add138b881fa
>   llvm revision d49974f9c98ebce5a679eced9f27add138b881fa
> 
> --
> Command Output (stderr):
> --
> Fatal Python error: Segmentation fault
> 
> Current thread 0x7fe870b7d740 (most recent call first):
>   File 
> "/usr/local/google/home/blaikie/install/lib/python3/dist-packages/lldb/__init__.py",
>  line 3098 in HandleCommand
>   File 
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/packages/Python/lldbsuite/test/lldbtest.py",
>  line 2146 in runCmd
>   File 
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/test/API/commands/help/TestHelp.py",
>  line 62 in test_help_memory_read_should_not_crash_lldb
>   File 
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/packages/Python/lldbsuite/test/decorators.py",
>  line 345 in wrapper
>   File 
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/case.py",
>  line 413 in runMethod
>   File 
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/case.py",
>  line 383 in run
>   File 
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/case.py",
>  line 458 in __call__
>   File 
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
>  line 117 in _wrapped_run
>   File 
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
>  line 115 in _wrapped_run
>   File 
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
>  line 85 in run
>   File 
> 

Re: [lldb-dev] lldb/test/API/commands/help/TestHelp.py not running just-built lldb

2021-01-19 Thread David Blaikie via lldb-dev
Jonas helped me out here (Thanks!)

Seems I was setting LD_LIBRARY_PATH for, so far as I recall, good reasons
(I have some things installed locally in $HOME/install and I thought
somewhere in the mists of time the executables ($HOME/install/bin) didn't
naturally find some shared libraries in $HOME/install/lib{,64}) but it was
definitely messing up the lldb test execution - so for now I've unset
LD_LIBRARY_PATH and I'll leave it that way/see if I rediscover what
motivated me to set it in the first place - if that comes up I'll have
something more concrete to discuss. But for now I'm unblocked/not hitting
this issue anymore.

Thanks again,
- Dave

On Tue, Jan 19, 2021 at 3:56 PM David Blaikie  wrote:

> On Linux (Ubuntu) + cmake + ninja, it seems this test isn't testing the
> checked-out lldb, but instead running the system (or user-dir, in my case)
> installed lldb (see examples at the end of this email)
>
> If I remove the user-dir installed lldb then the test fails differently -
> complaining that it can't find the lldb python bindings, it seems. So it's
> not even falling back to the just-built lldb, by the looks of it.
>
> Any ideas? Anyone else come across this? Should something in the testing
> be setting PYTHONPATH to include (preferentially/early) the just-built
> python lldb package?
>
> - Dave
>
>
> $ ./bin/llvm-lit -v tools/lldb/test/API/commands/help/TestHelp.py
>
> -- Testing: 1 tests, 1 workers --
>
> FAIL: lldb-api :: commands/help/TestHelp.py (1 of 1)
>
>  TEST 'lldb-api :: commands/help/TestHelp.py' FAILED
> 
>
> Script:
>
> --
>
> /usr/bin/python3
> /usr/local/google/home/blaikie/dev/llvm/src/lldb/test/API/dotest.py -u
> CXXFLAGS -u CFLAGS --env ARCHIVER=/usr/bin/ar --env
> OBJCOPY=/usr/bin/objcopy --env
> LLVM_LIBS_DIR=/usr/local/google/home/blaikie/dev/llvm/build/default/./lib
> --arch x86_64 --build-dir
> /usr/local/google/home/blaikie/dev/llvm/build/default/lldb-test-build.noindex
> --lldb-module-cache-dir
> /usr/local/google/home/blaikie/dev/llvm/build/default/lldb-test-build.noindex/module-cache-lldb/lldb-api
> --clang-module-cache-dir
> /usr/local/google/home/blaikie/dev/llvm/build/default/lldb-test-build.noindex/module-cache-clang/lldb-api
> --executable
> /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/lldb --compiler
> /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/clang
> --dsymutil
> /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/dsymutil
> --filecheck
> /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/FileCheck
> --yaml2obj
> /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/yaml2obj
> --lldb-libs-dir /usr/local/google/home/blaikie/dev/llvm/build/default/./lib
> /usr/local/google/home/blaikie/dev/llvm/src/lldb/test/API/commands/help -p
> TestHelp.py
>
> --
>
> Exit Code: -11
>
>
> Command Output (stdout):
>
> --
>
> lldb version 12.0.0 (g...@github.com:llvm/llvm-project.git revision
> d49974f9c98ebce5a679eced9f27add138b881fa)
>
>   clang revision d49974f9c98ebce5a679eced9f27add138b881fa
>
>   llvm revision d49974f9c98ebce5a679eced9f27add138b881fa
>
>
> --
>
> Command Output (stderr):
>
> --
>
> Fatal Python error: Segmentation fault
>
>
> Current thread 0x7fe870b7d740 (most recent call first):
>
>   File
> "/usr/local/google/home/blaikie/install/lib/python3/dist-packages/lldb/__init__.py",
> line 3098 in HandleCommand
>
>   File
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/packages/Python/lldbsuite/test/lldbtest.py",
> line 2146 in runCmd
>
>   File
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/test/API/commands/help/TestHelp.py",
> line 62 in test_help_memory_read_should_not_crash_lldb
>
>   File
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/packages/Python/lldbsuite/test/decorators.py",
> line 345 in wrapper
>
>   File
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/case.py",
> line 413 in runMethod
>
>   File
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/case.py",
> line 383 in run
>
>   File
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/case.py",
> line 458 in __call__
>
>   File
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
> line 117 in _wrapped_run
>
>   File
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
> line 115 in _wrapped_run
>
>   File
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
> line 85 in run
>
>   File
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
> line 66 in __call__
>
>   File
> "/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/runner.py",
> line 165 in run
>
>   File
> 

[lldb-dev] lldb/test/API/commands/help/TestHelp.py not running just-built lldb

2021-01-19 Thread David Blaikie via lldb-dev
On Linux (Ubuntu) + cmake + ninja, it seems this test isn't testing the
checked-out lldb, but instead running the system (or user-dir, in my case)
installed lldb (see examples at the end of this email)

If I remove the user-dir installed lldb then the test fails differently -
complaining that it can't find the lldb python bindings, it seems. So it's
not even falling back to the just-built lldb, by the looks of it.

Any ideas? Anyone else come across this? Should something in the testing be
setting PYTHONPATH to include (preferentially/early) the just-built python
lldb package?

- Dave


$ ./bin/llvm-lit -v tools/lldb/test/API/commands/help/TestHelp.py

-- Testing: 1 tests, 1 workers --

FAIL: lldb-api :: commands/help/TestHelp.py (1 of 1)

 TEST 'lldb-api :: commands/help/TestHelp.py' FAILED


Script:

--

/usr/bin/python3
/usr/local/google/home/blaikie/dev/llvm/src/lldb/test/API/dotest.py -u
CXXFLAGS -u CFLAGS --env ARCHIVER=/usr/bin/ar --env
OBJCOPY=/usr/bin/objcopy --env
LLVM_LIBS_DIR=/usr/local/google/home/blaikie/dev/llvm/build/default/./lib
--arch x86_64 --build-dir
/usr/local/google/home/blaikie/dev/llvm/build/default/lldb-test-build.noindex
--lldb-module-cache-dir
/usr/local/google/home/blaikie/dev/llvm/build/default/lldb-test-build.noindex/module-cache-lldb/lldb-api
--clang-module-cache-dir
/usr/local/google/home/blaikie/dev/llvm/build/default/lldb-test-build.noindex/module-cache-clang/lldb-api
--executable
/usr/local/google/home/blaikie/dev/llvm/build/default/./bin/lldb --compiler
/usr/local/google/home/blaikie/dev/llvm/build/default/./bin/clang
--dsymutil
/usr/local/google/home/blaikie/dev/llvm/build/default/./bin/dsymutil
--filecheck
/usr/local/google/home/blaikie/dev/llvm/build/default/./bin/FileCheck
--yaml2obj
/usr/local/google/home/blaikie/dev/llvm/build/default/./bin/yaml2obj
--lldb-libs-dir /usr/local/google/home/blaikie/dev/llvm/build/default/./lib
/usr/local/google/home/blaikie/dev/llvm/src/lldb/test/API/commands/help -p
TestHelp.py

--

Exit Code: -11


Command Output (stdout):

--

lldb version 12.0.0 (g...@github.com:llvm/llvm-project.git revision
d49974f9c98ebce5a679eced9f27add138b881fa)

  clang revision d49974f9c98ebce5a679eced9f27add138b881fa

  llvm revision d49974f9c98ebce5a679eced9f27add138b881fa


--

Command Output (stderr):

--

Fatal Python error: Segmentation fault


Current thread 0x7fe870b7d740 (most recent call first):

  File
"/usr/local/google/home/blaikie/install/lib/python3/dist-packages/lldb/__init__.py",
line 3098 in HandleCommand

  File
"/usr/local/google/home/blaikie/dev/llvm/src/lldb/packages/Python/lldbsuite/test/lldbtest.py",
line 2146 in runCmd

  File
"/usr/local/google/home/blaikie/dev/llvm/src/lldb/test/API/commands/help/TestHelp.py",
line 62 in test_help_memory_read_should_not_crash_lldb

  File
"/usr/local/google/home/blaikie/dev/llvm/src/lldb/packages/Python/lldbsuite/test/decorators.py",
line 345 in wrapper

  File
"/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/case.py",
line 413 in runMethod

  File
"/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/case.py",
line 383 in run

  File
"/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/case.py",
line 458 in __call__

  File
"/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
line 117 in _wrapped_run

  File
"/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
line 115 in _wrapped_run

  File
"/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
line 85 in run

  File
"/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
line 66 in __call__

  File
"/usr/local/google/home/blaikie/dev/llvm/src/lldb/third_party/Python/module/unittest2/unittest2/runner.py",
line 165 in run

  File
"/usr/local/google/home/blaikie/dev/llvm/src/lldb/packages/Python/lldbsuite/test/dotest.py",
line 1008 in run_suite

  File
"/usr/local/google/home/blaikie/dev/llvm/src/lldb/test/API/dotest.py", line
7 in 


--






Failed Tests (1):

  lldb-api :: commands/help/TestHelp.py



Testing Time: 5.03s

  Failed: 1





$ ./bin/llvm-lit -v tools/lldb/test/API/commands/help/TestHelp.py

-- Testing: 1 tests, 1 workers --

FAIL: lldb-api :: commands/help/TestHelp.py (1 of 1)

 TEST 'lldb-api :: commands/help/TestHelp.py' FAILED


Script:

--

/usr/bin/python3
/usr/local/google/home/blaikie/dev/llvm/src/lldb/test/API/dotest.py -u
CXXFLAGS -u CFLAGS --env ARCHIVER=/usr/bin/ar --env
OBJCOPY=/usr/bin/objcopy --env
LLVM_LIBS_DIR=/usr/local/google/home/blaikie/dev/llvm/build/default/./lib
--arch x86_64 --build-dir