-
Notifications
You must be signed in to change notification settings - Fork 623
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
Is it necessary to catch SIGSEGV when checking the HW bound? #1058
Comments
@gnh1201 The HW bound check is to use the hardware trap mechanism to implement the wasm memory access boundary check for AOT/JIT: runtime firstly registers a signal handler to catch the SIGSEGV signal, and when the wasm app accesses linear memory with address which is out of range (for example, linear memory size is 64KB, the address to read is larger than 64KB), the signal SIGSEGV will be triggered and caught by the signal handler, and in the signal handler, runtime handles the exception and continues to work. The main goal is to improve the performance, if not, runtime (AOT/JIT code) have to check whether the address is out of range manually, some extra instructions will be needed. So it is normal that SIGSEGV is thrown when HW bound check is enabled, you can see it in GDB, but it doesn't mean that runtime runs failed, instead, please let wasm app continue to run (in GDB, run If runtime cannot correctly handle the signal, normally runtime will print |
I finally solved this problem. Thanks for your advice. :) |
A system that triggers SIGSEGV when trying to check HW bound. I've mentioned this before. #802
Although this problem can be solved by adding the flag(
-DWAMR_DISABLE_HW_BOUND_CHECK=1
), I don't think I know in advance if the target system has this problem.Do these segmentation faults usually require a warning in advance or handling? I would like to get some advice.
The text was updated successfully, but these errors were encountered: