If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

MOZ_ALWAYS_SUCCEEDS(GetOriginFromPrincipal(aPrincipal, mOrigin)) fails

RESOLVED INVALID

Status

()

Core
Security: CAPS
RESOLVED INVALID
a year ago
6 months ago

People

(Reporter: tzimmermann, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

0xb2cb980a in nsPermissionManager::PermissionKey::PermissionKey (this=this@entry=0xaa069ea0, aPrincipal=aPrincipal@entry=0xae892760)
    at /home/mozilla/Projects/mozilla/src/hg.mozilla.org/mozilla-central/extensions/cookie/nsPermissionManager.cpp:613
613       MOZ_ALWAYS_SUCCEEDS(GetOriginFromPrincipal(aPrincipal, mOrigin));
(gdb) bt
#0  0xb2cb980a in nsPermissionManager::PermissionKey::PermissionKey (this=this@entry=0xaa069ea0, aPrincipal=aPrincipal@entry=0xae892760)
    at /home/mozilla/Projects/mozilla/src/hg.mozilla.org/mozilla-central/extensions/cookie/nsPermissionManager.cpp:613
#1  0xb2cbd190 in nsPermissionManager::GetPermissionHashKey (this=this@entry=0xae131940, aPrincipal=aPrincipal@entry=0xae892760, aType=aType@entry=1, 
    aExactHostMatch=aExactHostMatch@entry=true) at /home/mozilla/Projects/mozilla/src/hg.mozilla.org/mozilla-central/extensions/cookie/nsPermissionManager.cpp:2143
#2  0xb2cbd6b4 in nsPermissionManager::CommonTestPermission (this=0xae131940, aPrincipal=0xae892760, aType=0xae122cc0 "geolocation", aPermission=0xbeeca5d0, 
    aExactHostMatch=true, aIncludingSession=true) at /home/mozilla/Projects/mozilla/src/hg.mozilla.org/mozilla-central/extensions/cookie/nsPermissionManager.cpp:2115
#3  0xb2cbd738 in nsPermissionManager::TestExactPermissionFromPrincipal (this=<optimized out>, aPrincipal=<optimized out>, aType=<optimized out>, aPermission=<optimized out>)
    at /home/mozilla/Projects/mozilla/src/hg.mozilla.org/mozilla-central/extensions/cookie/nsPermissionManager.cpp:1969
#4  0xb27bacae in NS_InvokeByIndex (that=<optimized out>, methodIndex=14, paramCount=<optimized out>, params=<optimized out>)
    at ../../../../../../../hg.mozilla.org/mozilla-central/xpcom/reflect/xptcall/md/unix/xptcinvoke_arm.cpp:169
#5  0xb2c7e56c in Invoke (this=0xbeeca580) at /home/mozilla/Projects/mozilla/src/hg.mozilla.org/mozilla-central/js/xpconnect/src/XPCWrappedNative.cpp:2075
#6  CallMethodHelper::Call (this=0xbeeca580) at /home/mozilla/Projects/mozilla/src/hg.mozilla.org/mozilla-central/js/xpconnect/src/XPCWrappedNative.cpp:1394
#7  0xb2c7e668 in XPCWrappedNative::CallMethod (ccx=..., mode=mode@entry=XPCWrappedNative::CALL_METHOD)
    at /home/mozilla/Projects/mozilla/src/hg.mozilla.org/mozilla-central/js/xpconnect/src/XPCWrappedNative.cpp:1361
#8  0xb2c82964 in XPC_WN_CallMethod (cx=0xb61ee000, argc=<optimized out>, vp=<optimized out>)
    at /home/mozilla/Projects/mozilla/src/hg.mozilla.org/mozilla-central/js/xpconnect/src/XPCWrappedNativeJSOps.cpp:1128
Relevant logcat:

I/Gecko   (  322): Caught webapps install permissions error for app://calendar.gaiamobile.org : [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [ns
IPermissionManager.addFromPrincipal]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource://gre/modules/PermissionSettings.jsm :: _internalAddPermission 
:: line 111"  data: no]
E/GeckoConsole(  322): [JavaScript Error: "[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIPermissionManager.addFromPrincipal]"  nsresult: "0x8
0004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource://gre/modules/PermissionSettings.jsm :: _internalAddPermission :: line 111"  data: no]"]
E/GeckoConsole(  322): _internalAddPermission@resource://gre/modules/PermissionSettings.jsm:111:7
E/GeckoConsole(  322): addPermission@resource://gre/modules/PermissionSettings.jsm:64:5
E/GeckoConsole(  322): setPermission@resource://gre/modules/PermissionsInstaller.jsm:200:5
E/GeckoConsole(  322): installPermissions@resource://gre/modules/PermissionsInstaller.jsm:118:7
E/GeckoConsole(  322): this.DOMApplicationRegistry.updatePermissionsForApp/<@resource://gre/modules/Webapps.jsm:459:9
E/GeckoConsole(  322): Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:937:23
E/GeckoConsole(  322): this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:816:7
E/GeckoConsole(  322): this.PromiseWalker.scheduleWalkerLoop/<@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backe
I/Gecko   (  322): [322] WARNING: NS_ENSURE_TRUE(standardURL) failed: file /home/mozilla/Projects/mozilla/src/hg.mozilla.org/mozilla-central/caps/nsPrincipal.cpp, line 176
I/Gecko   (  322): [322] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file /home/mozilla/Projects/mozilla/src/hg.mozilla.org/mozilla-central/extensions/cookie/nsPermissionManager.cpp, line 110
F/MOZ_Assert(  322): Assertion failure: false (NS_SUCCEEDED(GetOriginFromPrincipal(aPrincipal, mOrigin))), at /home/mozilla/Projects/mozilla/src/hg.mozilla.org/mozilla-central/extensions/cookie/nsPermissionManager.cpp:613
Component: General → Security: CAPS
Product: Firefox OS → Core
That seems dubious:
> Caught webapps install permissions error for app://calendar.gaiamobile.org

I killed app:// on m-c in bug 1285170
(In reply to Alexandre LISSY :gerard-majax from comment #2)
> That seems dubious:
> > Caught webapps install permissions error for app://calendar.gaiamobile.org
> 
> I killed app:// on m-c in bug 1285170

Then let's invert the dependencies.
No longer blocks: 1252143
Depends on: 1252143
Also hitting this when trying to run mulet mochitests:
> JavaScript error: resource://gre/modules/FileUtils.jsm, line 63: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIProperties.get]
Caught webapps install permissions error for app://test_desktop_packaged_launch : [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIPermissionManager.addFromPrincipal]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource://gre/modules/PermissionSettings.jsm :: _internalAddPermission :: line 111"  data: no]
Blocks: 1286190, 1252143
No longer depends on: 1252143
thomas, Is there any chance you could check what the URI which the principal is holding is? I have a feeling that that is what is triggering the failure, but I want to be sure.
Flags: needinfo?(tzimmermann)
(Reporter)

Updated

6 months ago
Status: NEW → RESOLVED
Last Resolved: 6 months ago
Flags: needinfo?(tdz)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.