PermissionKey CTOR should not crash

RESOLVED FIXED in Firefox 53

Status

()

defect
RESOLVED FIXED
3 years ago
5 months ago

People

(Reporter: baku, Assigned: baku)

Tracking

50 Branch
mozilla53
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox53 fixed)

Details

Attachments

(1 attachment)

Debugging something completely unrelated, I found this crash:

[Child 26769] WARNING: NS_ENSURE_TRUE(standardURL) failed: file /home/baku/Sources/m/foobar/src/caps/nsPrincipal.cpp, line 173
[Child 26769] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file /home/baku/Sources/m/foobar/src/extensions/cookie/nsPermissionManager.cpp, line 108
Assertion failure: false (NS_SUCCEEDED(GetOriginFromPrincipal(aPrincipal, mOrigin))), at /home/baku/Sources/m/foobar/src/extensions/cookie/nsPermissionManager.cpp:609

I was able to reproduce twice, but now I cannot. This is why a test is not attached.
Btw, GetOriginFromPrincipal can fail. We should change how we create PermissionKey objects.
I'll do that in a follow up.
Attachment #8817449 - Flags: review?(ehsan)
Blocks: 1322518
Comment on attachment 8817449 [details] [diff] [review]
crash_blobUrl.patch

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

::: caps/nsPrincipal.cpp
@@ +165,3 @@
>    }
> +
> +  nsCOMPtr<nsIURIWithPrincipal> uriWithPrincipal = do_QueryInterface(origin);

Please add a comment about why we're doing this.
Attachment #8817449 - Flags: review?(ehsan) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b357fbee89ca
nsIPrincipal::GetOrigin should use the parent principal when dealing with blobURL, r=ehsan
https://hg.mozilla.org/mozilla-central/rev/b357fbee89ca
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Depends on: 1349805
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.