Skip to content

String.create error in interpreter #156

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

Closed
kripken opened this issue Oct 30, 2015 · 5 comments · Fixed by #197
Closed

String.create error in interpreter #156

kripken opened this issue Oct 30, 2015 · 5 comments · Fixed by #197

Comments

@kripken
Copy link
Member

kripken commented Oct 30, 2015

I tried to parse the Poppler PDF library compiled to .wast in the interpreter. It's 39MB, and the interpreter errors on

[..]/spec/ml-proto/wasm: uncaught exception Invalid_argument("String.create")
Raised by primitive operation at file "host/main.ml", line 12, characters 2-206
Called from file "host/main.ml", line 53, characters 15-24
Called from file "list.ml", line 73, characters 12-15
Called from file "host/main.ml", line 86, characters 4-33

I'm not that familiar with ocaml, so I'm not sure what to do to investigate this further.

I can attach the file if that's useful (too big for github though, I think).

@kripken
Copy link
Member Author

kripken commented Oct 31, 2015

Investigating this, it looks like the interpreter has a limit of around 16MB on input size, any larger and that error is hit. There is nothing special in the content, it's just a size issue.

I know nothing about ocaml (I spent some time today trying to get a printf for debugging in the interpreter, unsuccessfully ;) ), is there a fixed string size limit there or something like that?

@hhugo
Copy link

hhugo commented Oct 31, 2015

There is indeed a 16mb limit for string in 32bit. Try with a 64 bit ocaml compiler.

@kripken
Copy link
Member Author

kripken commented Oct 31, 2015

I see, thanks. I'm on 32-bit atm so I guess I'm stuck.

@hhugo
Copy link

hhugo commented Oct 31, 2015

A solution would be not to load the all file as a string - by using Lexing.from_channel instead of Lexing.from_string.
https://github.com/WebAssembly/spec/blob/master/ml-proto/host/main.ml#L22

@rossberg
Copy link
Member

rossberg commented Dec 8, 2015

I believe this was fixed by #197. Please reopen if you keep seeing the problem.

ngzhian pushed a commit to ngzhian/spec that referenced this issue Nov 4, 2021
* [test] Use unified assert_result* assertion

to replace assert_return_arithmetic_nan and assert_return_canonical_nan

Tests are pulled from WAVM/WAVM#240

* Correct property name
dhil pushed a commit to dhil/webassembly-spec that referenced this issue Mar 2, 2023
It looks people have generally agreed on removing `unwind` in the MVP
spec, as it overlaps with `catch_all` in functionality.

Closes WebAssembly#153.
rossberg added a commit that referenced this issue Sep 4, 2024
Add a smoke test for consistent nondeterminism
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

Successfully merging a pull request may close this issue.

3 participants