Open Bug 2055827 Opened 6 days ago Updated 3 days ago

Debug-only "ASSERTION: Couldn't create child process." when browser is created past shutdown

Categories

(Core :: DOM: Content Processes, defect)

defect

Tracking

()

ASSIGNED
Tracking Status
firefox-esr115 --- wontfix
firefox-esr140 --- wontfix
firefox-esr153 --- wontfix
firefox152 --- wontfix
firefox153 --- wontfix
firefox154 --- fix-optional

People

(Reporter: robwu, Assigned: robwu)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [addons-jira])

Attachments

(1 file)

In bug 2051934 I added unit tests to confirm behavioral correctness when the application shuts down while the the background page of an extension is being initialized. One of the unit tests triggers quit right before a <browser> is created, which triggers a failure on debug builds due to NS_ERROR("Couldn't create child process."); at https://searchfox.org/firefox-main/rev/446c6e609dbd7c355c2fb27209dfe4833211991f/dom/base/nsFrameLoader.cpp#1063

It looks like the issue was introduced by bug 1811195 (initially in nsFrameLoader::TryRemoteBrowser), later moved by bug 1871625 (ContentParent::CreateBrowser, link to current source code with shutdown check). There are some intermittent failures with the same signature, some triggered from extension tests, likely having the same root cause as what I am describing here: bug 1988715 (and duplicates), part of stack trace pasted in bug 1890389 (https://bugzilla.mozilla.org/show_bug.cgi?id=1890389#c4)

Except for the deterministic test (test_ext_background_early_quit4.js in bug 2051934), the occurrence of this scenario is barely predictable. Unless we want to force all <browser> creators to check for shutdown before initialization (which I think is infeasible), we should relax the NS_ERROR to at most a NS_WARNING when shutdown has commenced.

Relevant parts of the log from https://bugzilla.mozilla.org/show_bug.cgi?id=2051934#c16 :

PID 13752 | [Parent 13752, Main Thread] WARNING: Ignoring remote browser creation request during shutdown: file checkouts\gecko\dom\ipc\ContentParent.cpp:1404
[Parent 13752, Main Thread] ###!!! ASSERTION: Couldn't create child process.: 'Error', file checkouts\gecko\dom\base\nsFrameLoader.cpp:1063
PID 13752 | [13752] Hit MOZ_CRASH([Parent 13752, Main Thread] ###!!! ASSERTION: Couldn't create child process.: 'Error', file checkouts\gecko\dom\base\nsFrameLoader.cpp:1063) at \builds\worker\checkouts\gecko\xpcom\base\nsDebugImpl.cpp:528

#01: Abort(char const*) [xpcom/base/nsDebugImpl.cpp:528]
#02: NS_DebugBreak(unsigned int, char const*, char const*, char const*, int) [xpcom/base/nsDebugImpl.cpp:516]
#03: nsFrameLoader::ShowRemoteFrame(nsSubDocumentFrame*) [dom/base/nsFrameLoader.cpp:1063]
#04: nsFrameLoader::Show(nsSubDocumentFrame*) [dom/base/nsFrameLoader.cpp:943]
#05: nsSubDocumentFrame::ShowViewer() [layout/generic/nsSubDocumentFrame.cpp:207]
#06: AsyncFrameInit::Run() [layout/generic/nsSubDocumentFrame.cpp:93]
#07: nsContentUtils::RemoveScriptBlocker() [dom/base/nsContentUtils.cpp:7756]
#08: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [layout/base/PresShell.cpp:4547]
#09: mozilla::dom::Document::FlushPendingNotifications(mozilla::ChangesToFlush) [dom/base/Document.cpp:11854]
#10: mozilla::dom::Document::FlushPendingNotifications(mozilla::FlushType) [dom/base/Document.cpp:11787]
#11: nsFrameLoader::TryRemoteBrowserInternal() [dom/base/nsFrameLoader.cpp:2524]
#12: nsFrameLoader::TryRemoteBrowser() [dom/base/nsFrameLoader.cpp:2758]
#13: nsFrameLoader::GetBrowsingContext() [dom/base/nsFrameLoader.cpp:3422]
#14: nsFrameLoader::GetLoadContext() [dom/base/nsFrameLoader.cpp:3411]
#15: mozilla::dom::FrameLoader_Binding::get_loadContext

I'll fix it along with re-enabling the test I skipped on debug for this reason from bug 2051934.

Assignee: nobody → rob
Status: NEW → ASSIGNED
Whiteboard: [addons-jira]

Set release status flags based on info from the regressing bug 1811195

@Rob could you please set a severity for this bug? Many thanks

Flags: needinfo?(rob)

It is a debug-only assertion, so without impact for end users. It affects (Firefox) developers running a debug build, and also Firefox engineers who encounter (intermittent) test failures.

Severity: -- → S4
Flags: needinfo?(rob)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: