-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
asm2wasm: Assertion `functionsMap.find(curr->name) == functionsMap.end()' failed #5288
Comments
Looks like that asm.js has a duplicate function,
Do you have the bitcode that it was generated from? The bug is probably at the bitcode => asm.js level. |
Here is it: libc_test-fe212f5bb0be8707.0.o.zip I'm using rust 1.18, which uses llvm 4.0... |
The same error happens with rust 1.17, which uses llvm 3.9. |
I'm not able to test this on emscripten incoming (1.37.13), as I get
Does that emcc command work for you? Or is there another way I should be reproducing the problem? |
Thanks for investigate this. I can execute I think that the best way is to execute the rust compiler... If you do not want to install the rust compiler in your system, you can run it inside a docker container (if you install rustup outside a container, you can uninstall it with the command rustup uninstall, which removes everything that was installed):
The artifacts are generate in |
If it doesn't crash for you with that version, then I suspect it's because the sdk build doesn't have assertions, while my local build does. I think we need to find out what's causing those asserts, as they could be the reason for the bug reported here (but it's also possible it's a red herring). Perhaps is the bitcode old, or being linked with something old? A full rebuild from scratch of all bitcode files might help. (I could try the rust compiler, but I don't know enough about it to easily debug into it. What I need here is just the emscripten commands it issues.) |
Using emscripten incoming I got the same error as you. I create a a zip file with all required obj files to generate an .js. The command |
To make it clear, using |
…ented in compiled code, do not add from the library - it may be duplicate code if we do. instead, make sure to export the compiled version so js libraries can reach it. fixes #5288
Thanks, now I can see the problem directly. #5299 should fix it. (I don't see those assertions again, btw - that might be an entirely separate issue. Very strange.) |
FWIW I also hit this issue today in a different codebase, and can confirm that #5299 fixed it for me. |
Thanks for confirming @rfk. Should be fixed now with that PR merged. |
Thanks @kripken! |
It would be nice to have this fix. |
I tagged |
@kripken Thank you!! |
I got this assertion error trying to build libc-test (an rust crate).
The error can be reproduced running
asm2wasm
on this file.The text was updated successfully, but these errors were encountered: