Stream: wamr

Topic: Hello-world is raising an "allocate memory failed"


view this post on Zulip Gilles ORAZI (Jun 10 2024 at 14:36):

Hi, I am starting my journey with WAMR, trying to figure out if it would be well suited for our next project. For now, I am trying to comile and run the "hello world" (from here https://wamr.gitbook.io/document/basics/getting-started/on_host). I basically copy/pasted the commands from the "host preparation" and running the program on host. Everything seems to install and compile perfectly, with no error. And at runtime I get:

-> % ./iwasm test.wasm
[21:49:39:153 - 7F08B87FBB80]: warning: allocate 16 bytes memory failed
Exception: allocate memory failed

Any hint on what might be the issue?

Now we have our host set up, we can build our hello world program and run it using WAMR.

view this post on Zulip Mats Brorsson (Jun 10 2024 at 17:04):

What platform and architecture are you on?

view this post on Zulip Gilles ORAZI (Jun 10 2024 at 17:45):

sorry I forgot to mention : I tried on ubuntu 24 and WSL hosting a ubuntu 20.

view this post on Zulip lum1n0us (Jun 11 2024 at 03:09):

May I ask which repo or branch you are using? Since there is no "app-samples" in https://github.com/bytecodealliance/wasm-micro-runtime currently

WebAssembly Micro Runtime (WAMR). Contribute to bytecodealliance/wasm-micro-runtime development by creating an account on GitHub.

view this post on Zulip Gilles ORAZI (Jun 11 2024 at 06:43):

Here it is : https://github.com/bytecodealliance/wasm-micro-runtime/tree/main/product-mini/app-samples

WebAssembly Micro Runtime (WAMR). Contribute to bytecodealliance/wasm-micro-runtime development by creating an account on GitHub.

view this post on Zulip Wenyong Huang (Jun 11 2024 at 06:51):

@Gilles ORAZI currently the default host managed heap size is set 0 when libc wasi is compiled, but the wasm file without libc wasi enabled may require host managed heap to run, could you try iwasm --heap-size=16384 test.wasm?

view this post on Zulip Gilles ORAZI (Jun 11 2024 at 06:53):

@Wenyong Huang That works perfectly now. Thank you so much !


Last updated: Nov 22 2024 at 17:03 UTC