Closed Bug 1745311 Opened 4 years ago Closed 3 years ago

Crash in [@ mozilla::dom::ContentChild::RecvConstructBrowser] at MOZ_DIAGNOSTIC_ASSERT(!IsShuttingDown())

Categories

(Core :: DOM: Content Processes, defect)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mccr8, Unassigned)

Details

(Keywords: crash)

Crash Data

Crash report: https://crash-stats.mozilla.org/report/index/93754988-a4ea-463b-8294-2dc390211208

MOZ_CRASH Reason: MOZ_DIAGNOSTIC_ASSERT(!IsShuttingDown())

Top 10 frames of crashing thread:

0 XUL mozilla::dom::ContentChild::RecvConstructBrowser dom/ipc/ContentChild.cpp:1766
1 XUL mozilla::dom::PContentChild::OnMessageReceived ipc/ipdl/PContentChild.cpp:8362
2 XUL mozilla::ipc::MessageChannel::DispatchMessage ipc/glue/MessageChannel.cpp:1968
3 XUL mozilla::ipc::MessageChannel::MessageTask::Run ipc/glue/MessageChannel.cpp:1855
4 XUL mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal xpcom/threads/TaskController.cpp:771
5 XUL mozilla::TaskController::ProcessPendingMTTask xpcom/threads/TaskController.cpp:391
6 XUL nsThread::ProcessNextEvent xpcom/threads/nsThread.cpp:1183
7 XUL nsThread::Dispatch xpcom/threads/nsThread.cpp:673
8 XUL mozilla::ChildProfilerController::ShutdownAndMaybeGrabShutdownProfileFirst tools/profiler/gecko/ChildProfilerController.cpp:98
9 XUL mozilla::ChildProfilerController::GrabShutdownProfileAndShutdown tools/profiler/gecko/ChildProfilerController.cpp:58

Very low volume crash, but it is a release assert so maybe there's something interesting here.

In all 3 crashes, I see us spinning a nested event loop in ChildProfilerController::ShutdownAndMaybeGrabShutdownProfileFirst() and then we get another message.

Severity: S2 → S3

That assertion has been introduced by D121687. Should we add an early return here instead?

Flags: needinfo?(bugs)

or rather, the assertion has been there for awhile, but it was made diagnostic.
But I think this can happen only if the parent process sends ConstructBrowser after sending Shutdown to the relevant child process.
And we shouldn't do that.
We could add some diagnostic assertions to parent process to hint why we construct browsers so late.

Flags: needinfo?(bugs)

(In reply to Olli Pettay [:smaug] from comment #2)

or rather, the assertion has been there for awhile, but it was made diagnostic.
But I think this can happen only if the parent process sends ConstructBrowser after sending Shutdown to the relevant child process.
And we shouldn't do that.
We could add some diagnostic assertions to parent process to hint why we construct browsers so late.

OK, but since then should we mitigate this in release builds?

This isn't in release builds, right?
It is just MOZ_DIAGNOSTIC_ASSERT

Yes but as you said we shouldn't do that at all, so I would have assumed returning early would prevent us from further weirdnesses? But yes, we should analyse the callers for sure.

oh, I see, my bad. I meant that the assertion is reasonable and we should fix the sender of the message.

Closing because no crashes reported for 12 weeks.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.