Report failures due to implementation limits to fuzzers for differential testing
Categories
(Core :: JavaScript: WebAssembly, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox136 | --- | fixed |
People
(Reporter: tom.online1337, Assigned: rhunt)
References
Details
Attachments
(2 files)
Steps to reproduce:
I encountered inconsistent behavior when running a WebAssembly module using different compiler settings in SpiderMonkey. The same WebAssembly module produces different runtime errors depending on whether the baseline
or ion
compiler is enabled.
SpiderMonkey Engine(Git 4f44c14a73993e4490646bde47eacbf2b9d267aa) (Linux, x64)
Actual results:
-
Run the module with the
baseline
compiler:./js --no-threads --fuzzing-safe --setpref=wasm_memory_control=true --setpref=wasm_js_string_builtins=true --wasm-compiler=baseline ./poc.js
Output:
./poc.js line 2 > WebAssembly.Module:600:1 RuntimeError: too many array elements Stack: @./poc.js line 2 > WebAssembly.Module:wasm-function[0]:0x258 @./poc.js:5:1
-
Run the module with the
ion
compiler:./js --no-threads --fuzzing-safe --setpref=wasm_memory_control=true --setpref=wasm_js_string_builtins=true --wasm-compiler=ion ./poc.js
Output:
./poc.js line 2 > WebAssembly.Module:622:1 RuntimeError: unaligned memory access Stack: @./poc.js line 2 > WebAssembly.Module:wasm-function[0]:0x26e @./poc.js:5:1
Expected results:
The WebAssembly module should produce consistent runtime errors regardless of the compiler settings used. The discrepancy in errors (too many array elements
vs unaligned memory access
) suggests a potential bug in how the module is being interpreted or compiled.
Assignee | ||
Comment 1•3 months ago
|
||
Can you confirm this is not a duplicate of bug 1932062? See my comment there. Ion is able to eliminate array allocations that baseline is not able to. Those array allocations may fail, leading to differential execution.
Talking about this internally, we have other cases like this where we report this for fuzzers to look for [1]. We could start doing this for wasm arrays if that would help you filter out these examples.
Assignee | ||
Updated•3 months ago
|
Reporter | ||
Comment 2•2 months ago
|
||
Thank you for your detailed response and explanation! The clarification you provided makes a lot of sense, and the behavior difference between Ion and Baseline is indeed reasonable and aligns with the spec as you mentioned.
I also appreciate the suggestion regarding fuzzers and the effort to handle similar cases internally. It sounds like a solid approach to proactively identify and filter out such scenarios in the future.
Assignee | ||
Updated•2 months ago
|
Assignee | ||
Comment 4•1 month ago
|
||
Updated•1 month ago
|
Comment 6•1 month ago
|
||
bugherder |
Description
•