Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-9534] LLDB test failures while building Swift 5.0 toolchain #4615

Open
swift-ci opened this issue Dec 18, 2018 · 7 comments
Open

[SR-9534] LLDB test failures while building Swift 5.0 toolchain #4615

swift-ci opened this issue Dec 18, 2018 · 7 comments
Labels
bug Something isn't working LLDB for Swift ppc64le

Comments

@swift-ci
Copy link

Previous ID SR-9534
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, ppc64le
Assignee None
Priority Medium

md5: 30ccbf58fcb1f35835d8a4c6b1f42b1c

Issue Description:

LLDB test failures while building Swift 5.0 toolchain. Details of the test failures are attached in the document.

Sample test failure:-

********************
Testing: 0 .
FAIL: lldb-Suite :: benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py (116 of 1566)
******************** TEST 'lldb-Suite :: benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py' FAILED ********************
lldb version 7.0.0 (https://github.com/apple/swift-lldb.git revision 450ac50b3d6c87b246f22f6a883b15c02f372e0c)
 Swift-5.0 (revision f6eeb3adca4f6ed7e66d4463883540c361e8f2cf)
 clang revision ad7fb41b1dc11fb61584125212aec259ebc583db
 llvm revision f63b283c7143aef31863d5915c28ee79ed390be3
LLDB library dir: /root/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/bin
LLDB import library dir: /root/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/bin
Traceback (most recent call last):
 File "/root/swift-source/lldb/test/dotest.py", line 7, in <module>
 lldbsuite.test.run_suite()
 File "/root/swift-source/lldb/packages/Python/lldbsuite/test/dotest.py", line 1258, in run_suite
 import lldb
 File "/root/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lib/python3.5/site-packages/lldb/__init__.py", line 53, in <module>
 _lldb = swig_import_helper()
 File "/root/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lib/python3.5/site-packages/lldb/__init__.py", line 49, in swig_import_helper
 _mod = imp.load_module('_lldb', fp, pathname, description)
ImportError: dynamic module does not define init function (init_lldb)
@swift-ci
Copy link
Author

Comment by Sarvesh Tamba (JIRA)

@belkadan does this look familiar to you? Any inputs or suggestions on this?

@belkadan
Copy link

I don't work on LLDB, so I don't see LLDB test failures that often. In this case I see that the backtrace mentions "swig", so maybe your version of SWIG isn't new enough, or there's something else wrong with the LLDB Python bindings.

@swift-ci
Copy link
Author

Comment by Sarvesh Tamba (JIRA)

Hi,

I have installed all the development dependencies as mentioned in https://github.com/apple/swift:-

sudo apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev libcurl4-openssl-dev systemtap-sdt-dev tzdata rsync

I also tried setting the PYTHONPATH as mentioned in:-
https://stackoverflow.com/questions/30869945/how-to-import-lldb-in-a-python-script

The problem still persists and affects around 865 tests due to this reason.

Let me know if I am missing anything else.

@swift-ci
Copy link
Author

Comment by Sarvesh Tamba (JIRA)

Set the python path environment variable PYTHONPATH to what *lldb P* evaluated to:

root@877e1c79bb05:~# /root/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/bin/lldb -P
/root/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lib/python2.7/site-packages

root@877e1c79bb05:~# export PYTHONPATH="/root/swift-source/build/buildbot_linux/lldb-linux-powerpc64le/lib/python2.7/site-packages"

With this 865/883 failing test cases passed which previously failed with common errors as below:-
ImportError: dynamic module does not define init function (init_lldb)

Current status of lldb test suite is as below:-
Expected Passes : 1402
Unsupported Tests : 49
Unexpected Failures: 127

Many of the remaining test cases throw up errors like below:-

Error Type 1(Approx 49 occurences):-

error: Couldn't lookup symbols:
swift_beginAccess
swift_endAccess
error: Couldn't lookup symbols:
swift_allocError
swift_getWitnessTable
swift_willThrow
error: Couldn't lookup symbols:
method descriptor for Swift.Hashable._rawHashValue(seed: Swift.Int) -> Swift.Int
method descriptor for Swift.Hashable.hash(into: inout Swift.Hasher) -> ()
method descriptor for Swift.Hashable.hashValue.getter : Swift.Int
protocol descriptor for Swift.Hashable

[...Many More...]

Error Type 2(Approx 51 occurences):-

AssertionError: False is not True : inline test did not hit a single breakpoint

Error Type 3(Approx 13 occurences):-

AssertionError: False is not True : Expected 1 thread to stop at breakpoint, 0 did.

Investigating on the failure test cases further. Attached is the test run log.

log_swift_master_buildtoolchain.log

@swift-ci
Copy link
Author

Comment by Sarvesh Tamba (JIRA)

@belkadan, Do you know anyone who can help me resolving with these lldb test suite failures?

@swift-ci
Copy link
Author

swift-ci commented Mar 5, 2019

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
Copy link
Author

swift-ci commented Mar 8, 2019

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.test_dwarf/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.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LLDB for Swift ppc64le
Projects
None yet
Development

No branches or pull requests

2 participants