LLDB test failures while building Swift 5.0 toolchain



The following values were traced while debugging in File "/root/swift-source/lldb/packages/Python/lldbsuite/test/lldbinline.py", line 171, in 'do_test', which is involved in the lldb test failures and reports "AssertionError: False is not True : inline test did not hit a single breakpoint" for 51 test failures:-




SBProcess: pid = 20460, state = exited, threads = 1, executable = a.out

Since the process is in exited state on start up, the intended breakpoints do not get hit in the while loop. Hence the failures are seen.
Wondering why the process exits on start up.


All failing lldb test cases have the following type of error message:-
<bound method SBProcess.Kill of <lldb.SBProcess; proxy of <Swig Object of type 'lldb::SBProcess *' at 0x3fff9c15cf90> >>: success


After skipping the failing lldb tests, I am able to complete the libdispatch test suite. However, facing the following issues in TestFoundation test suite:-

[257/257][100%][91.650s] Running utility command for TestFoundation
--- Running tests for foundation ---
--- test ---

  • /usr/bin/cmake --build /root/swift-source/build/buildbot_linux/foundation-linux-powerpc64le -- -j8 test
    [0/1][ 0%][0.000s] Running tests...
    Test project /root/swift-source/build/buildbot_linux/foundation-linux-powerpc64le
    Start 1: TestFoundation
    1/1 Test #1: TestFoundation ...................***Failed 0.00 sec
    /root/swift-source/build/buildbot_linux/foundation-linux-powerpc64le/TestFoundation/TestFoundation: error while loading shared libraries: libicui18nswift.so.61: cannot open shared object file: No such file or directory

0% tests passed, 1 tests failed out of 1

Total Test time (real) = 0.00 sec

The following tests FAILED:
1 - TestFoundation (Failed)
Errors while running CTest
FAILED: CMakeFiles/test.util
cd /root/swift-source/build/buildbot_linux/foundation-linux-powerpc64le && /usr/bin/ctest --force-new-ctest-process
ninja: build stopped: subcommand failed.
Building the standard library for: swift-stdlib-linux-powerpc64le
Running Swift tests for: check-swift-all-linux-powerpc64le check-swift-all-optimize-linux-powerpc64le
./utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
./utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting


Iam invoking the toolchain and the tests using the following command:-

	./swift/utils/build-toolchain srtbundle --test

I assume this creates a release build, where source files are compiled without any debug information.
So in that case the binaries(a.out and others) might not really help in debugging with lldb, hence the tests fail. Could this be the case here?


Used the 'llvm-readelf' utility to find details about the libraries linked with lldb binary and realised that the directories mentioned in RUNPATH might not have the required libraries.

Similar to reasons mentioned in my earlier issue "TestFoundation test suite failing while building Swift Toolchain", I manually copied the libraries and it worked. The lldb test suite was executed, though it fails now for only 7 test cases:-
Failing Tests (7):
LLDB :: SwiftREPL/ErrorReturn.test
LLDB :: tools/lldb-mi/symbol/symbol-list-lines.test
lldb-Suite :: lang/swift/dwarfimporter/C/TestSwiftDWARFImporterC.py
lldb-Suite :: lang/swift/reference_storage_types/TestSwiftReferenceStorageTypes.py
lldb-Suite :: lang/swift/repl_in_c/TestSwiftReplInC.py
lldb-Suite :: lang/swift/unknown_self/TestSwiftUnknownSelf.py
lldb-Suite :: lang/swift/variables/swift/TestSwiftTypes.py


Attached to this issue are the details of the final 7 failing lldb tests. - https://bugs.swift.org/browse/SR-9888