Closed Bug 1599271 Opened 4 months ago Closed 4 months ago

Assertion failure: aDescriptor.Id() == mDescriptor.Id(), at /builds/worker/workspace/build/src/dom/serviceworkers/ServiceWorkerRegistrationInfo.cpp:97

Categories

(Core :: DOM: Service Workers, defect)

defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 1588357
Tracking Status
firefox72 --- affected

People

(Reporter: tsmith, Unassigned)

References

(Blocks 2 open bugs)

Details

(Keywords: assertion, crash, testcase)

Attachments

(1 file)

Attached file testcase.html

Reduced with m-c:
BuildID=20191125161209
SourceStamp=b4755981c1382cb88fed4e4fcff3ba73779b2080

Test case must be served via a web server to reproduce.

Assertion failure: aDescriptor.Id() == mDescriptor.Id(), at /builds/worker/workspace/build/src/dom/serviceworkers/ServiceWorkerRegistrationInfo.cpp:97

#0 mozilla::dom::ServiceWorkerRegistrationInfo::AddInstance(mozilla::dom::ServiceWorkerRegistrationListener*, mozilla::dom::ServiceWorkerRegistrationDescriptor const&) src/dom/serviceworkers/ServiceWorkerRegistrationInfo.cpp:95:3
#1 mozilla::dom::ServiceWorkerRegistrationProxy::InitOnMainThread() src/dom/serviceworkers/ServiceWorkerRegistrationProxy.cpp:88:9
#2 applyImpl<mozilla::dom::ServiceWorkerRegistrationProxy, void (mozilla::dom::ServiceWorkerRegistrationProxy::*)()> src/obj-firefox/dist/include/nsThreadUtils.h:1124:12
#3 apply<mozilla::dom::ServiceWorkerRegistrationProxy, void (mozilla::dom::ServiceWorkerRegistrationProxy::*)()> src/obj-firefox/dist/include/nsThreadUtils.h:1130:12
#4 mozilla::detail::RunnableMethodImpl<mozilla::dom::ServiceWorkerRegistrationProxy*, void (mozilla::dom::ServiceWorkerRegistrationProxy::*)(), true, (mozilla::RunnableKind)0>::Run() src/obj-firefox/dist/include/nsThreadUtils.h:1176:13
#5 nsThread::ProcessNextEvent(bool, bool*) src/xpcom/threads/nsThread.cpp:1250:14
#6 NS_ProcessNextEvent(nsIThread*, bool) src/xpcom/threads/nsThreadUtils.cpp:486:10
#7 mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) src/ipc/glue/MessagePump.cpp:88:21
#8 RunInternal src/ipc/chromium/src/base/message_loop.cc:315:10
#9 RunHandler src/ipc/chromium/src/base/message_loop.cc:308:3
#10 MessageLoop::Run() src/ipc/chromium/src/base/message_loop.cc:290:3
#11 nsBaseAppShell::Run() src/widget/nsBaseAppShell.cpp:137:27
#12 nsAppStartup::Run() src/toolkit/components/startup/nsAppStartup.cpp:276:30
#13 XREMain::XRE_mainRun() src/toolkit/xre/nsAppRunner.cpp:4609:22
#14 XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) src/toolkit/xre/nsAppRunner.cpp:4746:8
#15 XRE_main(int, char**, mozilla::BootstrapConfig const&) src/toolkit/xre/nsAppRunner.cpp:4827:21
#16 do_main src/browser/app/nsBrowserApp.cpp:218:22
Flags: in-testsuite?

A Pernosco session is available here: https://pernos.co/debug/nRUQyhBqJgG0owEzUPp3-g/index.html

It will expire in 7 days.

In Perry's absence I took a look at the Pernosco session. The findings so far I put into the notebook:

In https://searchfox.org/mozilla-central/source/dom/serviceworkers/ServiceWorkerRegistrationInfo.cpp#92:

  MOZ_DIAGNOSTIC_ASSERT(aDescriptor.Id() == mDescriptor.Id());

Observations:
- aDescriptor comes from ServiceWorkerRegistrationProxy.mDescriptor which comes from IPC parameter from RecvPServiceWorkerRegistrationConstructor
- mDescriptor comes from new ServiceWorkerRegistrationInfo with a new Id created appearently AFTER the ServiceWorkerRegistrationProxy (not sure about the order, though, as all variables are optimized out here)
Questions:
- Why do we pass an aDescriptor to addInstance if we expect it to be the same we already know? Are we checking for an invariance on IPC callee side? Which?
- How can I see the ServiceWorkerRegistrationInfo::this or mDescriptor address/id in order to make sure, where it comes from?

:asuth, can you have a short look? General question: If there is a violation of an invariance/contract on callee side, shouldn't we return some error through IPC rather than assert in our code?

Flags: needinfo?(bugmail)

This is bug 1588357. The test-case and pernosco trace are of course, invaluable, thank you. I'll link to them from the bug. There's some existing analysis at https://bugzilla.mozilla.org/show_bug.cgi?id=1588357#c2 that I'll augment.

Status: NEW → RESOLVED
Closed: 4 months ago
Flags: needinfo?(bugmail)
Resolution: --- → DUPLICATE
Duplicate of bug: 1588357
You need to log in before you can comment on or make changes to this bug.