Closed silbinarywolf closed 6 months ago
Thanks for the PR! I'm not sure what performance implications those have (e.g. even though it's only in debug, more complex programs may become 'too slow' with those settings).
If it becomes too slow we might want to make those settings configurable via EmLinkOptions
, but I think for now at least it makes sense to merge it as is.
The current Zig nightly has pretty severe breakge unfortunately (installing packages from github doesn't work - that's why the CI fails, and the wasm32-emscripten
target seems to be broken, I get an error root struct of file 'os.wasi' has no member named 'E'
(I'll merge the PR anyways, since the change is trivial).
I've found adding these has helped me debug and actually understand why my Emscripten application was randomly crashing.
For example, I was loading an image with the Zigimg package and the errors in my Chrome/Firefox DevTools would just say segmentation fault without pointing at a clear reason for the crash.
With
-sSTACK_OVERFLOW_CHECK=1
, I was able to instead get the following message and realize that I needed to bump my stack size.