-
Notifications
You must be signed in to change notification settings - Fork 451
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
OCaml's Bigarray module can't handle large linear memory sizes #80
Comments
One more note: I noticed this while working on wasm's integer operator semantics, and noticed that |
I think you're correct. This is a limitation on 32-bit systems.
I suggest defining `address` and `size` to be `nativeint`. Then
`address_of_value` would no longer wrap.
Furthermore, the `create` function then needs to check whether the size
overflows an int, and if so, raise `Out_of_memory`. That way, sizes too
large are not observably different from OOM, which seems like suitable
behaviour.
Analogously, load & store functions in memory.ml need to check whether the
index overflows int range and raise `Bounds` in that case.
|
I consider this basically resolved by #108 which at least confines the hand waving to one well-commented block. |
littledan
pushed a commit
to littledan/spec
that referenced
this issue
Mar 4, 2018
littledan
pushed a commit
to littledan/spec
that referenced
this issue
Mar 4, 2018
Revert "Update docs to allow import/export mut globals (WebAssembly#81)" This reverts commit 5d2ad6e. Revert "Support import/export mut globals in interpreter (WebAssembly#80)" This reverts commit 07a6fb2.
eqrion
pushed a commit
to eqrion/wasm-spec
that referenced
this issue
Jul 18, 2019
The data count section has a count that must match the number of data segments. If the data count section isn't present, then `memory.init` and `data.drop` cannot be used. Fixes issue WebAssembly#73.
alexcrichton
pushed a commit
to alexcrichton/spec
that referenced
this issue
Nov 19, 2019
awendland
pushed a commit
to awendland/webassembly-spec-abstypes
that referenced
this issue
Mar 26, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
memory.ml is currently using OCaml's Bigarray module, specifically Bigarray.Array1, to represent linear memory.
Bigarray's interfaces all use OCaml's int type for array extents and index values. While int has a host-dependent size, it is 31 bits on some common systems. It is also signed, so it can only hold values less than 1<<30.
Consequently, on 32-bit hosts, it seems the WebAssembly reference interpreter is limited to linear memory sizes less than 1 GiB, even when the underlying host is capable of allocating that much memory.
Am I understanding everything here correctly? And if so, are there any alternatives to Bigarray which allow for bigger sizes?
The text was updated successfully, but these errors were encountered: