Skip to content

Conversation

@FromLiQg
Copy link
Contributor

@FromLiQg FromLiQg commented Aug 30, 2022

In some function, like form_and_translate_func, when the micro GEN_INSN or other insn or reg generation function failed, we ignore to detect error and return false.

FromLiQg and others added 30 commits August 12, 2022 17:45
Use pointer comparison instead of struct memory comparison.
When using call_indirect, type comparison is required.
I optimized the speed of type comparison,
and changed type structure memory comparison to pointer comparison.
whitch stores the number of type references
in wasm_interp_fast.c and wasm_interp_classic.c
when "globals" initialization fails,
the memory allocated is not released, resulting in memory leakage
after initialize a compilation context for fast jit failed.
The origin code doesn't go to fail when generate insn failed in function local_i32.
when calling jit_cc_new_reg_I64 in jit_compile_op_i32_load.
@FromLiQg FromLiQg changed the title Fix a bug: No error was detected and returned after the instruction generation failed. Fix bugs: No error was detected and returned after the instruction or register generation failed. Aug 30, 2022
@lum1n0us
Copy link
Contributor

Not sure this is a real bug. If a process can not allocate such small memory resource, like 10 bytes or 20 bytes, I am afraid the whole system can not respond to anything and there is nothing we can do unless rebooting.

IIUC, to catch all failed GEN_INSN, we need a lot of if branches. It will bring a negative influence on branch prediction but resolve a theoretical issue.

@FromLiQg
Copy link
Contributor Author

Not sure this is a real bug. If a process can not allocate such small memory resource, like 10 bytes or 20 bytes, I am afraid the whole system can not respond to anything and there is nothing we can do unless rebooting.

IIUC, to catch all failed GEN_INSN, we need a lot of if branches. It will bring a negative influence on branch prediction but resolve a theoretical issue.

@lum1n0us
I think what you said is right.
There are some many cases like this one, and It works normally in the release version (in the upper layer of the call stack, the error may be caught), so we need to discuss whether it is necessary to solve these bh_assert failed.

@wenyongh wenyongh merged commit 1877480 into bytecodealliance:main Sep 1, 2022
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
Add more checks for Fast JIT to fix the issues reported by instrument test:
- add check for the jit_value before pushing it into the stack
- add check at the end of form_and_translate_func
- add checks after each jit pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants