-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SR-10335] Swift compiler crash while compiling the BlueSignals dependency #52735
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
Comments
Comment by Sarvesh Tamba (JIRA) Here is the source of the file which is found in the error above:- https://github.com/IBM-Swift/BlueSignals/blob/master/Sources/Signals/Signals.swift |
It'd be helpful to run that failing `swift -frontend` command in a debugger to get a symbolicated stack trace. |
Comment by Sarvesh Tamba (JIRA) Hi @jrose, I built swift toolchain in release mode as debug build runs out of space (needs more than 80GB space and 6 hrs of build time). sar@267538d18c75:~/extra-tests-swift/kitura/Kitura$ gdb /home/sar/extra-tests-swift/usr/bin/swift core I tried going through the code in the stack trace, however I am not well versed with the finer details of the code and will require help from swift community. Anyone you could point me to who can guide me on this? Also I tried runnung these same Kitura tests on x86_64 using the release candidate at: In this case the swift execution proceeds and passes all the tests in the Kitura framework. |
Okay, so the differences here are whether the function type is escaping…which shouldn't make a difference when used within a larger type like this. @slavapestov, @adrian-prantl, have either of you seen this mangling failure before? It doesn't seem like something that would be PPC64-related at all. |
I don't think it's PowerPC64-related. If you look at the original type, it's "(function_type representation=c escaping", while the demangled version does not have 'escaping'. This doesn't make sense; escaping/non-escaping should not be a property of a C function pointer at all. We should not set the escaping bit when we build C function pointer types. |
> I built swift toolchain in release mode as debug build runs out of space (needs more than 80GB space and 6 hrs of build time). If you are building on Linux, I'd recommend configuring with -DLLVM_USE_SPLIT_DWARF=1. Alternatively / in addition you can combine a release LLVM with a debug swift compiler by building -r --debug-swift. > Slava Pestov, Adrian Prantl, have either of you seen this mangling failure before? This is probably the assertion that verifies that the type can be reconstructed form the mangled name. If you can the mangled name for which it is failing @slavapestov may be able to fix it. |
stamba (JIRA User) As a workaround, you can build without debug info for now. Sorry for the inconvenience. |
Comment by Sarvesh Tamba (JIRA) @slavapestov do you mean I build the swift toolchain without debug info? As mentioned above, that is exactly what I am doing right now, i.e building swift toolchain in release mode due to space constraints for a debug build. And the tests fail with this release built swift compiler. If you meant build the tests those are failing without debug info, can you please let me know how do I go about this? |
Comment by Sarvesh Tamba (JIRA) > This is probably the assertion that verifies that the type can be reconstructed form the mangled name. If you can the mangled name for which it is failing Slava Pestov may be able to fix it. |
Sorry, I meant build Kitura without debug info. |
stamba (JIRA User) We have enough information to construct a test case and fix the issue. Thank you for the bug report. |
Comment by David Jones (JIRA) @slavapestov Thought I should add that this is not specific to PPC64LE. I get the same failure trying to compile the BlueSignals package on x64 (Ubuntu 16.04) with the latest 5.1 snapshot (5.1-DEVELOPMENT-SNAPSHOT-2019-05-29-a). It compiles fine with the 5.0.1-RELEASE build. (see: Kitura/BlueSignals#20 |
Environment
PowerPC64LE
Additional Detail from JIRA
md5: 53c3f2819c4d04f49868102943164497
Issue Description:
I have built Apple Swift 5 toolchain on PowerPC64LE. I also managed to run all the test suites in the toolchain.
Now I am trying to build and run tests in Kitura for Swift.
I tried the following steps mentioned at https://github.com/IBM-Swift/Kitura :-
Clone this repository.
$ git clone https://github.com/IBM-Swift/Kitura
Build and run tests.
$ swift test
However I am seeing the below issues.
{{ sar@267538d18c75:~/extra-tests-swift/kitura$ git clone https://github.com/IBM-Swift/Kitura
Cloning into 'Kitura'...
remote: Enumerating objects: 122, done.
remote: Counting objects: 100% (122/122), done.
remote: Compressing objects: 100% (70/70), done.
remote: Total 7777 (delta 56), reused 101 (delta 45), pack-reused 7655
Receiving objects: 100% (7777/7777), 6.46 MiB | 2.98 MiB/s, done.
Resolving deltas: 100% (4696/4696), done.
Checking connectivity... done.
sar@267538d18c75:~/extra-tests-swift/kitura$ cd Kitura/
sar@267538d18c75:~/extra-tests-swift/kitura/Kitura$ ls
Configuration LICENSE.txt Package.swift [email protected] README.md Sources docker-compose.yml vagrantfile
Documentation NOTICES.txt [email protected] [email protected] Scripts Tests docs
sar@267538d18c75:
/extra-tests-swift/kitura/Kitura$ swift testpartial.swiftmodule -emit-module-doc-path /home/sar/extra-tests-swift/kitura/Kitura/.build/powerpc64le-unknown-linux/debug/Signals.build/Signals~partial.swiftdoc -emit-dependencies-path /home/sar/extra-tests-swift/kitura/Kitura/.build/powerpc64le-unknown-linux/debug/Signals.build/Signals.d -emit-reference-dependencies-path /home/sar/extra-tests-swift/kitura/Kitura/.build/powerpc64le-unknown-linux/debug/Signals.build/Signals.swiftdeps -target powerpc64le-unknown-linux -disable-objc-interop -sdk / -I /home/sar/extra-tests-swift/kitura/Kitura/.build/powerpc64le-unknown-linux/debug -enable-testing -g -module-cache-path /home/sar/extra-tests-swift/kitura/Kitura/.build/powerpc64le-unknown-linux/debug/ModuleCache -swift-version 4 -Onone -D SWIFT_PACKAGE -D DEBUG -color-diagnostics -enable-anonymous-context-mangled-names -parse-as-library -module-name Signals -o /home/sar/extra-tests-swift/kitura/Kitura/.build/powerpc64le-unknown-linux/debug/Signals.build/Signals.swift.o -index-store-path /home/sar/extra-tests-swift/kitura/Kitura/.build/powerpc64le-unknown-linux/debug/index/store -index-system-modules 1. While emitting IR SIL function "@$s7SignalsAAC4trap7signalsySayAB6SignalO6signal_ys5Int32VXC6actiontG_tFZ". for 'trap(signals:)' (at /home/sar/extra-tests-swift/kitura/Kitura/.build/checkouts/BlueSignals/Sources/Signals/Signals.swift:123:9)Fetching https://github.com/IBM-Swift/Kitura-net.git
Fetching https://github.com/IBM-Swift/Kitura-TemplateEngine.git
Fetching https://github.com/IBM-Swift/KituraContracts.git
Fetching https://github.com/IBM-Swift/TypeDecoder.git
Fetching https://github.com/IBM-Swift/LoggerAPI.git
Fetching https://github.com/IBM-Swift/BlueSignals.git
Fetching https://github.com/IBM-Swift/BlueSocket.git
Fetching https://github.com/IBM-Swift/BlueSSLService.git
Fetching https://github.com/IBM-Swift/OpenSSL.git
Completed resolution in 15.42s
Cloning https://github.com/IBM-Swift/OpenSSL.git
Resolving https://github.com/IBM-Swift/OpenSSL.git at 2.2.2
Cloning https://github.com/IBM-Swift/LoggerAPI.git
Resolving https://github.com/IBM-Swift/LoggerAPI.git at 1.8.1
Cloning https://github.com/IBM-Swift/KituraContracts.git
Resolving https://github.com/IBM-Swift/KituraContracts.git at 1.1.2
Cloning https://github.com/IBM-Swift/Kitura-net.git
Resolving https://github.com/IBM-Swift/Kitura-net.git at 2.2.1
Cloning https://github.com/IBM-Swift/TypeDecoder.git
Resolving https://github.com/IBM-Swift/TypeDecoder.git at 1.3.3
Cloning https://github.com/IBM-Swift/BlueSSLService.git
Resolving https://github.com/IBM-Swift/BlueSSLService.git at 1.0.45
Cloning https://github.com/IBM-Swift/BlueSocket.git
Resolving https://github.com/IBM-Swift/BlueSocket.git at 1.0.45
Cloning https://github.com/IBM-Swift/Kitura-TemplateEngine.git
Resolving https://github.com/IBM-Swift/Kitura-TemplateEngine.git at 2.0.1
Cloning https://github.com/IBM-Swift/BlueSignals.git
Resolving https://github.com/IBM-Swift/BlueSignals.git at 1.0.17
Incorrect reconstructed type for $sSay7SignalsAAC6SignalO6signal_ys5Int32VXC6actiontGD
Original type:
(bound_generic_struct_type decl=Swift.(file).Array
(tuple_type num_elements=2
(tuple_type_elt name=signal
(enum_type decl=Signals.(file).Signals.Signal@/home/sar/extra-tests-swift/kitura/Kitura/.build/checkouts/BlueSignals/Sources/Signals/Signals.swift:38:14
(parent=class_type decl=Signals.(file).Signals@/home/sar/extra-tests-swift/kitura/Kitura/.build/checkouts/BlueSignals/Sources/Signals/Signals.swift:31:14)))
(tuple_type_elt name=action
(function_type representation=c escaping
(input=function_params num_params=1
(param
(struct_type decl=Swift.(file).Int32)))
(output=tuple_type num_elements=0)))))
Reconstructed type:
(bound_generic_struct_type decl=Swift.(file).Array
(tuple_type num_elements=2
(tuple_type_elt name=signal
(enum_type decl=Signals.(file).Signals.Signal@/home/sar/extra-tests-swift/kitura/Kitura/.build/checkouts/BlueSignals/Sources/Signals/Signals.swift:38:14
(parent=class_type decl=Signals.(file).Signals@/home/sar/extra-tests-swift/kitura/Kitura/.build/checkouts/BlueSignals/Sources/Signals/Signals.swift:31:14)))
(tuple_type_elt name=action
(function_type representation=c
(input=function_params num_params=1
(param
(struct_type decl=Swift.(file).Int32)))
(output=tuple_type num_elements=0)))))
Stack dump:
0. Program arguments: /home/sar/extra-tests-swift/usr/bin/swift -frontend -c -primary-file /home/sar/extra-tests-swift/kitura/Kitura/.build/checkouts/BlueSignals/Sources/Signals/Signals.swift -emit-module-path /home/sar/extra-tests-swift/kitura/Kitura/.build/powerpc64le-unknown-linux/debug/Signals.build/Signals
/home/sar/extra-tests-swift/usr/bin/swift[0x150bc2a8]
/home/sar/extra-tests-swift/usr/bin/swift[0x150b9548]
/home/sar/extra-tests-swift/usr/bin/swift[0x150bc968]
[0x3fff7ac404d8]
/lib/powerpc64le-linux-gnu/libc.so.6(gsignal+0x40)[0x3fff7a5bec90]
/lib/powerpc64le-linux-gnu/libc.so.6(abort+0x2b4)[0x3fff7a5c11f4]
/home/sar/extra-tests-swift/usr/bin/swift[0x1039663c]
/home/sar/extra-tests-swift/usr/bin/swift[0x103970e8]
/home/sar/extra-tests-swift/usr/bin/swift[0x10396cb4]
/home/sar/extra-tests-swift/usr/bin/swift[0x1038c6e4]
/home/sar/extra-tests-swift/usr/bin/swift[0x1038d450]
/home/sar/extra-tests-swift/usr/bin/swift[0x1038d340]
/home/sar/extra-tests-swift/usr/bin/swift[0x103a26a4]
/home/sar/extra-tests-swift/usr/bin/swift[0x1028dedc]
/home/sar/extra-tests-swift/usr/bin/swift[0x101cfff0]
/home/sar/extra-tests-swift/usr/bin/swift[0x101d0778]
/home/sar/extra-tests-swift/usr/bin/swift[0x1012b860]
/home/sar/extra-tests-swift/usr/bin/swift[0x10126c90]
/home/sar/extra-tests-swift/usr/bin/swift[0x100aa89c]
/home/sar/extra-tests-swift/usr/bin/swift[0x100a9ee0]
/lib/powerpc64le-linux-gnu/libc.so.6(+0x2309c)[0x3fff7a5a309c]
/lib/powerpc64le-linux-gnu/libc.so.6(__libc_start_main+0xb8)[0x3fff7a5a3298]
sar@267538d18c75:~/extra-tests-swift/kitura/Kitura$}}
Can anyone explain what this piece of code is trying to do?
Also if the error looks familiar or am I missing anything here?
The text was updated successfully, but these errors were encountered: