-
Notifications
You must be signed in to change notification settings - Fork 13.5k
WebAssembly compile crashes on Windows with assertions enabled #55120
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
@llvm/issue-subscribers-bug |
@llvm/issue-subscribers-backend-webassembly |
That's strange, building the empty function on godbolt works: https://llvm.godbolt.org/z/orzzKP3nv |
Yeah, I'm strongly suspecting it has something to do with my build environment. Otherwise this would have been noticed a long time ago. Note also that this only happens on Windows. Linux is not affected (didn't test macOS). |
I don't have an easy way to reproduce this issue, but as you say it's quite surprising. With Wasm being a default target, the windows buildbots will be compiling a whole bunch of WebAssembly .ll when running the LLVM unit tests. |
If anybody wants to reproduce this:
If I comment out all the assertions in the |
Thanks for such clear instructions on reproducing. One thing that might be interesting to compare is the output of llc with |
Thank you! I did that but unfortunately there is no difference at all until the crash. The last part of that (before "PLEASE submit a bug report to ...") is this:
|
Whatever I try, it appears that WebAssembly on my LLVM build just doesn't work with assertions enabled. I always hit an assertion in the WebAssembly CFG Sort pass. When I disable assertions, the resulting code seems to work fine.
It appears to happen with basically any code, but here is one example:
When I compile this file, it results in a crash:
That backtrace is hard to read, so here is one from GDB:
So apparently this assert is triggered:
llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp
Lines 370 to 371 in 0e27d08
I'm not at all familiar with this code or what it's supposed to do.
This is the CMake line I've used:
OS: Windows 10 (21H2) x64
Compiler:
g++.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
, installed viascoop install mingw
I'm doing the build from the Git Bash shell.
Any hints how I can debug this would be appreciated.
The text was updated successfully, but these errors were encountered: