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

JIT session error

Open matsbror opened this issue 9 months ago • 3 comments

Can someone here help me interpret this error message when running iwasm with llvm-jit:

JIT session error: Symbols not found: [ ceilf ]
JIT session error: Failed to materialize symbols: { (main.impl, { aot_func#242, aot_func#80, aot_func#87, aot_func#88, aot_func#254, aot_func#83, aot_func#242_wrapper, aot_func#92, aot_func#91, aot_func#250, aot_func#80_wrapper, aot_func#95, aot_func#84, aot_func#83_wrapper, aot_func#246 }) }
JIT session error: Failed to materialize symbols: { (main.impl, Segmentation fault (core dumped)

I have some other programs in which floor is the symbol not found.

How do I go about and debug this?

Also, it seems as the --interp flag does not completely disable the JIT as the same program starts executing correctly, but eventually fails with the same error. If I compile a version of iwasm with only the interpreter mode, it works fine.

matsbror avatar Nov 22 '23 09:11 matsbror

@matsbror I guess the ceilf/floor symbol not found issue is related to: https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/core/iwasm/compilation/aot_emit_numberic.c#L1052-L1065

And you can dump the LLVM IR generated to see more details:

wamrc --format=llvmir-unopt -o test.ll test.wasm
#or
wamrc --format=llvmir-opt -o test.ll test.wasm

wenyongh avatar Nov 23 '23 10:11 wenyongh

I should note that when I compile with wamrc I can execute the code corretly. The issue is with the JIT.

But for what it's worth, I have included the wasm and ll files here.

The issue only happens on the RISCV64 host, also. On x86_64 and ARM64 it works fine with the JIT.

basicmath.zip

matsbror avatar Nov 23 '23 10:11 matsbror

Got it, we didn't test llvm jit on RISCV64 yet. Maybe you can dump llvm module by enabling the code here: https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/core/iwasm/compilation/aot_compiler.c#L2662-L2665

wenyongh avatar Nov 23 '23 10:11 wenyongh