-
Notifications
You must be signed in to change notification settings - Fork 30
Compiler > 5.3.1 crashes when building Tokamak #2851
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
Demangled version of the symbol: |
Swift 5.4 and later introduce additional codegen verification passes. It's either there's a bug in codegen, which verifier uncovered, or there's something with the verifier... |
Building for macOS with |
Does anyone know by any chance if this is still an issue with the latest 5.4 snapshots? |
Unfortunately still is. Clone latest Tokamak. $ /Library/Developer/Toolchains/swift-wasm-5.4-SNAPSHOT-2021-04-25-a.xctoolchain/usr/bin/swift build -c release --product TokamakDemo --triple wasm32-unknown-wasi
[...]
Incorrect number of arguments passed to called function!
call swiftcc void @"$s11TokamakCore17EnvironmentValuesV15foregroundColorAA0F0VSgvplACTK"(%T11TokamakCore5ColorVSg* noalias nocapture sret %0, %T11TokamakCore17EnvironmentValuesV* noalias nocapture dereferenceable(4) %1, i8* %2), !dbg !836
in function keypath_get
<unknown>:0: error: fatal error encountered during compilation; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project
<unknown>:0: note: Broken function found, compilation aborted!
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0. Running pass 'Module Verifier' on function '@keypath_get'
Incorrect number of arguments passed to called function!
call swiftcc void @"$s11TokamakCore17EnvironmentValuesV18_defaultAppStorageAA01_G8Provider_pSgvplACTK"(%T11TokamakCore16_StorageProvider_pSg* noalias nocapture sret %0, %T11TokamakCore17EnvironmentValuesV* noalias nocapture dereferenceable(4) %1, i8* %2), !dbg !1861
in function keypath_get
LLVM ERROR: Broken function found, compilation aborted! I tried different optimization levels + WMO on or off, with no success. There's also a Builiding for macOS |
I've just played around with this issue a little. As far as I can tell the issue is with Replacing uses of I remember vaguely that SwiftWASM always passes error pointers no matter whether something throws, which sounds like it could be related (I don't yet know whether the incorrect number mentioned in the error message means the last For reference these tests were done one the |
I added some debug logging, and found that the functions expect four arguments, while only three are given. So whatever is producing the IR to call them is failing to pass a fourth parameter. The type of the missing parameter seems to be a |
Using snapshot toolchains newer than 5.3.1 result in a compiler crash when building:
swift package init
/Library/Developer/Toolchains/swift-wasm-DEVELOPMENT-SNAPSHOT-2021-03-10-a.xctoolchain/usr/bin/swift build --triple wasm32-unknown-wasi -c release
Results in crash:
swift-wasm-DEVELOPMENT-SNAPSHOT-2021-02-22-a
swift-wasm-5.3.1-RELEASE
toolchainI could not get llvm-symbolizer (from built toolchain) to work...
The text was updated successfully, but these errors were encountered: