Closed Bug 442708 Opened 16 years ago Closed 16 years ago

JS_GC with GC_SET_SLOT_REQUEST doesn't loop until all threads are satisfied

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bent.mozilla, Assigned: bent.mozilla)

References

Details

(Keywords: fixed1.9.0.5)

Attachments

(2 files, 1 obsolete file)

Attached patch Brendan's patchSplinter Review
Brendan figured this one out. Basically one thread can call JS_GC with GC_SET_SLOT_REQUEST and, while running, another thread can do the same. The second thread will increment gclevel and exit early but will leave its setSlotRequest on the runtime. JS_GC didn't properly loop in that case and exited with the old ssr still set on the runtime.

The attached patch was written by Brendan and makes the only caller loop until it's slotrequest is serviced. It has fixed all the crashes I was seeing earlier with junk slotrequests left dangling on the runtime, r=me.
Attachment #327427 - Flags: review+
Assignee: general → brendan
Summary: GC_SET_SLOT_REQUEST should loop until all threads are satisfied → JS_GC with GC_SET_SLOT_REQUEST doesn't loop until all threads are satisfied
Version: unspecified → Trunk
Ben, could you please land this? I'm juggling too many patches atm. It's not even in my tree (or mq). Thanks,

/be
Assignee: brendan → bent.mozilla
Sure thing.
Status: NEW → ASSIGNED
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
Flags: in-litmus-
Comment on attachment 327427 [details] [diff] [review]
Brendan's patch

Requesting approval, especially if bug 439765 lands.
Attachment #327427 - Flags: approval1.9.0.3?
What kind of crashes does this fix? prior to workers (not in 3.0.x) how are you getting multi-thread JS?
Comment on attachment 327427 [details] [diff] [review]
Brendan's patch

I think this is reasonably safe, and from the comments in the other bug can be triggered by other things, and has baked quite a bit to date.
Attachment #327427 - Flags: approval1.9.0.4? → approval1.9.0.5+
Keywords: checkin-needed
Whiteboard: [needs JS peer for 1.9.0 checkin]
Attachment #348375 - Attachment is obsolete: true
Comment on attachment 348375 [details] [diff] [review]
Patch for 1.9.0 branch

Wrong patch :(
Checking in jsobj.c;
/cvsroot/mozilla/js/src/jsobj.c,v  <--  jsobj.c
new revision: 3.478; previous revision: 3.477
done
Whiteboard: [needs JS peer for 1.9.0 checkin]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: