Closed Bug 2029952 Opened 8 months ago Closed 8 months ago

Assertion failure: isEnabled(), at firefox/js/src/gc/Nursery.cpp:1905

Categories

(Core :: JavaScript: GC, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 2029515

People

(Reporter: baksmali404, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: reporter-external)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 Edg/137.0.0.0

Steps to reproduce:

version:master

$ git clone https://github.com/mozilla/firefox
$ cd firefox
$ git show
commit 187dc6baf299450446944dc90ba2239913004ba8 (HEAD -> main, origin/main, origin/HEAD)
Author: Nico Grunbaum <na-g@nostrum.com>
Date:   Mon Apr 6 18:54:32 2026 +0000

    Bug 2029275 - update libepoxy to new version d1f952c4565c389d82fd1657153e84e050f35b27;r=mjf
    
    Differential Revision: https://phabricator.services.mozilla.com/D292060

$ firefox/obj-fuzzbuild/dist/bin/js --version
[COV] no shared memory bitmap available, skipping
[COV] edge counters initialized. Shared memory: (null) with 506820 edges
JavaScript-C151.0a1

Reproduce

./dist/bin/js --fuzzing-safe pocfile.js

pocfile.js

for (let v0 = 0; v0 < 5; v0++) {
    for (let [i42, i43] = (() => {
            for (let i7 = 0, i8 = 10; i8; i8--) {
            }
            this.verifyprebarriers();
            for (let [i26, i27] = (() => {
                    for (let i18 = 0, i19 = 10; i19; i19--) {
                    }
                    return [0, 10];
                })();
                i27;
                i27--) {
                for (let i35 = 65535, i36 = 10; i36; i36--) {
                }
            }
            return [0, 10];
        })();
        (() => {
            for (let i46 = 0, i47 = 16; i47; i47--) {
            }
            return i43;
        })();
        i43--) {
    }
    const v58 = `
        for (let i61 = 0, i62 = 10;
            i62;
            (() => {
                const v67 = new Uint16Array(227);
                for (const v68 in v67) {
                    v68.slice(v0);
                }
                i62--;
            })()) {
        }
    `;
    eval(v58);
}
for (let i77 = 1542, i78 = 10; i78; i78--) {
}
gc();

Actual results:

asan report


/home/gandalf/fuzz/fuzzilli/Targets/Spidermonkey/out/crashes/program_20260407131425_96B768EF-E19B-46DC-800D-DB3B90459F97_deterministic.js
[4099881] Assertion failure: isEnabled(), at /home/gandalf/fuzz/fuzz_spm/firefox/js/src/gc/Nursery.cpp:1905
#01: ???[/home/gandalf/fuzz/fuzz_spm/firefox/obj-fuzzbuild/dist/bin/js +0x2548d4b]
#02: ???[/home/gandalf/fuzz/fuzz_spm/firefox/obj-fuzzbuild/dist/bin/js +0x253ce7d]
#03: ???[/home/gandalf/fuzz/fuzz_spm/firefox/obj-fuzzbuild/dist/bin/js +0x253cfaa]
#04: ???[/home/gandalf/fuzz/fuzz_spm/firefox/obj-fuzzbuild/dist/bin/js +0x3337780]
#05: ??? (???:???)
UndefinedBehaviorSanitizer:DEADLYSIGNAL
==4099881==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x5d406bf2bd63 bp 0x7ffc37deb0b0 sp 0x7ffc37deb090 T4099881)
==4099881==The signal is caused by a WRITE memory access.
==4099881==Hint: address points to the zero page.
/home/gandalf/fuzz/fuzz_spm/firefox/obj-fuzzbuild/dist/bin/llvm-symbolizer: error: '[anon:js-executable-memory]': No such file or directory
    #0 0x5d406bf2bd63 in MOZ_CrashSequence(void*, long) /home/gandalf/fuzz/fuzz_spm/firefox/obj-fuzzbuild/dist/include/mozilla/Assertions.h:235:3
    #1 0x5d406bf2bd63 in js::Nursery::requestMinorGC(JS::GCReason) /home/gandalf/fuzz/fuzz_spm/firefox/js/src/gc/Nursery.cpp:1905:3
    #2 0x5d406bf1fe7c in js::Nursery::addMallocedBufferBytes(unsigned long) /home/gandalf/fuzz/fuzz_spm/firefox/js/src/gc/Nursery-inl.h:35:5
    #3 0x5d406bf1fe7c in js::Nursery::registerMallocedBuffer(void*, unsigned long) /home/gandalf/fuzz/fuzz_spm/firefox/js/src/gc/Nursery.cpp:1785:3
    #4 0x5d406bf1ffa9 in js::Nursery::allocateZeroedBuffer(js::gc::Cell*, unsigned long, unsigned long) /home/gandalf/fuzz/fuzz_spm/firefox/js/src/gc/Nursery.cpp:842:8
    #5 0x5d406cd1a77f in (anonymous namespace)::FixedLengthTypedArrayObjectTemplate<unsigned short>::makeTypedArrayWithTemplate(JSContext*, js::TypedArrayObject*, int) /home/gandalf/fuzz/fuzz_spm/firefox/js/src/vm/TypedArrayObject.cpp:1070:27
    #6 0x5d406cd1a77f in js::NewTypedArrayWithTemplateAndLength(JSContext*, JS::Handle<JSObject*>, int) /home/gandalf/fuzz/fuzz_spm/firefox/js/src/vm/TypedArrayObject.cpp:1340:5
    #7 0x0df889f39d19  ([anon:js-executable-memory]+0x17d19)

==4099881==Register values:
rax = 0x0000000000000000  rbx = 0x0000000000000020  rcx = 0x0000000000000771  rdx = 0x000073e38b804563  
rdi = 0x000073e38b805700  rsi = 0x0000000000000000  rbp = 0x00007ffc37deb0b0  rsp = 0x00007ffc37deb090  
 r8 = 0x0000000000000000   r9 = 0x0000000000000003  r10 = 0x0000000000000002  r11 = 0x0000000000000293  
r12 = 0x000073e384a06520  r13 = 0x000073e388f0c000  r14 = 0x000073e38b32eca8  r15 = 0x0000000000000000  
UndefinedBehaviorSanitizer can not provide additional info.
SUMMARY: UndefinedBehaviorSanitizer: SEGV /home/gandalf/fuzz/fuzz_spm/firefox/obj-fuzzbuild/dist/include/mozilla/Assertions.h:235:3 in MOZ_CrashSequence(void*, long)
==4099881==ABORTING

Expected results:

SEGV or crash

Credit:

Gandalf4a of PKU-ICODE
Group: core-security → javascript-core-security
Blocks: GC.stability
Severity: -- → S3
Component: JavaScript Engine → JavaScript: GC
Priority: -- → P3
Status: UNCONFIRMED → RESOLVED
Closed: 8 months ago
Duplicate of bug: 2029515
Resolution: --- → DUPLICATE
Group: javascript-core-security
You need to log in before you can comment on or make changes to this bug.