Crash in mozilla::ipc::MessageChannel::CxxStackFrame::CxxStackFrame | mozilla::ipc::MessageChannel::Send | mozilla::dom::PRemoteWorkerParent::SendExecOp

RESOLVED FIXED in Firefox 67

Status

()

defect
--
critical
RESOLVED FIXED
7 months ago
3 months ago

People

(Reporter: gsvelto, Assigned: baku)

Tracking

(Blocks 1 bug, {crash, regression})

unspecified
mozilla68
Points:
---
Dependency tree / graph
Bug Flags:
qe-verify -

Firefox Tracking Flags

(firefox-esr60 unaffected, firefox64 unaffected, firefox65 wontfix, firefox66 wontfix, firefox67 fixed, firefox68 fixed)

Details

(crash signature)

Attachments

(1 attachment)

This bug was filed from the Socorro interface and is
report bp-e919cc76-1491-4467-97c4-a008f0181216.
=============================================================

Top 10 frames of crashing thread:

0 libxul.so mozilla::ipc::MessageChannel::CxxStackFrame::CxxStackFrame ipc/glue/MessageChannel.h:538
1 libxul.so mozilla::ipc::MessageChannel::Send ipc/glue/MessageChannel.cpp:979
2 libxul.so mozilla::dom::PRemoteWorkerParent::SendExecOp ipc/ipdl/PRemoteWorkerParent.cpp:90
3 libxul.so mozilla::dom::RemoteWorkerController::RemoveWindowID dom/workers/remoteworkers/RemoteWorkerController.cpp:201
4 libxul.so mozilla::dom::SharedWorkerManager::RemoveActor dom/workers/sharedworkers/SharedWorkerManager.cpp:104
5 libxul.so mozilla::dom::SharedWorkerParent::ActorDestroy dom/workers/sharedworkers/SharedWorkerParent.cpp:35
6 libxul.so mozilla::ipc::PBackgroundParent::DestroySubtree ipc/ipdl/PBackgroundParent.cpp:4060
7 libxul.so mozilla::ipc::PBackgroundParent::OnChannelError ipc/ipdl/PBackgroundParent.cpp:3730
8 libxul.so mozilla::detail::RunnableMethodImpl<mozilla::ipc::MessageChannel*, void  xpcom/threads/nsThreadUtils.h:1106
9 libxul.so nsThread::ProcessNextEvent xpcom/threads/nsThread.cpp:1157

=============================================================

We're hitting this assertion:

https://hg.mozilla.org/mozilla-central/annotate/5b0b8a39d09e49efe283b94deba6853e223edad3/ipc/glue/MessageChannel.h#l538

MOZ_RELEASE_ASSERT(mWorkerThread == GetCurrentVirtualThread()) (not on worker thread!)
This is weird and might actually be an IPC bug (vs. an error in how IPC is used by, in this case, workers): PRemoteWorker and PSharedWorker are both managed by PBackground, and all the PBackgroundParent instances should be bound to the same thread.  So even if the PBackground being torn down isn't for the same content process thread as the PRemoteWorker at the end of the stack, that assertion wouldn't fire.  Unless I'm missing something.

Bug 1438945 might be related; it's about shared workers, and the first build with its patches is 20181120100045, which is also the first build where this crash is reported.
See Also: → 1438945
See Also: → 1515183
Blocks: 1438945
Component: IPC → DOM: Workers
Keywords: regression
Hardware: Unspecified → All
Priority: -- → P3

Just hit this when restarting nightly with updates and lost all of my open tabs that were not pinned

David, do you have a crash report?

(I'm going to move this to IPC based on comment 2.)

Component: DOM: Workers → IPC
Flags: needinfo?(dburns)
Priority: P3 → --

Baku, is this something you can look into as this is related to the shared workers?

Flags: needinfo?(amarchesini)
Assignee: nobody → amarchesini
Flags: needinfo?(amarchesini)
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5954214372b7
RemoteWorkerController should be notified when the RemoteWorkerParent actor is dismissed, r=asuth
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68

Baku, do you want to uplift to beta?

Flags: needinfo?(amarchesini)

Comment on attachment 9057324 [details]
Bug 1514733 - RemoteWorkerController should be notified when the RemoteWorkerParent actor is dismissed, r?asuth

Beta/Release Uplift Approval Request

  • Feature/Bug causing the regression: SharedWorkers in remote processes
  • User impact if declined: A crash can occur during the shutdown
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The problem is that, when the parent actor is dismissed, we don't inform the manager.
    The fix is trivial, but we cannot write tests because this is a race condition and it's not easy to reproduce it consistently.
  • String changes made/needed:
Flags: needinfo?(amarchesini)
Attachment #9057324 - Flags: approval-mozilla-beta?

Comment on attachment 9057324 [details]
Bug 1514733 - RemoteWorkerController should be notified when the RemoteWorkerParent actor is dismissed, r?asuth

Low risk fix for a medium crash on beta, uplift approved, thanks.

Attachment #9057324 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.