-
Notifications
You must be signed in to change notification settings - Fork 834
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
"RuntimeError: out of bounds memory access" (C++ -> Wasm via Enscripten) #5324
Comments
If I change play.cpp lines 19-21 from: if (!minimal) {
cout << world->render();
} to if (!minimal) {
cout << world->render();
cout << "here?";
} it executes the first cout call, but not the second. So somewhere after successfully calling |
Hello! Thanks for the report. Sounds like an issue on our side, yes. |
@xdoardo Sure, happy to help debug, but the command doesn't seem to work :-/
Any ideas? Edit: Found online docs that suggest using
Edit: I'm also seeing error when running the emcc generated wasm file in wasmtime and wazero (output below), so perhaps it's less wasmer's issue and an issue should be filed with emscripten?
|
Thanks for taking the time to investigate and for pointing out the issue with Yes, assuming that it works natively, if it fails with other runtimes there's a chance that Nonetheless, until further notice, let's keep this issue open so I can investigate it. |
@xdoardo Just a quick follow up. Just upgraded emscripten from version 3.1.74 to the newly released 4.0.0, and still seeing the same issue. emscripten compiles fine without errors (one warning about implicit int to float, but fixing it doesn't affect anything). But the resulting wasm file still hits out of bounds memory access errors in wasmer, wasmtime, and wazero. Is there anything you would like me to do to help debug this? |
Describe the bug
I'm using enscripten to convert a C++ project (https://github.com/KieranP/Game-Of-Life-Implementations/tree/master/c%2B%2B) into WASM, and then using wasmer to run it. Compiling/running the application as C++ has no issues and
enscripten
reports no issues converting to wasm. When running with wasmer, am getting unexpected "RuntimeError: out of bounds memory access" errors.wasmer 5.0.4 (??????? 2024-12-17) binary: wasmer-cli commit-hash: commit-date: 2024-12-17 host: aarch64-apple-darwin compiler: cranelift c_api backend: rustc 1.83.0 (90b35a623 2024-11-26) (Homebrew) binary: rustc commit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf commit-date: 2024-11-26 host: aarch64-apple-darwin release: 1.83.0 LLVM version: 19.1.6
Steps to reproduce
Expected behavior
Should run without error. Errors should also indicate the cause a bit more clearly.
Actual behavior
Throws error that doesn't exist when running as C++ project. Location of out of bounds memory access unknown.
The text was updated successfully, but these errors were encountered: