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

[BUG] requested new array is too large #18

Closed
cometkim opened this issue Dec 14, 2023 · 2 comments
Closed

[BUG] requested new array is too large #18

cometkim opened this issue Dec 14, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@cometkim
Copy link

cometkim commented Dec 14, 2023

Describe the bug

After a few modifications related to export functions, the build was successful, but the following error occurred when running the main code.

Uncaught RuntimeError: requested new array is too large.

image

I don't know where exactly the error is produced. I couldn't find any information searching in various places.

This is the source code https://github.com/rescript-lang/rescript-compiler/blob/master/jscomp/jsoo/jsoo_playground_main.ml and WASM the build I made using wasm_of_ocaml https://github.com/cometkim/rescript-wasm-test

Expected behavior

I expect it to have the same behavior as the existing jsoo build (which works pretty well). Then I can compare what (mostly performance) difference it actually makes.

To add more context, the module is used in the ReScript's playground. I guess this could be the ideal use case for WebAssembly + WebWorker.

Versions

  • Chrome 119.0.6045.199 (It's failed to WebAssembly.instantiate in Node.js, so I'm testing it in Chrome)
  • ocamlc 4.14.0
  • js_of_ocaml (lib, compiler) 5.3.0
  • wasm_of_ocaml-compiler 5.3.0-wasm
  • wasm-merge (binaryen) 116
@cometkim cometkim added the bug Something isn't working label Dec 14, 2023
@vouillon
Copy link
Collaborator

I was expecting file descriptors to be small integers, so I'm storing some information in an array using them as an index. But memfs uses large integers (see streamich/memfs#607).
I'm going to fix that.

@vouillon
Copy link
Collaborator

I have pushes a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants