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

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Wed Jan 20 14:47:02 PST 2021


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 <lldb-dev at lists.llvm.org> 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 <dblaikie at gmail.com <mailto:dblaikie at gmail.com>> 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 (git at github.com:llvm/llvm-project.git revision d49974f9c98ebce5a679eced9f27add138b881fa)
>   clang revision d49974f9c98ebce5a679eced9f27add138b881fa
>   llvm revision d49974f9c98ebce5a679eced9f27add138b881fa
> 
> --
> Command Output (stderr):
> --
> Fatal Python error: Segmentation fault
> 
> Current thread 0x00007fe870b7d740 (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 <module>
> 
> --
> 
> ********************
> ********************
> 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 /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: 1
> 
> Command Output (stdout):
> --
> lldb version 12.0.0 (git at github.com:llvm/llvm-project.git revision d49974f9c98ebce5a679eced9f27add138b881fa)
>   clang revision d49974f9c98ebce5a679eced9f27add138b881fa
>   llvm revision d49974f9c98ebce5a679eced9f27add138b881fa
> Unable to load lldb extension module.  Possible reasons for this include:
>   1) LLDB was built with LLDB_ENABLE_PYTHON=0
>   2) PYTHONPATH and PYTHONHOME are not set correctly.  PYTHONHOME should refer to
>      the version of Python that LLDB built and linked against, and PYTHONPATH
>      should contain the Lib directory for the same python distro, as well as the
>      location of LLDB's site-packages folder.
>   3) A different version of Python than that which was built against is exported in
>      the system's PATH environment variable, causing conflicts.
>   4) The executable '/usr/local/google/home/blaikie/dev/llvm/build/default/bin/lldb' could not be found.  Please check
>      that it exists and is executable.
> 
> --
> Command Output (stderr):
> --
> Traceback (most recent call last):
>   File "/usr/local/google/home/blaikie/dev/llvm/src/lldb/test/API/dotest.py", line 7, in <module>
>     lldbsuite.test.run_suite()
>   File "/usr/local/google/home/blaikie/dev/llvm/src/lldb/packages/Python/lldbsuite/test/dotest.py", line 890, in run_suite
>     import lldb
> ModuleNotFoundError: No module named 'lldb'
> 
> --
> 
> ********************
> ********************
> Failed Tests (1):
>   lldb-api :: commands/help/TestHelp.py
> 
> 
> Testing Time: 0.29s
>   Failed: 1
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20210120/f7c0c40f/attachment-0001.html>


More information about the lldb-dev mailing list