-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
test_error_on_parser_stack_overflow
from test_syntax
triggers triggers-out-of-bounds memory protection for a debug build under WASI
#111807
Comments
Looks like an out-of-bounds memory access:
|
test_error_on_parser_stack_overflow
from test_syntax
triggers stack overflow protections for a debug build under WASItest_error_on_parser_stack_overflow
from test_syntax
triggers triggers-out-of-bounds memory protection for a debug build under WASI
For some reason this problem screams @pablogsal to me. 😉 I wonder if there's a missing check on whether memory allocation succeeded or failed? |
This looks like the builder is stack overflowing on this platform. We do have a protection based on depth, but seems like the stack in the platform is not big enough. We can lower it flor WASI if we are able to detect it at compile time 🤔 |
If is not this, we need more debugging information here to understand how the out of memory access is happening, but my bet is certainly on a stack overflow. |
Ah, we already have it set to 4000 here: maybe we need to lower it even more for debug builds? |
Ah, another stack depth setting! I can play with the value to see where things trigger. Is there a "reasonable" minimum to decide whether it's worth differentiating between a debug build or not under WASI? |
The debug mode shouldn't affect parser depth or at least I don't see how that may be possible. It may affect stack size of every frame but the difference shouldn't be too different. With this I mean that it should not matter a lot so maybe is worth checking empirically what depth causes it to crash in both modes. |
It looks like the value needs to be 1325 or lower. I'll do a PR to set it to 1000 under WASI when in a debug build. |
Detected with WASI-SDK 20 and wasmtime 14.
Linked PRs
The text was updated successfully, but these errors were encountered: