Differential output between ion/baseline with WebAssembly exception handling
Categories
(Core :: JavaScript: WebAssembly, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr91 | --- | unaffected |
firefox95 | --- | unaffected |
firefox96 | --- | unaffected |
firefox97 | --- | fixed |
People
(Reporter: decoder, Assigned: rhunt)
References
(Regression)
Details
(Keywords: regression, testcase)
Attachments
(3 files)
The attached testcase shows differential behavior on mozilla-central revision 20211223-bd494168b95a (opt build):
Run with --no-threads --wasm-compiler=ion --wasm-exceptions
:
//RuntimeError: table index out of bounds
Run with --no-threads --wasm-compiler=baseline --wasm-exceptions
:
0,0,0
Found by our wasm-smith differential testing target. Marking s-s until investigated.
Reporter | ||
Comment 1•2 years ago
|
||
Reporter | ||
Comment 2•2 years ago
|
||
Comment 3•2 years ago
|
||
To Ryan for further triage.
Assignee | ||
Comment 4•2 years ago
|
||
We already mark runtime errors that are generated using the HandleTrap/signal
handler mechanism as 'traps'. We need to extend this to errors reported by
instance methods.
Assignee | ||
Comment 5•2 years ago
|
||
The root cause here is that instance calls are used to implement certain wasm instructions that may trap, but the instance call mechanism doesn't mark these WA.RuntimeError's as traps the way that the signal handler mechanism does. The differential execution comes down to the fact that the try notes for baseline are 1:1 with a whole try block, while Ion generates try notes for each wasm call inside of a try body (and not for instance calls, as they are assumed to only be able to throw non-catchable exceptions).
So we are generating exceptions that should not be catchable by wasm, but are not marked as such yet. And baseline can catch these exceptions because its try notes can cover instance calls, while Ion try notes will not because they are under the assumption that no catchable error should be thrown by instance calls.
This is not security sensitive because this is only trigger-able via pref'ed off code, and is only correctness based anyways.
Reporter | ||
Updated•2 years ago
|
Pushed by rhunt@eqrion.net: https://hg.mozilla.org/integration/autoland/rev/d6d4681c1280 wasm: Mark runtime errors generated in instance methods as traps. r=lth
Comment 7•2 years ago
|
||
bugherder |
Updated•2 years ago
|
Updated•2 years ago
|
Description
•