Closed Bug 1981249 Opened 1 year ago Closed 1 year ago

Assertion failure: majorState != State::Sweeping, at gc/BufferAllocator.cpp:1231

Categories

(Core :: JavaScript: GC, defect)

x86_64
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1978767
Tracking Status
firefox143 --- affected

People

(Reporter: decoder, Unassigned)

Details

(4 keywords, Whiteboard: [bugmon:update,bisected,confirmed])

Attachments

(2 files)

The following testcase crashes on mozilla-central revision 20250805-99e2525eb369 (debug build, run with --fuzzing-safe --ion-offthread-compile=off --fast-warmup --nursery-size=1 --enable-parallel-marking):

if (typeof x1 === 'undefined') x1 = function() {};
const Probe = (function() {
    const ProxyConstructor = Proxy;
    const getPrototypeOf = Object.getPrototypeOf;
    class RNG {
        reseed(seed) {}
    }
    function EmptyArray() {}
    function tryAccessProperty(prop, obj) {}
    function tryHasProperty(prop, obj) {}
    function tryGetOwnPropertyNames(obj) {}
    function wrapInTryCatch(f) {}
    function recordAction(action, id, target, key) {}
    function recordActionWithErrorHandling(action, id, target, key) {}
    function probe(id, value) {
        let originalPrototype, newPrototype;
        let handler = {
            get(target, key, receiver) {},
            set(target, key, value, receiver) {
                if (receiver === newPrototype)
		    return ReflectSet(target, key, value);
            },
            has(target, key) {},
        };
        originalPrototype = getPrototypeOf(value);
        newPrototype = new ProxyConstructor(originalPrototype, handler);
    }
    function foo1() {}
    function foo1() {}
    function foo1() {}
    return {
        probe: probe
    };
})();
for (let i11 = 0, i12 = 10;  (() => {})(); i12--) {}
for (let i38 = 0, i39 = 10; i39; (() => { i39--; })()) {}
for (let v63 = 0; v63 < 25; v63++) {
    const v73 = /jY(?:ab)?(w8a(?=b)c[Ea\nb\bc]+)/yu;
    function f101(a102, a103) {
        try { a103(); } catch (e) {}
        const v113 = {
            [v73](a106, a107) {
                const v110 = 9007199254740990n * -9007199254740990n;
                Probe.probe("v156", this);
                this.byteSize(v110);
            },
        };
        return v113;
    }
    try {
        JSON.stringify(f101, f101);
    } catch(e116) {}
}

Backtrace:

received signal SIGSEGV, Segmentation fault.
#0  0x000055555794bf0f in js::gc::BufferAllocator::getAllocSize(void*) ()
#1  0x00005555571609c1 in JS::ubi::Concrete<JS::BigInt>::size(unsigned long (*)(void const*)) const ()
#2  0x00005555575b774e in ByteSize(JSContext*, unsigned int, JS::Value*) ()
#3  0x00000e814703c2f7 in ?? ()
#4  0x0000000000000000 in ?? ()
rax	0x0	0
rbx	0x260d6e00dd50	41839121980752
rcx	0x4cf	1231
rdx	0x7ffff7804563	140737345766755
rsi	0x0	0
rdi	0x7ffff7805700	140737345771264
rbp	0x7ffffff8aac0	140737487874752
rsp	0x7ffffff8aa90	140737487874704
r8	0x0	0
r9	0x3	3
r10	0x0	0
r11	0x293	659
r12	0xaaaa00a800000001	-6149101619666485247
r13	0x7ffffff8b230	140737487876656
r14	0x7ffff42f8740	140737290143552
r15	0x7ffff4234ad0	140737289341648
rip	0x55555794bf0f <js::gc::BufferAllocator::getAllocSize(void*)+431>
=> 0x55555794bf0f <_ZN2js2gc15BufferAllocator12getAllocSizeEPv+431>:	mov    %rcx,(%rax)
   0x55555794bf12 <_ZN2js2gc15BufferAllocator12getAllocSizeEPv+434>:	call   0x555556f5ded0 <abort>

Could be an issue with the ByteSize native but leaving this locked until investigated just to be sure.

Attached file Testcase —

Testcase crashes using the initial build (mozilla-central 20250805042256-99e2525eb369) but not with tip (mozilla-central 20250805210924-2d8353914a6b.)

The bug appears to have been fixed in the following build range:

Start: f53bcb3c2e3fae0b95f52a06e685589110c5fe34 (20250805095812)
End: e7d4a89b6b6363b4916ba48678d575829d33613b (20250805092006)
Pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=f53bcb3c2e3fae0b95f52a06e685589110c5fe34&tochange=e7d4a89b6b6363b4916ba48678d575829d33613b

decoder, can you confirm that the above bisection range is responsible for fixing this issue?
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Flags: needinfo?(choller)
Keywords: bugmon
Whiteboard: [bugmon:update,bisect] → [bugmon:update,bisected,confirmed]

This is the same issue as bug 1978767, now fixed.

Status: NEW → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1978767
Flags: needinfo?(choller)
Resolution: --- → DUPLICATE
Group: javascript-core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: