-
Notifications
You must be signed in to change notification settings - Fork 699
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
wat2wasm segfaults on .wat file with many nested if statements #2377
Comments
It depends... on the size of the .wat, do you get a more concise output from binaryen's In terms of memory consumption of wat2wasm, |
Thanks for the prompt response, But FYI: both |
Cool, what's the segfault? (E.g. if you make a debug build and run it in gdb, where does it segfault?) |
What is the reason for wanting to support such large files? Done't Wasm runtimes have internal limits that make running such files impossible? Perhaps we should instead just impose a limit on the size of any file we process? (see https://webassembly.github.io/spec/core/appendix/implementation.html#binary-format). |
Here is the segfault, hope it helps:
@sbc100 We extended the CertiCoq compiler with a Wasm backend. And in case you're wandering, the roundtrip with |
What wasm engine are are you able to run 20GB program on (or even 1GB program for that matter)? I would have assumed that such a program would be exceed the internal limits of any engine. |
It's just the |
I think I understand now, why the
Presumably, this adds quite a lot of whitespace. (gzip reduces the 16GB wat file to ~25MB) we now generate the semantically equivalent programs, where the else branch is moved to after the if-statement, like so:
This change reduced the Also, we generate code in SSA form, so one function has ~20k locals before we run |
You should be able to shorten that |
Running
wat2wasm
on a rather big file with many nested if-statements segfaults.Version: wabt 1.0.32-1 (debian bookworm)
System: Debian (with enough RAM + swap)
Steps to reproduce:
segfault:
CertiCoq.Benchmarks.tests.color.zip
The text was updated successfully, but these errors were encountered: