Closed Bug 1652849 Opened 5 years ago Closed 5 years ago

Assertion nsContentUtils::IsSafeToRunScript() fails when a JSProcessActor observes docshell creation

Categories

(Core :: DOM: Content Processes, defect)

defect

Tracking

()

RESOLVED FIXED
mozilla80
Fission Milestone M6b
Tracking Status
firefox80 --- fixed

People

(Reporter: enndeakin, Assigned: kmag)

References

Details

Attachments

(1 file)

I added a JSProcessActorChild which listens to the 'webnavigation-create' observer notification.

When running the test browser/base/content/test/tabcrashed/browser_printpreview_crash.js, I get an assertion:

Assertion failure: nsContentUtils::IsSafeToRunScript(), at /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSProcessActorProtocol.cpp:89

#01: non-virtual thunk to mozilla::dom::JSProcessActorProtocol::Observe(nsISupports*, char const*, char16_t const*) [dom/ipc/jsactor/JSProcessActorProtocol.cpp:0]
#02: nsObserverList::NotifyObservers(nsISupports*, char const*, char16_t const*) [xpcom/ds/nsObserverList.cpp:64]
#03: nsObserverService::NotifyObservers(nsISupports*, char const*, char16_t const*) [xpcom/ds/nsObserverService.cpp:290]
#04: nsDocShell::Create() [docshell/base/nsDocShell.cpp:0]
#05: nsFrameLoader::MaybeCreateDocShell() [dom/base/nsFrameLoader.cpp:2191]
#06: nsFrameLoader::FinishStaticClone(nsFrameLoader*, nsIDocShell**, mozilla::dom::Document**) [dom/base/nsFrameLoader.cpp:2782]
#07: BuildNestedPrintObjects(mozilla::dom::Document*, mozilla::UniquePtr<nsPrintObject, mozilla::DefaultDelete<nsPrintObject> > const&, nsTArray<nsPrintObject*>) [layout/printing/nsPrintJob.cpp:343]
#08: nsPrintJob::DoCommonPrint(bool, nsIPrintSettings
, nsIWebProgressListener*, mozilla::dom::Document*) [layout/printing/nsPrintJob.cpp:685]
#09: nsPrintJob::CommonPrint(bool, nsIPrintSettings*, nsIWebProgressListener*, mozilla::dom::Document*) [layout/printing/nsPrintJob.cpp:595]
#10: nsPrintJob::PrintPreview(mozilla::dom::Document*, nsIPrintSettings*, nsIWebProgressListener*) [layout/printing/nsPrintJob.cpp:999]
#11: nsDocumentViewer::PrintPreview(nsIPrintSettings*, mozIDOMWindowProxy*, nsIWebProgressListener*) [layout/base/nsDocumentViewer.cpp:3239]

This is the only test that asserts.

It can easily be reproduced in a debug build by adding a 'webnavigation-create' observer to one of the existing JSProcessActors in ActorManagerParent.jsm

Assignee: nobody → kmaglione+bmo
Fission Milestone: --- → M6b
Pushed by maglione.k@gmail.com: https://hg.mozilla.org/integration/autoland/rev/bf0f15100bc2 Use NotifyWhenScriptSafe for some additional observers. r=nika
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: