exception-handling icon indicating copy to clipboard operation
exception-handling copied to clipboard

[legacy] Add setjmp bait

Open SoniEx2 opened this issue 1 year ago • 5 comments

sadly UBSAN doesn't appear to detect this (yet).

SoniEx2 avatar Sep 22 '24 00:09 SoniEx2

Shouldn't we have a corresponding test for the non-legacy instruction?

rossberg avatar Sep 22 '24 06:09 rossberg

yes, eventually

wasm2c only supports EHL at this point so having the test for EHv4 isn't that critical yet.

SoniEx2 avatar Sep 22 '24 11:09 SoniEx2

surprisingly, this test also appears to break wabt interpreter.

for context, the interpreter isn't even using setjmp.

SoniEx2 avatar Sep 23 '24 11:09 SoniEx2

Sorry I may lack some context, but what is this test about? They say setjmp and longjmp but here they are just normal functions. Does this test have any specific characteristics or does this just happen to be the case the wabt interpreter fails on? Apparenly this PR doesn't have any changes to the spec interpreter so that is fine, right?

aheejin avatar Sep 24 '24 01:09 aheejin

the test targets wasm2c specifically, where exceptions are implemented using setjmp/longjmp, but also happens to trigger a bug in wabt interpreter (which is mostly unrelated to wasm2c, despite also being part of wabt).

the wabt interpreter is unrelated to the spec interpreter, the spec interpreter is probably fine.

SoniEx2 avatar Sep 24 '24 01:09 SoniEx2