-
Notifications
You must be signed in to change notification settings - Fork 746
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
Precompiled Linux releases segfault on wasm file #2273
Comments
Hmm, interesting... I ran this many times locally and didn't see a problem. I also ran diagnostics like But I can confirm that running the release binaries does hit this bug. It doesn't happen with From the stack trace, it throws an exception (which is normal in the Precompute pass, it indicates something is not precomputable), but somehow the c++ runtime code ends up aborting because of that. So something is definitely wrong with the release binaries we are generating here. Maybe upgrading/updating the release build compiler would fix things? Could be a compiler bug perhaps. If we can't figure this out, one option is to just use |
Hm yeah poking around I wasn't able to see how to easily update the C compiler, but I did test out switching to clang to build the release binary and that looks to work (or at least I wasn't able to reproduce the segfault). How's switching to clang sound? (not that I have any idea why switching to clang appears to fix it, it's probably something about libstdc++ implementations or something like that I guess?) |
Clang sounds good! |
This fixes WebAssembly#2273 for... unknown reasons. The tl;dr; is that the current release binaries built in this Alpine container seem to segfault when run over some wasm files when an exception is thrown, but clang-built binaries magically seems to not segfault!
This fixes WebAssembly#2273 for... unknown reasons. The tl;dr; is that the current release binaries built in this Alpine container seem to segfault when run over some wasm files when an exception is thrown, but clang-built binaries magically seems to not segfault!
This fixes #2273 for... unknown reasons. The tl;dr; is that the current release binaries built in this Alpine container seem to segfault when run over some wasm files when an exception is thrown, but clang-built binaries magically seems to not segfault!
I still have this issue. Has this been included in the 89 version? I'm using Ubuntu 18 (64 bit) and the download from https://github.com/WebAssembly/binaryen/releases/download/version_89/binaryen-version_89-x86_64-linux.tar.gz and encounter a core dump. |
@newtack yes, looks like this was in the 89 release. I wonder if there's some ABI mismatch or something causing this. Maybe we need to statically link in some system library like libc++? Perhaps valgrind or gdb provide more info in a stack trace? |
the 89 release is already statically linked. they're also stripped of debug info, so not clear how to get a useful backtrace ... i don't see debug files attached to the release or in the tarball. i can confirm that adding
|
This is a continued effort to try and track down WebAssembly#2273 which came up again and is still present in the current release binaries. Issues like crystal-lang/crystal#4276 may indicate that C++ exceptions are just somewhat broken with static linking when using alpine, but I've at least locally been able to verify that upgrading the container produces working binaries which previously segfaulted on some wasm files.
This is a continued effort to try and track down WebAssembly#2273 which came up again and is still present in the current release binaries. Issues like crystal-lang/crystal#4276 may indicate that C++ exceptions are just somewhat broken with static linking when using alpine, but I've at least locally been able to verify that upgrading the container produces working binaries which previously segfaulted on some wasm files.
This is a continued effort to try and track down #2273 which came up again and is still present in the current release binaries. Issues like crystal-lang/crystal#4276 may indicate that C++ exceptions are just somewhat broken with static linking when using alpine, but I've at least locally been able to verify that upgrading the container produces working binaries which previously segfaulted on some wasm files.
for posterity, these versions still crashed long after this issue was closed:
these don't seem to crash:
couldn't easily test v102 as binaries weren't made for the release. |
Reading the above, it seems like we were never sure what causes this, but that switching to clang helped. So if someone can get a PR for our release pipeline here to build with clang that could fix it. I assume the changes would go here: |
I can't seem to reproduce this when building locally from source, but the precompiled releases are segfaulting when executed over some wasm files locally on Linux. This was originally reported at rustwasm/wasm-pack#696 and can be reproduced by downloading the latest Linux binary release and running
wasm-opt -O1 input.wasm -o /dev/null
over this wasm file: wasmboypluginhqx_bg.wasm.gzWhen I reproduce the build process for the Linux releases locally I get a build which sometimes works and sometimes doesn't (most of it doesn't). I've at least ruled out the
strip
step as the binaries coming out ofmake
are the ones which segfault:The stack trace for the abort is:
This does sort of look build-related and all about unwinding, although I won't pretend to understand what is going on here and how this could be fixed.
The text was updated successfully, but these errors were encountered: