Closed Bug 1970563 Opened 1 year ago Closed 1 year ago

[WASM] JIT Optimization Triggered Assertion failure: !values_.has(def) (Discarding a definition still in the set)

Categories

(Core :: JavaScript: WebAssembly, defect)

Firefox 141
defect

Tracking

()

RESOLVED DUPLICATE of bug 1970545

People

(Reporter: xiangwei1895, Unassigned)

References

Details

(Keywords: reporter-external)

Attachments

(3 files)

Attached file asan_log.txt —

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36

Steps to reproduce:

My env:
Ubuntu 22.04 TLS
8b52ebe3cddf0e63bb42e8b51618bc3ab8dcb12d

Build args:
../configure --disable-jemalloc --enable-fuzzing --enable-gczeal --enable-debug --enable-optimize --disable-shared-js --enable-address-sanitizer

Execution:
./dist/bin/js poc.js

Actual results:

Assertion failure: !values_.has(def) (Discarding a definition still in the set), at /data/workspace/gecko-dev/js/src/jit/ValueNumbering.cpp:326

backstrace:

(gdb) bt
#0  0x0000555558929cff in MOZ_CrashSequence (aAddress=0x0, aLine=326) at /data/workspace/gecko-dev/js/src/wasmfuzz/dist/include/mozilla/Assertions.h:248
bt
#1  js::jit::ValueNumberer::discardDef (this=this@entry=0x7ffff6dd3da0, def=def@entry=0x7ffff00232a8, allowEffectful=js::jit::ValueNumberer::AllowEffectful::No)
    at /data/workspace/gecko-dev/js/src/jit/ValueNumbering.cpp:326
#2  0x00005555589294a4 in js::jit::ValueNumberer::processDeadDefs (this=0x7ffff6dd3da0) at /data/workspace/gecko-dev/js/src/jit/ValueNumbering.cpp:386
#3  js::jit::ValueNumberer::discardDefsRecursively (this=this@entry=0x7ffff6dd3da0, def=def@entry=0x7ffff00233c8, allowEffectful=<optimized out>)
    at /data/workspace/gecko-dev/js/src/jit/ValueNumbering.cpp:257
#4  0x000055555892ccef in js::jit::ValueNumberer::visitDefinition (this=0x7ffff6dd3da0, def=0x7ffff00233c8) at /data/workspace/gecko-dev/js/src/jit/ValueNumbering.cpp:809
#5  0x000055555892f315 in js::jit::ValueNumberer::visitBlock (this=0x7ffff6dd3da0, block=block@entry=0x7ffff0022cd0) at /data/workspace/gecko-dev/js/src/jit/ValueNumbering.cpp:1027
#6  0x000055555892f791 in js::jit::ValueNumberer::visitDominatorTree (this=this@entry=0x7ffff6dd3da0, dominatorRoot=dominatorRoot@entry=0x7ffff0022cd0)
    at /data/workspace/gecko-dev/js/src/jit/ValueNumbering.cpp:1081
#7  0x000055555892fe8b in js::jit::ValueNumberer::visitGraph (this=this@entry=0x7ffff6dd3da0) at /data/workspace/gecko-dev/js/src/jit/ValueNumbering.cpp:1120
#8  0x0000555558931a23 in js::jit::ValueNumberer::run (this=0x7ffff6dd3da0, updateAliasAnalysis=<optimized out>) at /data/workspace/gecko-dev/js/src/jit/ValueNumbering.cpp:1288
#9  0x0000555558f0f194 in js::jit::OptimizeMIR (mir=mir@entry=0x7ffff6dd56f8) at /data/workspace/gecko-dev/js/src/jit/Ion.cpp:1201
#10 0x00005555593f9eb4 in js::wasm::IonCompileFunctions (codeMeta=..., codeTailMeta=0x55555a3975c0, compilerEnv=..., lifo=..., inputs=..., code=code@entry=0x7ffff001f628, error=0x7ffff6dd8b00)
    at /data/workspace/gecko-dev/js/src/wasm/WasmIonCompile.cpp:10780
#11 0x00005555593afd9a in ExecuteCompileTask (task=0x7ffff001f260, error=0x7ffff6dd8b00) at /data/workspace/gecko-dev/js/src/wasm/WasmGenerator.cpp:613
#12 0x00005555593b2b9a in js::wasm::ModuleGenerator::locallyCompileCurrentTask (this=0x7ffff6dd6ce8) at /data/workspace/gecko-dev/js/src/wasm/WasmGenerator.cpp:712
#13 js::wasm::ModuleGenerator::finishFuncDefs (this=0x7ffff6dd6ce8) at /data/workspace/gecko-dev/js/src/wasm/WasmGenerator.cpp:849
#14 0x000055555935bb6a in js::wasm::CompilePartialTier2 (code=..., funcIndex=2, error=error@entry=0x7ffff6dd8b00, warnings=warnings@entry=0x7ffff6dd8b10, cancelled=cancelled@entry=0x55555a5200c4)
    at /data/workspace/gecko-dev/js/src/wasm/WasmCompile.cpp:1103
#15 0x0000555559375840 in js::wasm::Module::PartialTier2CompileTaskImpl::runHelperThreadTask (this=0x55555a5200b0, locked=...) at /data/workspace/gecko-dev/js/src/wasm/WasmCode.cpp:648
#16 0x000055555758f1ea in js::GlobalHelperThreadState::runTaskLocked (this=0x55555a39acb0, task=0x55555a5200b0, locked=...) at /data/workspace/gecko-dev/js/src/vm/HelperThreads.cpp:668
#17 0x000055555758f041 in js::GlobalHelperThreadState::runOneTask (this=0x7ffff7ae0a60 <_IO_stdfile_2_lock>, task=0x0, lock=...) at /data/workspace/gecko-dev/js/src/vm/HelperThreads.cpp:624
#18 0x00005555575e071c in js::HelperThread::threadLoop (this=this@entry=0x55555a39c480, pool=pool@entry=0x55555a39c3e0) at /data/workspace/gecko-dev/js/src/vm/InternalThreadPool.cpp:324
#19 0x00005555575e020d in js::HelperThread::ThreadMain (pool=0x55555a39c3e0, helper=0x55555a39c480) at /data/workspace/gecko-dev/js/src/vm/InternalThreadPool.cpp:251
#20 0x00005555575fff06 in js::detail::ThreadTrampoline<void (&)(js::InternalThreadPool*, js::HelperThread*), js::InternalThreadPool*&, js::HelperThread*>::callMain<0ul, 1ul> (this=0x55555a39c4f0)
    at /data/workspace/gecko-dev/js/src/threading/Thread.h:228
#21 js::detail::ThreadTrampoline<void (&)(js::InternalThreadPool*, js::HelperThread*), js::InternalThreadPool*&, js::HelperThread*>::Start (aPack=0x55555a39c4f0)
    at /data/workspace/gecko-dev/js/src/threading/Thread.h:217
#22 0x00007ffff7958ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
--Type <RET> for more, q to quit, c to continue without paging--bt

Expected results:

exit normally

Attached file poc.js —
Attached file readable_poc.js —
Group: core-security → javascript-core-security

It isn't required, but if you use the Client Bounty Form it'll set things like the sec-bounty? flag automatically.

See Also: → 1970545
Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1970545
Resolution: --- → DUPLICATE
Duplicate of this bug: 1971066

This was filed nearly simultaneous with bug 1970545, well within our duplicate window, so the bounty will be split between the two

Flags: sec-bounty+
Group: javascript-core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: