Skip to content
Memory corruption Disclosed report Advanced

Assertion failure: slots == calculateDynamicSlots(), at vm/JSObject-inl.h:36

Gary Kwong Follow

Originally disclosed on Mozilla

  • Fixed in 9 days
  • Paid in 10 days
  • Disclosed after 9 days
Text
Created attachment 9527056
debug stack

'''js
var a = ["g"];
function f() {
  const x = {
    set g(z) {
      (function(v) {
        if (b !== undefined) v[a.shift()] = 0;
      })(this);
      this.m = 0;
      this.n = 0;
      for (var y in this);
    },
  };
  x.g = x;
}
new Int8Array(32).reduceRight(f);
var b = 1;
new Int8Array(32).reduceRight(f);
'''

'''
(gdb) bt
#0  0x00005555575aed72 in MOZ_CrashSequence (aAddress=0x0, aLine=36)
    at /home/msf2/shell-cache/js-dbg-64-linux-x86_64-1c2b83c1fdb8-596556/objdir-js/dist/include/mozilla/Assertions.h:237
#1  js::NativeObject::numDynamicSlots (this=0x13a944e029f0) at /home/msf2/trees/firefox/js/src/vm/JSObject-inl.h:36
#2  0x0000555557649ebf in js::NativeObject::growSlotsPure (cx=0x7ffff5e3c200, obj=0x13a944e029f0, newCapacity=6)
    at /home/msf2/trees/firefox/js/src/vm/NativeObject.cpp:435
#3  0x000033a09a50e607 in ?? ()
#4  0xfff8800000000000 in ?? ()
#5  0x000013a944e029f0 in ?? ()
/snip
'''

'''
90711c04449c-592521
90711c04449c324bb18eb22522010fe85a051143 is the first interesting commit
commit 90711c04449c324bb18eb22522010fe85a051143
Author: André Bargull
Date:   Tue Oct 21 07:05:41 2025 +0000

    Bug 1991402 - Part 7: Avoid duplicate shape guards for SetSize. r=jandem

    Switch `InlinableNativeIRGenerator::tryAttachSetSize()` to use
    `emitOptimisticClassGuard` in order to emit a shape guard instead of a class
    guard.

    MIR instructions after this change:
    '''
    6 GuardShape <object>
    7 GuardShape GuardShape6
    8 SetObjectSize GuardShape7
    '''

    Then add `MGuardShape::foldsTo` to optimise away the duplicate shape guards.

    Drive-by change:
    - Simplify `M{GuardShape,CallBindVar}::congruentTo` implementations.

    Differential Revision: https://phabricator.services.mozilla.com/D266599
'''

Run with `--fuzzing-safe --no-threads --fast-warmup`, compile with `AR=ar sh ~/trees/firefox/js/src/configure --enable-debug --enable-debug-symbols --with-ccache --enable-nspr-build --enable-ctypes --enable-gczeal --enable-rust-simd --disable-tests`, tested on gh rev 1c2b83c1fdb8ba523831bcdb63947f5f7a4cfa5e.

Andre, is bug 1991402 a likely regressor? (Note that a previous similar JIT assert bug 1875795 was marked sec-high)

The original report as published on Mozilla's Bugzilla, by Gary Kwong. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A high-severity memory corruption bug in JavaScript Engine: JIT. Mozilla made it public on 25 November 2025.

About Memory corruption

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by Gary Kwong

View all

42 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.