Assertion failure: !IsNeckoChild(), at netwerk/base/RequestContextService.cpp:236 when shutdown

RESOLVED FIXED in Firefox 57

Status

()

defect
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: kershaw, Assigned: kershaw)

Tracking

Trunk
mozilla57
Points:
---

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

Sometimes I see this in content process when I shut down my local build firefox.

I think the reason is that gNeckoChild could be null when the content process is going to be terminated.

Stack:
#01: mozilla::net::RequestContext::DOMContentLoaded()[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1b3f78]
#02: mozilla::net::RequestContextService::Observe(nsISupports*, char const*, char16_t const*)[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1b618c]
#03: non-virtual thunk to mozilla::net::RequestContextService::Observe(nsISupports*, char const*, char16_t const*)[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1b631d]
#04: nsObserverList::NotifyObservers(nsISupports*, char const*, char16_t const*)[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0xb55ff]
#05: nsObserverService::NotifyObservers(nsISupports*, char const*, char16_t const*)[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0xb6e02]
#06: nsDocument::DispatchContentLoadedEvents()[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x138d40d]
#07: mozilla::detail::RunnableMethodImpl<nsDocument*, void (nsDocument::*)(), true, (mozilla::RunnableKind)0>::Run()[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x13d17b7]
#08: mozilla::SchedulerGroup::Runnable::Run()[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x118945]
#09: nsThread::ProcessNextEvent(bool, bool*)[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x12d772]
#10: NS_ProcessNextEvent(nsIThread*, bool)[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x13005f]
#11: mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*)[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x6a4d03]
#12: MessageLoop::Run()[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x65a3b5]
#13: nsBaseAppShell::Run()[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x2b3d939]
#14: nsAppShell::Run()[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x2ba3f37]
#15: XRE_RunAppShell()[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x43c81a3]
#16: mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*)[/Users/changkershaw/work/firefox_git/obj-x86_64-apple-darwin16.7.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x6a56c7]
Please take a look.
Thanks.
Attachment #8906476 - Flags: review?(hurley)

Comment 2

2 years ago
Comment on attachment 8906476 [details] [diff] [review]
Make sure gNeckoChild is not null before sending IPC message

Review of attachment 8906476 [details] [diff] [review]:
-----------------------------------------------------------------

The commit message doesn't accurately reflect what the patch does (the code in question already ensures gNeckoChild is not null before sending an IPC message). What you're actually doing here is making sure we always take the necko child path when we're on the child, whether we can send IPC messages or not. This ensures that, later in the method, when we call ScheduleUnblock, the assertion there (!IsNeckoChild()) holds true.

So, the code is right, but the commit message (and, based on your comment when attaching the patch, your understanding of the issue) is woefully wrong. Please fix that up.
Attachment #8906476 - Flags: review?(hurley) → review-
Only commit message is changed.

Please review it. Thanks.
Attachment #8906476 - Attachment is obsolete: true
Attachment #8906851 - Flags: review?(hurley)

Updated

2 years ago
Attachment #8906851 - Flags: review?(hurley) → review+

Comment 5

2 years ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e58e11f74cc0
Handle the case when gNeckoChild is null properly in RequestContext::DOMContentLoaded. r=hurley
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/e58e11f74cc0
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
(In reply to Honza Bambas (:mayhemer) from comment #7)
> Kershaw, I think the same mistake is at
> https://dxr.mozilla.org/mozilla-central/rev/
> ffe6cc09ccf38cca6f0e727837bbc6cb722d1e71/netwerk/base/RequestContextService.
> cpp#111

Yes. However, I think it can't bite us for now.

I'll file a bug to fix this for safe.
You need to log in before you can comment on or make changes to this bug.