Closed Bug 1127534 Opened 9 years ago Closed 9 years ago

Desktop notification with icon hits "Assertion failure: nsContentUtils::IsSystemPrincipal(triggeringPrincipal)"

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
macOS
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: jruderman, Assigned: ckerschb)

References

Details

(Keywords: assertion, testcase)

Attachments

(4 files)

Attached file testcase
Assertion failure: nsContentUtils::IsSystemPrincipal(triggeringPrincipal), at /Users/jruderman/trees/mozilla-central/image/src/imgLoader.cpp:714
Attached file stack (no e10s)
Attached file stack (e10s)
Should I be scared?
Flags: needinfo?(bobbyholley)
Flags: needinfo?(bobbyholley) → needinfo?(mozilla)
Hey Jesse,
I see you filed that bug quite a while ago [2015-01-29]. It seems to work for me using the latest nightly. I assume the problem got fixed in the meantime. Also, Notifications are quite heavily used these days so I would be surprised if there is an issue.

If it's still problem, please let me know, otherwise we can close this bug with 'worksforme'.
Flags: needinfo?(mozilla) → needinfo?(jruderman)
I can still reproduce on Mac.
Flags: needinfo?(mozilla)
(In reply to Jesse Ruderman from comment #5)
> I can still reproduce on Mac.

Ah, I should have checked the bug-flags before answering, because I tested on Linux only. But apparently that's a mac specific problem.

Looking at the code reveals that mac sends null [1] as the context to LoadImage, which then calls NewImageChannel with a null ctx [2] which causes the loadingPrincipal to become the triggeringPrincipal, which ultimately triggers the assertion [3].

It seems that we can't query a doc/node within the OSXNotificationCenter.

Jonas, how would you like to proceed?

[1] http://mxr.mozilla.org/mozilla-central/source/widget/cocoa/OSXNotificationCenter.mm#250
[2] http://mxr.mozilla.org/mozilla-central/source/image/imgLoader.cpp#1601
[3] http://mxr.mozilla.org/mozilla-central/source/image/imgLoader.cpp#792
Blocks: 1083422
Flags: needinfo?(mozilla) → needinfo?(jonas)
Assignee: nobody → mozilla
Since this channel is created in the parent process, there's no way we can get a document here in the e10s case. Technically we could probably get a document in the non-e10s case, but that doesn't seem worth it.

I'd say just remove the assertion and document that notifications (and eventually favicons) create a channel in the parent process and so we can't get a requestingNode in that case.
Flags: needinfo?(jonas)
Also, Jesse, you are awesome! Bugs like this, with a testcase and a stack, rock!
(In reply to Jonas Sicking (:sicking) from comment #7) 
> I'd say just remove the assertion and document that notifications (and
> eventually favicons) create a channel in the parent process and so we can't
> get a requestingNode in that case.


What do you mean by eventually favicons?

Can we get a requestingPrincipal even if we can't get a node?  Favicons should go through security checks, and without a principal they can't.
Yes, we can get a principal since you can send a principal across an IPC boundary. But you can't send a node.

The favicon code does its own security checks, and then load the image using a <xul:image>. That means that it currently uses a system principal. Which is fine because it's doing its own security checks.

But we talked about making it possible to set a loadingPrincipal on a <xul:image> such that we do the load using the "correct" principal instead, and remove the custom favicon security checks.

But that's not the case yet.
(In reply to Jonas Sicking (:sicking) from comment #7)
> I'd say just remove the assertion and document that notifications (and
> eventually favicons) create a channel in the parent process and so we can't
> get a requestingNode in that case.

As discussed with Jonas over IRC, we decided to just remove the assertion.

Jonas said it's ok to r+ the patch in his name.
Flags: needinfo?(jruderman)
Attachment #8642185 - Flags: review+
url:        https://hg.mozilla.org/integration/mozilla-inbound/rev/87ff486a4b6afacf9e8dba60a61e17ce431e33b4
changeset:  87ff486a4b6afacf9e8dba60a61e17ce431e33b4
user:       Christoph Kerschbaumer <mozilla@christophkerschbaumer.com>
date:       Sun Aug 02 10:42:22 2015 -0700
description:
Bug 1127534 - Remove assertion before creating a channel (r=sicking)
https://hg.mozilla.org/mozilla-central/rev/87ff486a4b6a
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: