Closed Bug 1543589 Opened 5 years ago Closed 5 years ago

Crash [@ js::gc::FreeLists::allocate] or Assertion failure: !zone()->isAtomsZone(), at vm/JSContext-inl.h:348

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla68
Tracking Status
firefox-esr60 --- unaffected
firefox66 --- unaffected
firefox67 --- unaffected
firefox68 --- verified

People

(Reporter: decoder, Assigned: jonco)

References

(Regression)

Details

(5 keywords, Whiteboard: [jsbugmon:update])

Crash Data

Attachments

(1 file)

The following testcase crashes on mozilla-central revision a1eb490ba448 (build with --enable-posix-nspr-emulation --enable-valgrind --enable-gczeal --disable-tests --disable-profiling --disable-debug --enable-optimize, run with --fuzzing-safe --ion-offthread-compile=off):

for (var i = 0; import("nonexistent.js");)
  Symbol();

Backtrace:

received signal SIGSEGV, Segmentation fault.
#0  0x0000555555d90cda in js::gc::FreeLists::allocate (kind=js::gc::AllocKind::SYMBOL, this=<optimized out>) at js/src/gc/ArenaList-inl.h:223
#1  js::gc::GCRuntime::tryNewTenuredThing<JS::Symbol, (js::AllowGC)1> (kind=js::gc::AllocKind::SYMBOL, thingSize=16, cx=0x7ffff5f27000) at js/src/gc/Allocator.cpp:264
#2  js::Allocate<JS::Symbol, (js::AllowGC)1> (cx=cx@entry=0x7ffff5f27000) at js/src/gc/Allocator.cpp:249
#3  0x0000555555b38343 in JS::Symbol::newInternal (description=..., hash=3514457843, code=<incomplete type>, cx=0x7ffff5f27000) at js/src/vm/SymbolType.cpp:27
#4  JS::Symbol::new_ (cx=cx@entry=0x7ffff5f27000, code=code@entry=<incomplete type>, description=..., description@entry=...) at js/src/vm/SymbolType.cpp:44
#5  0x0000555555a9b2e1 in js::SymbolObject::construct (cx=0x7ffff5f27000, argc=<optimized out>, vp=0x7fffffffc8a8) at js/src/builtin/Symbol.cpp:118
#6  0x00003ba1754672e0 in ?? ()
#7  0x0000000000000000 in ?? ()
rax	0x0	0
rbx	0x0	0
rcx	0x0	0
rdx	0x0	0
rsi	0x7fffffffc680	140737488340608
rdi	0x12dad24d790a16d	84914341736915309
rbp	0x7ffff5f27000	140737319694336
rsp	0x7fffffffc7a0	140737488340896
r8	0x298	664
r9	0x53	83
r10	0x10	16
r11	0x246	582
r12	0xffffffff	4294967295
r13	0xd17a5ef3	3514457843
r14	0x7ffff4d70000	140737301118976
r15	0x3ba17545b010	65564643274768
rip	0x555555d90cda <js::Allocate<JS::Symbol, (js::AllowGC)1>(JSContext*)+26>
=> 0x555555d90cda <js::Allocate<JS::Symbol, (js::AllowGC)1>(JSContext*)+26>:	mov    0xb8(%rax),%rdx
   0x555555d90ce1 <js::Allocate<JS::Symbol, (js::AllowGC)1>(JSContext*)+33>:	movzwl (%rdx),%eax

Marking s-s because this is a GC-related assertion/crash.

Assignee: nobody → jcoppeard

The problem is that we can now we allow GC on Symbol allocation (bug 1540719), we can attempt to enter a different realm after we have entered the atoms zone. This happens when a minor GC sets the pretenuring flag for an ObjectGroup.

Blocks: 1540719
Keywords: sec-high

Currently we assert that we never leave the atoms zone. That's still true except for tthis one place where we do a minor GC and enter a realm so we can set the shouldPretenure flag on an ObjectGroup.

The patch allows AutoRealmUnchecked to skip this assertion and uses it there.

This was caused by letting Symbol allocation GC.

Whiteboard: [jsbugmon:update,bisect] → [jsbugmon:update]
JSBugMon: Bisection requested, result:
autoBisect shows this is probably related to the following changeset:

The first bad revision is:
changeset:   https://hg.mozilla.org/mozilla-central/rev/87ae5e3b6962
parent:      468492:1b7309612d60
user:        Jon Coppeard
date:        Mon Apr 01 18:36:41 2019 +0100
summary:     Bug 1540719 - Perform a last ditch GC if symbol allocation fails as we do for most other GC things r=sfink

This iteration took 443.192 seconds to run.
Group: javascript-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Flags: in-testsuite+
JSBugMon: This bug has been automatically verified fixed.
Status: RESOLVED → VERIFIED
Group: core-security-release
Has Regression Range: --- → yes
Keywords: bugmon
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: