Closed Bug 1886228 Opened 2 years ago Closed 2 years ago

Intermittent Assertion failure: false (Receiving unexpected Principal), at /builds/worker/checkouts/gecko/dom/ipc/ContentParent.cpp:1297 | single tracking bug

Categories

(Core :: DOM: Content Processes, defect)

defect

Tracking

()

RESOLVED FIXED
132 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- fixed
firefox131 --- wontfix
firefox132 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: simonf)

References

Details

(Keywords: assertion, intermittent-failure, intermittent-testcase)

Attachments

(1 external file)

Filed by: smolnar [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=451324356&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/MTMdf-QIRgy9tRPdVQQ7vA/runs/0/artifacts/public/logs/live_backing.log


TEST-START | browser/components/search/test/browser/browser_contentSearchUI.js
[task 2024-03-19T16:07:58.870Z] 16:07:58     INFO - GECKO(1062) | [Child 1255: Main Thread]: I/DocShellAndDOMWindowLeak ++DOCSHELL 7feb66d7d000 == 2 [pid = 1255] [id = 3]
[task 2024-03-19T16:07:58.871Z] 16:07:58     INFO - GECKO(1062) | [Child 1255: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 3 (7feb672a83e0) [pid = 1255] [serial = 7] [outer = 0]
[task 2024-03-19T16:07:58.872Z] 16:07:58     INFO - GECKO(1062) | [Child 1255: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 4 (7feb66d7d400) [pid = 1255] [serial = 8] [outer = 7feb672a83e0]
[task 2024-03-19T16:07:59.041Z] 16:07:59     INFO - GECKO(1062) | [Child 1255: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 5 (7feb66d7bc00) [pid = 1255] [serial = 9] [outer = 7feb672a83e0]
[task 2024-03-19T16:07:59.299Z] 16:07:59     INFO - GECKO(1062) | [Child 1317: Main Thread]: I/DocShellAndDOMWindowLeak ++DOCSHELL 7fe770565000 == 9 [pid = 1317] [id = 10]
<...>
INFO - GECKO(1062) | [Child 1317: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 27 (7fe771407400) [pid = 1317] [serial = 53] [outer = 0] [url = about:blank]
[task 2024-03-19T16:08:23.673Z] 16:08:23     INFO - GECKO(1062) | Assertion failure: false (Receiving unexpected Principal), at /builds/worker/checkouts/gecko/dom/ipc/ContentParent.cpp:1297
[task 2024-03-19T16:08:23.679Z] 16:08:23     INFO -  Initializing stack-fixing for the first stack frame, this may take a while...
[task 2024-03-19T16:08:35.197Z] 16:08:35     INFO - GECKO(1062) | #01: mozilla::dom::ContentParent::LogAndAssertFailedPrincipalValidationInfo(nsIPrincipal*, char const*) [dom/ipc/ContentParent.cpp:1297]
[task 2024-03-19T16:08:35.198Z] 16:08:35     INFO - GECKO(1062) | #02: ??? [/builds/worker/workspace/build/application/firefox/libxul.so + 0x77585f7]
[task 2024-03-19T16:08:35.199Z] 16:08:35     INFO - GECKO(1062) | #03: mozilla::dom::PContentParent::OnMessageReceived(IPC::Message const&) [s3:gecko-generated-sources:4bd1505dc3df8cb22b9c5ca513a7acac3f5513cbb7ff269c152408e846e88f55afba12a20f8987d35258aedd6fcd7a2d69d243ed4d3f2d74b88ef1eb56b91691/ipc/ipdl/PContentParent.cpp::0]
[task 2024-03-19T16:08:35.199Z] 16:08:35     INFO - GECKO(1062) | #04: mozilla::ipc::MessageChannel::DispatchAsyncMessage(mozilla::ipc::ActorLifecycleProxy*, IPC::Message const&) [ipc/glue/MessageChannel.cpp:1818]
[task 2024-03-19T16:08:35.200Z] 16:08:35     INFO - GECKO(1062) | #05: mozilla::ipc::MessageChannel::DispatchMessage(mozilla::ipc::ActorLifecycleProxy*, mozilla::UniquePtr<IPC::Message, mozilla::DefaultDelete<IPC::Message> >) [ipc/glue/MessageChannel.cpp:0]
[task 2024-03-19T16:08:35.201Z] 16:08:35     INFO - GECKO(1062) | #06: mozilla::ipc::MessageChannel::RunMessage(mozilla::ipc::ActorLifecycleProxy*, mozilla::ipc::MessageChannel::MessageTask&) [ipc/glue/MessageChannel.cpp:1530]
[task 2024-03-19T16:08:35.201Z] 16:08:35     INFO - GECKO(1062) | #07: mozilla::ipc::MessageChannel::MessageTask::Run() [ipc/glue/MessageChannel.cpp:1637]
[task 2024-03-19T16:08:35.202Z] 16:08:35     INFO - GECKO(1062) | #08: mozilla::RunnableTask::Run() [xpcom/threads/TaskController.cpp:579]
[task 2024-03-19T16:08:35.202Z] 16:08:35     INFO - GECKO(1062) | #09: mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) [xpcom/threads/TaskController.cpp:905]
[task 2024-03-19T16:08:35.203Z] 16:08:35     INFO - GECKO(1062) | #10: mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) [xpcom/threads/TaskController.cpp:0]
[task 2024-03-19T16:08:35.203Z] 16:08:35     INFO - GECKO(1062) | #11: mozilla::TaskController::ProcessPendingMTTask(bool) [xpcom/threads/TaskController.cpp:514]
[task 2024-03-19T16:08:35.204Z] 16:08:35     INFO - GECKO(1062) | #12: mozilla::detail::RunnableFunction<mozilla::TaskController::TaskController()::$_0>::Run() [xpcom/threads/nsThreadUtils.h:549]
[task 2024-03-19T16:08:35.204Z] 16:08:35     INFO - GECKO(1062) | #13: nsThread::ProcessNextEvent(bool, bool*) [xpcom/threads/nsThread.cpp:1203]
[task 2024-03-19T16:08:35.205Z] 16:08:35     INFO - GECKO(1062) | #14: NS_ProcessNextEvent(nsIThread*, bool) [xpcom/threads/nsThreadUtils.cpp:480]
[task 2024-03-19T16:08:35.206Z] 16:08:35     INFO - GECKO(1062) | #15: mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) [ipc/glue/MessagePump.cpp:85]
[task 2024-03-19T16:08:35.206Z] 16:08:35     INFO - GECKO(1062) | #16: MessageLoop::Run() [ipc/chromium/src/base/message_loop.cc:346]
[task 2024-03-19T16:08:35.206Z] 16:08:35     INFO - GECKO(1062) | #17: nsBaseAppShell::Run() [widget/nsBaseAppShell.cpp:150]
[task 2024-03-19T16:08:35.207Z] 16:08:35     INFO - GECKO(1062) | #18: nsAppShell::Run() [widget/gtk/nsAppShell.cpp:470]
[task 2024-03-19T16:08:35.207Z] 16:08:35     INFO - GECKO(1062) | #19: nsAppStartup::Run() [toolkit/components/startup/nsAppStartup.cpp:297]
[task 2024-03-19T16:08:35.208Z] 16:08:35     INFO - GECKO(1062) | #20: XREMain::XRE_mainRun() [toolkit/xre/nsAppRunner.cpp:5751]
[task 2024-03-19T16:08:35.208Z] 16:08:35     INFO - GECKO(1062) | #21: XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) [toolkit/xre/nsAppRunner.cpp:5963]
[task 2024-03-19T16:08:35.209Z] 16:08:35     INFO - GECKO(1062) | #22: XRE_main(int, char**, mozilla::BootstrapConfig const&) [toolkit/xre/nsAppRunner.cpp:6020]
[task 2024-03-19T16:08:35.210Z] 16:08:35     INFO - GECKO(1062) | #23: ??? [/builds/worker/workspace/build/application/firefox/firefox + 0x3e48a]
[task 2024-03-19T16:08:35.212Z] 16:08:35     INFO - GECKO(1062) | #24: __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6 + 0x21b97]
[task 2024-03-19T16:08:35.213Z] 16:08:35     INFO - GECKO(1062) | #25: ??? [/builds/worker/workspace/build/application/firefox/firefox + 0x3dfc9]
[task 2024-03-19T16:08:35.214Z] 16:08:35     INFO - GECKO(1062) | #26: ??? (???:???)
[task 2024-03-19T16:08:35.214Z] 16:08:35     INFO - GECKO(1062) | ExceptionHandler::WaitForContinueSignal waiting for continue signal...
[task 2024-03-19T16:08:35.215Z] 16:08:35     INFO - GECKO(1062) | ExceptionHandler::GenerateDump cloned child 1838
<...>

I've done some debugging here, and if I turn on MOZ_LOG=Process:5, then I see:

 0:32.52 GECKO(34214) [Parent 34214: Main Thread]: E/Process   Receiving unexpected Principal (about:test-about-content-search-ui) within RecvUnstoreAndBroadcastBlobURLUnregistration
 0:32.52 GECKO(34214) [34214] Assertion failure: false (Receiving unexpected Principal), at /builds/worker/checkouts/gecko/dom/ipc/ContentParent.cpp:1261

The first message is the extra detail to the assertion seen here. This points to an issue with the RecvUnstoreAndBroadcastBlobURLUnregistration function.

That makes me think this started roughly around the time when we changed how the handling of search engine icons work. Previously, we would pass a moz-extension URI to the content process for the display of the image, however now we pass binary data that is converted to blob URLs.

At the end of the test, just before this Assertion, we close ~11 tabs which are all the about:test-about-content-search-ui. So I suspect there's something conflicting between cleaning up the blob URIs and the tab principal going away.

Christoph, I think you added the validate principal code, would you be able to take a look?

Severity: S4 → --
Component: Search → DOM: Content Processes
Flags: needinfo?(ckerschb)
Priority: P5 → --
Product: Firefox → Core

302 to Simon - Simon can you please take a look at that now that you started working on Principal Validation?

Flags: needinfo?(ckerschb) → needinfo?(sfriedberger)
Flags: needinfo?(sfriedberger)

Hey Simon, I saw you cleared your ni? - are there any insights to share?

Flags: needinfo?(sfriedberger)
Flags: needinfo?(sfriedberger)
Assignee: nobody → sfriedberger

The content process is trying to unstore a blob after the about page is already gone. So the principal validation code fails to retrieve the flags for the about page.

Afaict, the RecvUnstoreAndBroadcastBlobURLUnregistration is triggered by destruction of the global object while the removal of the about page https://searchfox.org/mozilla-central/source/testing/mochitest/BrowserTestUtils/BrowserTestUtils.sys.mjs#2510 is triggered by the cleanup function of the test https://searchfox.org/mozilla-central/source/browser/components/search/test/browser/browser_contentSearchUI.js#306

Since the about page is in its own privileged about process it doesn't get cleaned up in the context of the test, only when the browser exits. Therefore, waiting for that in the test is not possible.

Pushed by sfriedberger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/383a4287ef68 Add exception to principal validation for removed about page r=tjr
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch

Please nominate this for ESR128 approval when you get a chance so we can quiet the failures there as well :)

Flags: needinfo?(sfriedberger)

Comment on attachment 9426641 [details]
Bug 1886228 - Add exception to principal validation for removed about page r=tjr

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Removes annoying test failure noise
  • User impact if declined: None
  • Fix Landed on Version: 132
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Removes a check which doesn't improve security in the current configuration. This particular special case is probably confined to tests anyway.
Flags: needinfo?(sfriedberger)
Attachment #9426641 - Flags: approval-mozilla-esr128?

Comment on attachment 9426641 [details]
Bug 1886228 - Add exception to principal validation for removed about page r=tjr

Approved for 128.4esr.

Attachment #9426641 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128+
See Also: → 1960500
See Also: → 1961900
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: