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
WAMR throw OOB exception in LLVM-JIT mode while not in Fast-JIT mode #3343
Comments
Hi, thanks for reporting the issue. I did some experiment, it is caused by the meta data setting to the llvm fmul intrinsic, if I changed it from "fpexpect.strict" to "fpexpect.ignore", the result of llvm-jit/aot is the same as the result of fast-jit: diff --git a/core/iwasm/compilation/aot_llvm.c b/core/iwasm/compilation/aot_llvm.c
index 3af56e8b..ead8a203 100644
--- a/core/iwasm/compilation/aot_llvm.c
+++ b/core/iwasm/compilation/aot_llvm.c
@@ -2504,7 +2504,7 @@ aot_create_comp_context(const AOTCompData *comp_data, aot_comp_option_t option)
char *cpu = NULL, *features, buf[128];
char *triple_norm_new = NULL, *cpu_new = NULL;
char *err = NULL, *fp_round = "round.tonearest",
- *fp_exce = "fpexcept.strict";
+ *fp_exce = "fpexcept.ignore";
char triple_buf[128] = { 0 }, features_buf[128] = { 0 };
uint32 opt_level, size_level, i;
LLVMCodeModel code_model; It affects the result the second fmul in the second time calling of func 2:
|
Thank you for your reply! But I still confused that what makes the different JIT modes to generate different binary sequence which cause different multiplication results? In addition, could you please explain how to pinpoint the buggy instructions if it is convenient. Thanks again! |
The LLVM-JIT leverages LLVM framework while FAST-JIT's framework is self-implemented in WAMR, their pipelines and codegens are different, so the result may be different, sometimes we have to check the LLVM IR and related attributes for it. For Another possible method is to use wasm-interp of wabt to trace the execution result, e.g. And you can also dump the LLVM IR, e.g. |
Subject of the issue
I run the following wasm code in WAMR, and got
Exception: out of bounds memory access
in LLVM-JIT mode, but run successfully in Fast-JIT mode and AOT mode.Test case
Your environment
Expected & Actual behavior
Extra info
I found that after I replaced
f64.const nan
tof64.const 0
in function 2, the execution result of LLVM-JIT mode would be correct, so I wondered the bug may be related tonan
. However, if I only called function 2 once(i.e., deleted one ofcall 2
in function 3), the bug would also disappear, which indicated that the bug may be not only related tonan
.The text was updated successfully, but these errors were encountered: