You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I'm trying to port WAMR to an embedded ARM platform; it's worked so far for simple WASM programs (e.g. an add_integers(i32, i32) -> i32 program) but as soon as I've introduced any host functions I get a memory permission error coming from code executing inside the AOT program. The host function isn't executed. By using the --xip flag with wamrc to get a consistent memory location of the AOT file, I've been able to get the address of the crashing code:
0x78001c8 (segfault address) - 0x7800004 (location AOT file is loaded into memory) = 0x1c4
Is there a recommended way to debug this? If this were a normal program I'd use llvm-symbolizer or addr2line to find the function name, but I wouldn't know what debug info file to pass in to those tools. Is my only option running the program in QEMU and setting a breakpoint at the location it's crashing?
Here's the code I'm using if that helps - it's a little messy right now. (I started with a simple adder and recently tested out adding a host function in the example/ directory. There's also a little bit of code left over from when I was using wasm3.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there, I'm trying to port WAMR to an embedded ARM platform; it's worked so far for simple WASM programs (e.g. an
add_integers(i32, i32) -> i32
program) but as soon as I've introduced any host functions I get a memory permission error coming from code executing inside the AOT program. The host function isn't executed. By using the --xip flag with wamrc to get a consistent memory location of the AOT file, I've been able to get the address of the crashing code:0x78001c8 (segfault address) - 0x7800004 (location AOT file is loaded into memory) = 0x1c4
Is there a recommended way to debug this? If this were a normal program I'd use llvm-symbolizer or addr2line to find the function name, but I wouldn't know what debug info file to pass in to those tools. Is my only option running the program in QEMU and setting a breakpoint at the location it's crashing?
Here's the code I'm using if that helps - it's a little messy right now. (I started with a simple adder and recently tested out adding a host function in the
example/
directory. There's also a little bit of code left over from when I was using wasm3.)https://github.com/vexide/hydrozoa/blob/f7433df41227e1a41080483d164e1aaaf9615f18/packages/runtime/src/bin/hydrozoa.rs
Beta Was this translation helpful? Give feedback.
All reactions