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

Wasm RuntimeError when long strings are put into input fields #2

Open
flange-ipb opened this issue Jul 19, 2024 · 0 comments
Open

Wasm RuntimeError when long strings are put into input fields #2

flange-ipb opened this issue Jul 19, 2024 · 0 comments

Comments

@flange-ipb
Copy link
Collaborator

When putting in very long strings (larger than around 1MB) into text input fields (Molfile, InChI/AuxInfo, RXN/RD file, RInChI and RAuxInfo fields) the Wasm module call drops a RuntimeError with the message:

  • in Firefox: index out of bounds
  • in Chromium: memory access out of bounds

In further function calls the Wasm module stays unresponsive dropping the same exception, thus the application is not usable anymore. All Wasm modules (the two InChI modules and the RInChI module) are loaded when the page loads, so the only way to get a usable application back is to reload the page.

What doesn't help is to build the Wasm module with the ALLOW_MEMORY_GROWTH linker flag.

What can help is to build the Wasm module with a bigger stack size. The linker flag STACK_SIZE is set to 1 MB at the moment, so that explains my "larger than around 1MB". According to Emscripten's documentation JavaScript strings are passed via the C stack (see note in ccall documentation and implementation).

Needs more investigation ...

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

1 participant