Investigate why chrome JS runs during thread manager shutdown
Categories
(Core :: XPCOM, defect)
Tracking
()
People
(Reporter: mccr8, Unassigned)
References
Details
In the last few releases, we've seen a few issues due to running chrome JS after we clear the CleanOnShutdown pointers (bug 1663315, bug 1656973). I've fixed a few issues causing the crashes, but the things I fixed were very old, so something must have changed in shutdown that caused us to run chrome JS later than we used to.
Here's an example crash: bp-415372bb-6106-4bef-93d5-0f0db0200909
We're crashing on this, which is right after the call to mozilla::KillClearOnShutdown(ShutdownPhase::ShutdownFinal)
:
nsThreadManager::get().Shutdown()
I think it is also interesting where in threadmanager shutdown we are crashing.
Specifically, it is on the line thread->Shutdown();
. I think this is interesting because we do a call to NS_ProcessPendingEvents(mMainThread);
earlier in the function, which I think means that the event that is running chrome JS was not pending at the start of the function, so something during thread shutdown caused it.
Anyways, I don't know much about thread shutdown, but I figured I should file a bug given that we keep seeing crashes.
![]() |
||
Comment 2•4 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #1)
Nathan, any ideas?
I'm not quite sure what this question is asking -- "any ideas" as in "any ideas which threads are running chrome JS after shutdown"? I don't have solid ideas, but I'd guess workers of some kind? Or timers that are expiring and dispatch events to the main thread to run their chrome JS callbacks (sessionstore? telemetry?)?
Reporter | ||
Comment 3•4 years ago
|
||
I guess I was wondering:
- What might this chrome JS be?
- Could we mitigate this somehow?
Maybe mozilla::KillClearOnShutdown(ShutdownPhase::ShutdownFinal) could be moved after the thread shutdown but odds are that will cause some other issue.
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Comment 4•3 years ago
|
||
Somebody can file a new issue if they want to look into this. I just had kind of a vague idea and never followed up with it.
Description
•