-
Notifications
You must be signed in to change notification settings - Fork 29
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
Memory growth #23
Comments
Yeah, I think I saw a similar issue before, with rust compiler. I'm not sure if tinygo has similar build option tho. Alternatively, maybe it's possible to grow memory size after loading it through wasmtime API, so you don't have to modify wasm module itself: https://github.com/kawamuray/wasmtime-java/blob/master/src/main/java/io/github/kawamuray/wasmtime/Memory.java#L29 |
Thanks so much, @kawamuray I checked Memory.grow and it still returns the same error. Once I have this presentation out of the way I am going to raise these issues with the TinyGo team. I have for now got a pretty sweet proof of concept running where I can create a WASM module in Go that uses go`s crypto libraries to encrypt and decrypt files, this is then consumed from a Rust WASM module. Strings are always fun but never more so when memory is not shared across modules. A couple of creative hacks and a host function later and that problem is solved. I don't suppose you know of any resources that have any status on the situation with Berkley sockets and WASM? Kind regards, Nic |
Glad to hear that :)
I've been watching some issues like WebAssembly/WASI#312 and bytecodealliance/wasmtime#70 but I think nothing usable has shipped yet. |
Hi, I don't think this is an issue with wasmtime-java however I would appreciate your thoughts on the below so that I can feed some info back to the TInyGo team.
With a TinyGo compiled application that opens a file, encrypts it using AES128, and then writes the file back to disk I get the following error when trying to write the file.
Digging into this I found that it is not actually a problem with the file write in Wasi but the TinyGo applications use of the Wasm memory. My uneducated guess is that TinyGo is either not allocating enough memory for the application or that the callbacks to grow the memory are not failing silently. If I manually allocate more pages of memory than the
2
TinyGo allocates the problem disappears.Initial TinyGo allocation 128Kb
Modified to 1Mb
Does this look like a bug in TinyGo?
go.zip
The text was updated successfully, but these errors were encountered: