Skip to content
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

Local count too large with debug info in big project #18159

Closed
caxapexac opened this issue Nov 7, 2022 · 4 comments
Closed

Local count too large with debug info in big project #18159

caxapexac opened this issue Nov 7, 2022 · 4 comments

Comments

@caxapexac
Copy link

Please include the following in your bug report:

Version of emscripten/emsdk:
3.1.24

Error:
wasm streaming compile failed: CompileError: WebAssembly.instantiateStreaming(): Compiling function #68624:"reactphysics3d::SolveBallAndSocketJointSystem::..." failed: local count too large @+39257309

Everything works on the small projects but fails on the main big project (272 more compilation units)

Everything works on the big project in release builds

Everything works on the big project on debug with -g1 but fails with -g2 -fsanitize=undefined

Maybe there is a way to manually increase this locals max size in chrome launch settings or maybe some kind of link flag?

@kripken
Copy link
Member

kripken commented Nov 7, 2022

That is an agreed limitation in browsers, see WebAssembly/spec#607 I am not aware of browser-specific flags to work around it.

However, you may be able to work around it manually using wasm-opt -O1 file.wasm -o file.wasm. Even the low (-O1) opts will remove many locals, which may be enough to get it runnable. You can also just link with emcc -O2 but that will do a lot more optimizations.

@caxapexac
Copy link
Author

@kripken thanks!
Any chances wasm-opt would be added to a sdk pipeline? If not - lets close the issue then (1k opened issues here and this is wild, I hope to find some time and maybe participate in closing some of them...)

@kripken
Copy link
Member

kripken commented Nov 21, 2022

@caxapexac wasm-opt is included in the emsdk, so if you use that you can run it from there. emcc will run it automatically at -O2 and above, so you just need this as a manual workaround if you compile at lower optimization levels.

Help with the open issues would be great btw! 😄 Yes, there are quite a lot open. Many are just stale, I think, and people forget to close them.

@caxapexac
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants