Closed Bug 718029 Opened 14 years ago Closed 14 years ago

don't skip JSContexts with outstanding requests during CC traversal

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12
Tracking Status
firefox-esr10 --- wontfix

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

(Whiteboard: [sg:dos null deref])

Attachments

(1 file)

The CC adds JSContexts as roots, but skips those that have outstanding requests, because they are necessarily alive. However, JSContexts can have JS objects as children, and it is not okay to skip traversal of a live edge from C++ to JS, because it can make the CC throw away (by NULLing out pointers) to things that are still reachable from JS. Not a huge deal, because the worst thing this should cause is some null-pointer derefs. Fix is just to remove the two lines. Giving this moderate because that's what bug 690970, which is the same kind of bug.
In some casual browsing, I never noticed this optimization doing anything, but I wasn't trying to do things with outstanding requests, whatever those are.
Note that requests will be going away soon with bug 650411.
Yeah, this is only going to be a problem if somehow the cycle collector fires off while you have some multi-threaded JS going on or something. It seems like this is barely a problem, and a bogus optimization besides.
Assignee: nobody → continuation
Attachment #588516 - Flags: review?(bugs)
Now that we don't allow JS from the main runtime on non-main threads I don't think this makes any sense.
So the case when there can be GetOutstandingRequests is when either CC is called explicitly via JS or when there is sync XHR or modal dialog/window open when CC runs.
Probably makes sense to just roll this patch into something improving skipping of JSContexts in the CC.
Comment on attachment 588516 [details] [diff] [review] remove the bogus optimization Hopefully the global object is usually black so that this doesn't affect to the graph size.
Attachment #588516 - Flags: review?(bugs) → review+
(In reply to Andrew McCreight [:mccr8] from comment #7) > Probably makes sense to just roll this patch into something improving > skipping of JSContexts in the CC. or not. ;) Yeah, I'll check to see if this does anything awful to the CC graph.
Well, actually, I already was doing some examination of the behavior of skipping JSContexts, and I never saw this optimization triggered, so it should be okay.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [sg:moderate] → [sg:dos null deref]
Group: core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: