wasm-micro-runtime icon indicating copy to clipboard operation
wasm-micro-runtime copied to clipboard

in arm64, when call a wasm function, get Exception: unreachable

Open victortanjh opened this issue 3 years ago • 2 comments

In the native world, calling wasm_runtime_call_wasm to call a wasm function, sometimes, I will get a exception:unreachable.

How can I get the call stack in wasm, and how about the reason of this exception? Thank you.

victortanjh avatar Aug 23 '21 08:08 victortanjh

there is another exception: find block address failed. I find this exception is related to compilation option:-DWAMR_BUILD_INTERP=1. If I remove this compilation option, both exception:"unreachable" and "find block address failed" disappeared

victortanjh avatar Aug 24 '21 01:08 victortanjh

Hi, for the first question, you can build with WAMR_BUILD_CUSTOM_NAME_SECTION=1 and WAMR_BUILD_DUMP_CALL_STACK=1 (refer to build wamr.md), then the call stack will be dumped once exception occurs.

The "unreachable" exception is caused by the unreachable opcode, it is generated by the compiler to indicate that the code should never reach here, so it is hard to say what's the root cause from the runtime level, you may need to analyze the call stack to find out the abnormal code path.

For the second question, could you please provide the wasm file?

xujuntwt95329 avatar Aug 24 '21 08:08 xujuntwt95329