Hit MOZ_CRASH(unexpected v128 when setting global's value) at wasm/WasmJS.cpp:3166
Categories
(Core :: JavaScript: WebAssembly, defect, P3)
Tracking
()
People
(Reporter: decoder, Assigned: lth)
References
(Regression)
Details
(4 keywords, Whiteboard: [bugmon:update,bisected,confirmed])
Attachments
(2 files)
The following testcase crashes on mozilla-central revision 20200720-015515bcba1f (debug build, run with --fuzzing-safe --ion-offthread-compile=off):
function wasmEvalText(str, imports) {
let binary = wasmTextToBinary(str);
return new WebAssembly.Instance(new WebAssembly.Module(binary), imports);
}
wasmEvalText(`
(module
(global $g (export "g") v128 (v128.const f32x4 1 2 3 4))
)
`).exports;
Backtrace:
received signal SIGSEGV, Segmentation fault.
#0 0x000055555698c9e0 in js::WasmGlobalObject::setVal(JSContext*, JS::Handle<js::wasm::Val>) ()
#1 0x0000555556995c57 in CreateExportObject(JSContext*, JS::Handle<js::WasmInstanceObject*>, JS::GCVector<JSFunction*, 0ul, js::SystemAllocPolicy> const&, JS::GCVector<js::WasmTableObject*, 0ul, js::SystemAllocPolicy> const&, JS::Handle<js::WasmMemoryObject*>, JS::GCVector<js::wasm::Val, 0ul, js::SystemAllocPolicy> const&, JS::GCVector<js::WasmGlobalObject*, 0ul, js::SystemAllocPolicy> const&, mozilla::Vector<js::wasm::Export, 0ul, js::SystemAllocPolicy> const&) ()
#2 0x00005555569787eb in js::wasm::Module::instantiate(JSContext*, js::wasm::ImportValues&, JS::Handle<JSObject*>, JS::MutableHandle<js::WasmInstanceObject*>) const ()
#3 0x0000555556981762 in js::WasmInstanceObject::construct(JSContext*, unsigned int, JS::Value*) ()
#4 0x00005555559473f2 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) ()
#5 0x000055555595aa89 in CallJSNativeConstructor(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), JS::CallArgs const&) ()
[...]
#16 0x00005555557bbcea in main ()
rax 0x555557188526 93825021805862
rbx 0x639348b0c0 427672776896
rcx 0x5555583cb840 93825040955456
rdx 0x0 0
rsi 0x7ffff7105770 140737338431344
rdi 0x7ffff7104540 140737338426688
rbp 0x7fffffffb5d0 140737488336336
rsp 0x7fffffffb590 140737488336272
r8 0x7ffff7105770 140737338431344
r9 0x7ffff7f9bd40 140737353727296
r10 0x58 88
r11 0x7ffff6dac7a0 140737334921120
r12 0xffff800000000000 -140737488355328
r13 0xfff8800000000000 -2111062325329920
r14 0x7fffffffb718 140737488336664
r15 0x7ffff47fdc40 140737295408192
rip 0x55555698c9e0 <js::WasmGlobalObject::setVal(JSContext*, JS::Handle<js::wasm::Val>)+1120>
=> 0x55555698c9e0 <_ZN2js16WasmGlobalObject6setValEP9JSContextN2JS6HandleINS_4wasm3ValEEE+1120>: movl $0xc5e,0x0
0x55555698c9eb <_ZN2js16WasmGlobalObject6setValEP9JSContextN2JS6HandleINS_4wasm3ValEEE+1131>: callq 0x55555584c42e <abort>
Reporter | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Comment 2•4 years ago
|
||
Comment 3•4 years ago
|
||
This is a wasm simd isue: v128 globals should probably not be exposed to JS.
Updated•4 years ago
|
Updated•4 years ago
|
Comment 4•4 years ago
|
||
Set release status flags based on info from the regressing bug 1478632
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
(In reply to Benjamin Bouvier [:bbouvier] from comment #3)
This is a wasm simd isue: v128 globals should probably not be exposed to JS.
No, the test case should succeed. This is an unimplemented case, I think. There's a separate guard if JS attempts to read or write the value of a v128 global, but initializing a module-local wasm global should work.
Assignee | ||
Comment 6•4 years ago
|
||
Two bugs for the price of one test case!
-
when initializing an immutable exported v128 global, a code path in
WasmGlobalObject::setVal was taken that would MOZ_CRASH, but should
not. -
the baseline compiler did not have a code path for reading an
immutable v128 global, and would MOZ_CRASH.
No drama, just corner cases that were unimplemented and untested.
Comment 8•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Comment 9•4 years ago
|
||
Updated•4 years ago
|
Description
•