Closed Bug 1167860 Opened 11 years ago Closed 11 years ago

crashes checking MOZ_ASSERT(obj->compartment() == obj2->compartment()) in GCMarker::processMarkStackTop

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox38 --- unaffected
firefox38.0.5 --- unaffected
firefox39 --- unaffected
firefox40 --- unaffected
firefox41 --- fixed
firefox-esr31 --- unaffected
firefox-esr38 --- unaffected
b2g-v2.0 --- unaffected
b2g-v2.0M --- unaffected
b2g-v2.1 --- unaffected
b2g-v2.1S --- unaffected
b2g-v2.2 --- unaffected
b2g-master --- fixed

People

(Reporter: dbaron, Assigned: bhackett1024)

References

Details

(Keywords: crash, csectype-uaf, sec-high, Whiteboard: [post-critsmash-triage])

Attachments

(2 files)

I run debug builds as my primary browser. In the past three days, running a build based on https://hg.mozilla.org/mozilla-central/rev/8d8df22fe72d (plus my patch queue as of Wed May 20 18:54:24 2015 -0400), I've crashed three times in GCMarker::processMarkStackTop. This crash has been during the checking of this assertion on line 1184: MOZ_ASSERT(obj->compartment() == obj2->compartment()); with the following problem: (gdb) p obj->group_.value->compartment_ $5 = (JSCompartment *) 0x4f1ddf80 (gdb) p obj2->group_.value->compartment_ Cannot access memory at address 0x2b2b2b2b2b2b2b3b (gdb) p obj2->group_.value $6 = (js::ObjectGroup *) 0x2b2b2b2b2b2b2b2b
This is a child process crash.
Group: core-security
Keywords: csectype-uaf
Off-hand, I'd have guessed this was something like bug 1166277, but it looks like the revision you are using has that patch so that can't be it.
just a note that bughunter also found Bug 1168375 which might be the same/related
Keywords: sec-high
Bug 1166762 also looks similar.
See Also: → 1168375, 1166762
If obj2 was moved, that implicates a missing post-barrier on whatever wrote that slot. The existence of HeapSlot should keep C++ from missing a barrier -- maybe a new MCallOptimize path in ion?
I was able to repro this quite quickly by opening the link above, then doing |window.open('about:blank')| in the console, then in the child window's console doing |window.setInterval(()=>{window.opener.location.reload()}, 5000)|. Unfortunately, this doesn't immediately get me closer to a solution because the lack of barrier happened at least 3 writes ago, before the prior minor GC, possibly earlier. I'll need to get rr working again to get further. Been meaning to give that another go anyway.
I've got it captured in rr now; might as well take the bug.
Assignee: nobody → terrence
Status: NEW → ASSIGNED
As expected, the write missing a store-buffer entry is in the middle of jit-code. As it only takes a couple of minutes to repro, I think the best way to proceed is going to be to bisect.
Component: JavaScript: GC → JavaScript Engine: JIT
Bisection results: Last Good: f8d7bb0b4f00 First Bad: 322487136b28 changeset: 244263:322487136b28 user: Brian Hackett <bhackett1024@gmail.com> date: Sun May 17 20:12:14 2015 -0600 summary: Bug 1162199 - Use unboxed objects by default, r=jandem. Brian, can you take it from here?
Assignee: terrence → bhackett1024
Flags: needinfo?(bhackett1024)
I can't reproduce this.
Attached patch patch — — Splinter Review
Err, immediately after posting that this started to reproduce. There actually was a store buffer entry being added for this write, but while the write is to an unboxed expando the store buffer entry is for the original unboxed object. WholeCellEdges::trace handles this fine, but if the unboxed object is converted to a native before the next minor GC then the expando is not traced by the store buffer.
Flags: needinfo?(bhackett1024)
Attachment #8612485 - Flags: review?(terrence)
Comment on attachment 8612485 [details] [diff] [review] patch Review of attachment 8612485 [details] [diff] [review]: ----------------------------------------------------------------- Nice!
Attachment #8612485 - Flags: review?(terrence) → review+
Blocks: 1162199
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Whiteboard: [post-critsmash-triage]
Group: core-security → core-security-release
Group: core-security-release
Blocks: 1168375
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: