swiftlang / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. This fork is used to manage Swift’s stable releases of Clang as well as support the Swift project.
https://llvm.org
Other
1.12k stars 332 forks source link

[SR-10037] Issues running lldb-Suite test cases while building Apple Swift 5 toolchain on PowerPC64LE #4605

Open swift-ci opened 5 years ago

swift-ci commented 5 years ago
Previous ID SR-10037
Radar None
Original Reporter stamba (JIRA User)
Type Bug

Attachment: Download

Environment PowerPC64LE
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | LLDB for Swift | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: f6f99bbf642017c17fae98fe7caec1c9

Issue Description:

Facing following issues running lldb-Suite test cases while building Apple Swift 5 toolchain on PowerPC64LE.

Around 109 test cases fail with the same error message:-

*\<bound method SBProcess.Kill of \<lldb.SBProcess; proxy of \<Swig Object of type 'lldb::SBProcess ' at 0x3fff8e8d51b0> >>: success

Following is the detailed failure of one of the failing test cases:-

******************** FAIL: lldb-Suite :: lang/swift/anytype_array/TestAnyTypeArray.py (755 of 1748) ******************** TEST 'lldb-Suite :: lang/swift/anytype_array/TestAnyTypeArray.py' FAILED ******************** lldb version 7.0.0 (https://github.com/apple/swift-lldb.git revision bdd5e8f63d81a08a39436469a0b24f467aab84ad) Swift version 5.0-dev (LLVM b02b353cf7, Swift 22bcbe510b) LLDB library dir: /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/bin LLDB import library dir: /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/bin Skipping following debug info categories: ['dsym', 'gmodules']
 Session logs for test failures/errors/unexpected successes will go into directory '/home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-traces' Command invoked: /home/sar/swift-source/lldb/test/dotest.py -q --arch= -s /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-traces --build-dir /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex -S nm -u CXXFLAGS -u CFLAGS --executable /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/./bin/lldb --dsymutil /home/sar/swift-source/build/buildbot_linux/llvm-linux-powerpc64le/./bin/dsymutil --filecheck /home/sar/swift-source/build/buildbot_linux/llvm-linux-powerpc64le/./bin/FileCheck -C /home/sar/swift-source/build/buildbot_linux/llvm-linux-powerpc64le/bin/clang --swift-compiler /home/sar/swift-source/build/buildbot_linux/swift-linux-powerpc64le/bin/swiftc --swift-library /home/sar/swift-source/build/buildbot_linux/swift-linux-powerpc64le/lib/swift --env ARCHIVER=/usr/bin/ar --env OBJCOPY=/usr/bin/objcopy --build-dir /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex --test-subdir lang/swift --skip-category=watchpoint --skip-category=dwo -t -E -Xcc -F/home/sar/swift-source/build/buildbot_linux/foundation-linux-powerpc64le/CoreFoundation-prefix/System/Library/Frameworks -I/home/sar/swift-source/build/buildbot_linux/foundation-linux-powerpc64le/swift -I/home/sar/swift-source/swift-corelibs-libdispatch -L/home/sar/swift-source/build/buildbot_linux/foundation-linux-powerpc64le -L/home/sar/swift-source/build/buildbot_linux/libdispatch-linux-powerpc64le -L/home/sar/swift-source/build/buildbot_linux/libdispatch-linux-powerpc64le/src -Xlinker -rpath -Xlinker /home/sar/swift-source/build/buildbot_linux/libdispatch-linux-powerpc64le/src -Xlinker -rpath -Xlinker /home/sar/swift-source/build/buildbot_linux/libdispatch-linux-powerpc64le -Xlinker -rpath -Xlinker /home/sar/swift-source/build/buildbot_linux/foundation-linux-powerpc64le /home/sar/swift-source/lldb/packages/Python/lldbsuite/test/lang/swift/anytype_array -p TestAnyTypeArray.py Change dir to: /home/sar/swift-source/lldb/packages/Python/lldbsuite/test/lang/swift/anytype_array UNSUPPORTED: LLDB (/home/sar/swift-source/build/buildbot_linux/llvm-linux-powerpc64le/bin/clang-7-ppc64le) :: test_dsym (lldbsuite.test.lldbtest.TestAnyTypeArray) (test case does not fall in any category of interest for this run)  runCmd: settings set symbols.clang-modules-cache-path "/home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/module-cache-lldb" output: None
 runCmd: settings set symbols.enable-external-lookup false output: None

os command: make VPATH=/home/sar/swift-source/lldb/packages/Python/lldbsuite/test/lang/swift/anytype_array -C /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf -I /home/sar/swift-source/lldb/packages/Python/lldbsuite/test/lang/swift/anytype_array -f /home/sar/swift-source/lldb/packages/Python/lldbsuite/test/lang/swift/anytype_array/Makefile MAKE_DSYM=NO ARCH=ppc64le  CC=/home/sar/swift-source/build/buildbot_linux/llvm-linux-powerpc64le/bin/clang-7 SWIFTC=/home/sar/swift-source/build/buildbot_linux/swift-linux-powerpc64le/bin/swiftc  with pid: 14541 stdout: make: Entering directory '/home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf' ### Compiling /home/sar/swift-source/lldb/packages/Python/lldbsuite/test/lang/swift/anytype_array/main.swift /home/sar/swift-source/build/buildbot_linux/swift-linux-powerpc64le/bin/swift -frontend -c -primary-file /home/sar/swift-source/lldb/packages/Python/lldbsuite/test/lang/swift/anytype_array/main.swift \    \   -g -Onone -serialize-debugging-options -module-cache-path /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/module-cache-clang -sdk / -enable-anonymous-context-mangled-names -module-name a -emit-module-path \   /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf/main.partial.swiftmodule \   -o /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf/main.o ### Merging swift modules for a /home/sar/swift-source/build/buildbot_linux/swift-linux-powerpc64le/bin/swift -frontend -g -Onone -serialize-debugging-options -module-cache-path /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/module-cache-clang -sdk / -enable-anonymous-context-mangled-names -merge-modules \   -emit-module main.partial.swiftmodule \   -emit-parseable-module-interface-path /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf/a.swiftinterface \   -parse-as-library -sil-merge-partial-modules \   -disable-diagnostic-passes -disable-sil-perf-optzns \   -module-name a \   -o /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf/a.swiftmodule ### Wrapping swift module /home/sar/swift-source/build/buildbot_linux/swift-linux-powerpc64le/bin/swift -modulewrap a.swiftmodule -o /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf/a.swiftmodule.o ### Linking a.out /home/sar/swift-source/build/buildbot_linux/swift-linux-powerpc64le/bin/swiftc  a.swiftmodule.o main.o  -Onone -Xfrontend -serialize-debugging-options   -module-cache-path /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/module-cache-clang -sdk "/" -o "a.out" make: Leaving directory '/home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf'
 stderr: /home/sar/swift-source/lldb/packages/Python/lldbsuite/test/lang/swift/anytype_array/main.swift:6:7: warning: immutable value 'patatino' was never used; consider replacing with '_' or removing it   let patatino: [Any.Type] = [   ^~~~~~~~   _
 retcode: 0

FAIL: LLDB (/home/sar/swift-source/build/buildbot_linux/llvm-linux-powerpc64le/bin/clang-7-ppc64le) :: test_dwarf (lldbsuite.test.lldbtest.TestAnyTypeArray) *<bound method SBProcess.Kill of <lldb.SBProcess; proxy of <Swig Object of type 'lldb::SBProcess *' at 0x3fff8e8d51b0> >>: success*
 UNSUPPORTED: LLDB (/home/sar/swift-source/build/buildbot_linux/llvm-linux-powerpc64le/bin/clang-7-ppc64le) :: test_dwo (lldbsuite.test.lldbtest.TestAnyTypeArray) (test case does not fall in any category of interest for this run)  UNSUPPORTED: LLDB (/home/sar/swift-source/build/buildbot_linux/llvm-linux-powerpc64le/bin/clang-7-ppc64le) :: test_gmodules (lldbsuite.test.lldbtest.TestAnyTypeArray) (test case does not fall in any category of interest for this run)  Restore dir to: /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/test-results ====================================================================== FAIL: test_dwarf (lldbsuite.test.lldbtest.TestAnyTypeArray) ---------------------------------------------------------------------- Traceback (most recent call last):   File "/home/sar/swift-source/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1766, in test_method return attrvalue(self)   File "/home/sar/swift-source/lldb/packages/Python/lldbsuite/test/decorators.py", line 145, in wrapper func(*args, **kwargs)   File "/home/sar/swift-source/lldb/packages/Python/lldbsuite/test/lldbinline.py", line 134, in _test self.do_test()   File "/home/sar/swift-source/lldb/packages/Python/lldbsuite/test/lldbinline.py", line 161, in do_test "inline test did not hit a single breakpoint") AssertionError: False is not True : inline test did not hit a single breakpoint Config=ppc64le-/home/sar/swift-source/build/buildbot_linux/llvm-linux-powerpc64le/bin/clang-7 ---------------------------------------------------------------------- Ran 4 tests in 0.483s
 RESULT: FAILED (0 passes, 1 failures, 0 errors, 3 skipped, 0 expected failures, 0 unexpected successes)
swift-ci commented 5 years ago

Comment by Sarvesh Tamba (JIRA)

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?

swift-ci commented 5 years ago

Comment by Sarvesh Tamba (JIRA)

Looks like the tests are built with g option:

      1. Compiling /home/sar/swift-source/lldb/packages/Python/lldbsuite/test/lang/swift/anytype_array/main.swift /home/sar/swift-source/build/buildbot_linux/swift-linux-powerpc64le/bin/swift -frontend -c -primary-file /home/sar/swift-source/lldb/packages/Python/lldbsuite/test/lang/swift/anytype_array/main.swift \ \ -g -Onone -serialize-debugging-options -module-cache-path /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/module-cache-clang -sdk / -enable-anonymous-context-mangled-names -module-name a -emit-module-path \ /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf/main.partial.swiftmodule \ -o /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf/main.o
      1. Merging swift modules for a /home/sar/swift-source/build/buildbot_linux/swift-linux-powerpc64le/bin/swift -frontend -g -Onone -serialize-debugging-options -module-cache-path /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/module-cache-clang -sdk / -enable-anonymous-context-mangled-names -merge-modules \ -emit-module main.partial.swiftmodule \ -emit-parseable-module-interface-path /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf/a.swiftinterface \ -parse-as-library -sil-merge-partial-modules \ -disable-diagnostic-passes -disable-sil-perf-optzns \ -module-name a \ -o /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf/a.swiftmodule

I tried manually debugging the test binary, and here is the output:-

sar@e2641fd15168:\~$ /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/bin/lldb

(lldb) target create /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf/a.out Current executable set to '/home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf/a.out' (powerpc64le).

(lldb) breakpoint set -f /home/sar/swift-source/lldb/packages/Python/lldbsuite/test/lang/swift/anytype_array/main.swift -l 14 Breakpoint 1: where = a.out`main + 28 at main.swift:14:9, address = 0x0000000000000dbc

(lldb) b main Breakpoint 2: 2 locations.

(lldb) run Process 5911 launched: '/home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.testdwarf/a.out' (powerpc64le) Process 5911 stopped * thread #1, name = 'a.out', stop reason = breakpoint 1.1 2.1 frame #0: 0x0000000020000dbc a.out`main at main.swift:14:9 11 return 0 //%self.expect('frame variable -d run – patatino', substrs=['Any.Type', '3 values', 'String', 'Int', 'Float']) 12 } 13 -> 14 let \ = main() Target 0: (a.out) stopped.

(lldb) bt all * thread #1, name = 'a.out', stop reason = breakpoint 1.1 2.1 * frame #0: 0x0000000020000dbc a.out`main at main.swift:14:9 frame #1: 0x00003fffb737309c libc.so.6 frame #2: 0x00003fffb7373298 libc.so.6`__libc_start_main + 184

(lldb) image list [ 0] 6A70B8E5-8978-24E2-B6FB-CD2EA250BA58-77496103 0x0000000020000000 /home/sar/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lldb-test-build.noindex/lang/swift/anytype_array/lldbsuite.test.lldbtest.test_dwarf/a.out [ 1] 79B77F3A-F49D-6F75-0840-5120D5968CA9-0145C43B 0x00003fffb7fa0000 /lib/powerpc64le-linux-gnu/ld-2.23.so [ 2] 8FF97540-619C-F153-7002-5627A4A87181-B9D1C08F 0x00003fffb7f80000 [vdso] (0x00003fffb7f80000) [ 3] 3870E4E4 0x00003fffb7f00000 /home/sar/swift-source/build/buildbot_linux/swift-linux-powerpc64le/lib/swift/linux/libswiftSwiftOnoneSupport.so [ 4] A8C44F75 0x00003fffb7860000 /home/sar/swift-source/build/buildbot_linux/swift-linux-powerpc64le/lib/swift/linux/libswiftCore.so [ 5] 704EB228-6146-630E-7C5D-DE01D9FC81A4-02C264CE 0x00003fffb7640000 /usr/lib/powerpc64le-linux-gnu/libstdc++.so.6 [ 6] 88162EB5-0FAB-9455-1A1F-DA0D4804EE49-DDB88487 0x00003fffb7550000 /lib/powerpc64le-linux-gnu/libm.so.6 [ 7] 214936BC-5342-4FA4-02F8-0A9BDD696868-C8FAE57E 0x00003fffb7520000 /lib/powerpc64le-linux-gnu/libgcc_s.so.1 [ 8] 3201796D-D0A0-95E1-1FCC-32539807A6EF-D37B1F01 0x00003fffb7350000 /lib/powerpc64le-linux-gnu/libc.so.6 [ 9] 6B35AAA8-FB77-6536-3D47-C5FBFCA1D41F-DCB55B14 0x00003fffb7310000 /lib/powerpc64le-linux-gnu/libpthread.so.0 [ 10] A6DD345B-37DB-0CD4-1028-8C3E113AA9A7-6B3BD3ED 0x00003fffb72e0000 /usr/lib/powerpc64le-linux-gnu/libatomic.so.1 [ 11] 7AE2513B-2B12-9C1E-4E48-3869012B5849-9A7CCA93 0x00003fffb72b0000 /lib/powerpc64le-linux-gnu/libdl.so.2 [ 12] 1B52A2A3-E49D-38E7-05C6-1CED403ADFB1-15D6EDE6 0x00003fffb6f10000 /home/sar/swift-source/build/buildbot_linux/swift-linux-powerpc64le/lib/swift/linux/powerpc64le/libicui18nswift.so.61 [ 13] FC86F283-3712-3F13-DD26-CDD76B292E4B-ED2D3629 0x00003fffb6cc0000 /home/sar/swift-source/build/buildbot_linux/swift-linux-powerpc64le/lib/swift/linux/powerpc64le/libicuucswift.so.61 [ 14] BDAFEB7C-12EF-60B4-F753-765C2B2EBA12-0900EA0A 0x00003fffb5300000 /home/sar/swift-source/build/buildbot_linux/swift-linux-powerpc64le/lib/swift/linux/powerpc64le/libicudataswift.so.61

(lldb) thread list Process 5911 stopped * thread #1: tid = 5911, 0x0000000020000dbc a.out`main at main.swift:14:9, name = 'a.out', stop reason = breakpoint 1.1 2.1

(lldb) continue Process 5911 resuming Process 5911 stopped * thread #1, name = 'a.out', stop reason = breakpoint 2.2 frame #0: 0x0000000020000e10 a.out`main() at main.swift:7:5 4 5 func main() -> Int { 6 let patatino: [Any.Type] = [ -> 7 String.self, 8 Int.self, 9 Float.self, 10 ] Target 0: (a.out) stopped. (lldb) bt all * thread #1, name = 'a.out', stop reason = breakpoint 2.2 * frame #0: 0x0000000020000e10 a.out`main() at main.swift:7:5 frame #1: 0x0000000020000dc0 a.out`main at main.swift:14:9 frame #2: 0x00003fffb737309c libc.so.6 frame #3: 0x00003fffb7373298 libc.so.6`__libc_start_main + 184

(lldb) continue Process 5911 resuming Process 5911 exited with status = 0 (0x00000000)

(lldb)

Not sure what am I missing.