Closed
Bug 549743
Opened 15 years ago
Closed 15 years ago
Abort if cycle collected object is refcounted from non-main-thread
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: sicking, Assigned: sicking)
References
Details
(Whiteboard: [crashkill])
Attachments
(1 file)
3.00 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
To avoid race conditions that cause leaks and crashes sometimes, we should make sure that people that use cycle collected objects from threads other than the main thread know about it.
The easiest way to do that is to abort as soon as someone does it.
This needs to happen early in a release cycle so that developers have time to notice and fix their code.
Now is a good such time.
Attachment #429849 -
Flags: review?(dbaron)
Assignee | ||
Updated•15 years ago
|
Attachment #429849 -
Attachment is patch: true
Attachment #429849 -
Attachment mime type: application/octet-stream → text/plain
Assignee | ||
Comment 1•15 years ago
|
||
Oh, and I don't care strongly about the name here. Feel free to come up with better suggestions.
Assignee: nobody → jonas
Status: NEW → ASSIGNED
Comment on attachment 429849 [details] [diff] [review]
Patch to fix
How about "AbortIfOffMainThreadAndHaveFastMainThreadCheck"? It's a little more verbose, but it says what it does.
r=dbaron
Attachment #429849 -
Flags: review?(dbaron) → review+
Assignee | ||
Comment 3•15 years ago
|
||
Dbaron suggested "IfCheckFastAbortIfOffMainThread" on irc. I'll go with that.
Comment 4•15 years ago
|
||
As someone who's add-on is now frequently triggering this abort at startup in the trunk loads, I'm confused as to why that's happening. It appears to be triggered by a call to nsWindowMediator::GetMostRecentWindow which my add-on isn't making.
See http://forums.mozillazine.org/viewtopic.php?f=19&t=1790145 for details.
Am I to take it that threads can't be safely used until the initial "domwindowopened" notification fires?
Assignee | ||
Comment 5•15 years ago
|
||
Please file a new bug and attach a stack. And cc me.
(In reply to comment #5)
> Please file a new bug and attach a stack. And cc me.
A stack or a link to a crash report.
Comment 7•15 years ago
|
||
Never mind I tracked my problem down to a call elsewhere in my code. While looking at bug reports though I did see a few that occurred with no extensions installed though.
Comment 8•15 years ago
|
||
Were there literally no extensions listed? You should look at the uptime field, it's possible that it was a startup crash before we collected the extension data.
Comment 9•15 years ago
|
||
Up-time was 1 second so most likely that's what happened.
Comment 10•15 years ago
|
||
Sicking landed this a few weeks ago:
http://hg.mozilla.org/mozilla-central/rev/0d5553264cbf.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•