pdf.js is broken by localstorage app jars

RESOLVED INVALID

Status

()

RESOLVED INVALID
6 years ago
6 years ago

People

(Reporter: jdm, Unassigned)

Tracking

({regression})

Trunk
x86_64
Linux
regression
Points:
---

Firefox Tracking Flags

(firefox18-)

Details

(Reporter)

Description

6 years ago
We hit Assertion failure: false, at /run/media/jdm/ssd/mozilla-central/caps/src/nsPrincipal.cpp:1098 with this stack:

#5  0x00007f720ed52437 in nsPrincipal::GetAppId (this=0x7f71f626e320, aAppId=0x7fff649f3798) at /run/media/jdm/ssd/mozilla-central/caps/src/nsPrincipal.cpp:1098
#6  0x00007f720ebbf050 in nsDOMStorageDBWrapper::CreateScopeDBKey (aPrincipal=0x7f71f626e320, aKey=...) at /run/media/jdm/ssd/mozilla-central/dom/src/storage/nsDOMStorageDBWrapper.cpp:290
#7  0x00007f720ebb69ca in DOMStorageBase::InitAsLocalStorage (this=0x7f71fd5a8980, aPrincipal=0x7f71f626e320, aPrivate=true) at /run/media/jdm/ssd/mozilla-central/dom/src/storage/nsDOMStorage.cpp:476
#8  0x00007f720ebb9224 in nsDOMStorage::InitAsLocalStorage (this=0x7f71e7ce2860, aPrincipal=0x7f71f626e320, aDocumentURI=..., aPrivate=true)
    at /run/media/jdm/ssd/mozilla-central/dom/src/storage/nsDOMStorage.cpp:1127
#9  0x00007f720ebbab3f in nsDOMStorage2::InitAsLocalStorage (this=0x7f71e7cff380, aPrincipal=0x7f71f626e320, aDocumentURI=..., aPrivate=true)
    at /run/media/jdm/ssd/mozilla-central/dom/src/storage/nsDOMStorage.cpp:1531
#10 0x00007f720ebb5f93 in nsDOMStorageManager::GetLocalStorageForPrincipal (this=0x7f7204df2ee0, aPrincipal=0x7f71f626e320, aDocumentURI=..., aPrivate=true, aResult=0x7f71f6fb9e00)
    at /run/media/jdm/ssd/mozilla-central/dom/src/storage/nsDOMStorage.cpp:368
#11 0x00007f720eabe5c7 in nsGlobalWindow::GetLocalStorage (this=0x7f71f6fb9c00, aLocalStorage=0x7fff649f3d60) at /run/media/jdm/ssd/mozilla-central/dom/base/nsGlobalWindow.cpp:8399

I'm presuming this is because pdf.js does some trickery to load the viewer as a resource:// URI so the principal has UNKNOWN_APP_ID.

>1094	NS_IMETHODIMP
>1095	nsPrincipal::GetAppId(uint32_t* aAppId)
>1096	{
>1097	  if (mAppId == nsIScriptSecurityManager::UNKNOWN_APP_ID) {
>1098	    MOZ_ASSERT(false);
>1099	    *aAppId = nsIScriptSecurityManager::NO_APP_ID;
>1100	    return NS_OK;
>1101	  }
(Reporter)

Comment 1

6 years ago
$1 = (nsPrincipal) {
  <nsBasePrincipal> = {
    <nsJSPrincipals> = {
      <nsIPrincipal> = {
        <nsISerializable> = {
          <nsISupports> = {
            _vptr.nsISupports = 0x7ff279cd6930
          }, <No data fields>}, <No data fields>}, 
      <JSPrincipals> = {
        refcount = 2214, 
        debugToken = 200546144
      }, 
      members of nsJSPrincipals: 
      static DEBUG_TOKEN = 200546144
    }, 
    members of nsBasePrincipal: 
    static sInvalid =       "Invalid", 
    mAnnotations = {
      <nsTArray_base<nsTArrayDefaultAllocator>> = {
Python Exception <type 'exceptions.RuntimeError'> maximum recursion depth exceeded: 
        mHdr = 0x7ff279efd2d8
      }, 
      <nsTArray_SafeElementAtHelper<nsAutoPtr<nsHashtable>, nsTArray<nsAutoPtr<nsHashtable>, nsTArrayDefaultAllocator> >> = {<No data fields>}, <No data fields>}, 
    mCapabilities = 0x0, 
    mPrefName = <void string>, 
    static sCapabilitiesOrdinal = 0, 
    mCert = [(nsBasePrincipal::Certificate*) 0x0], 
    mSecurityPolicy = 0x7ff2629a1c80, 
    mCSP = [(nsIContentSecurityPolicy*) 0x0], 
    mTrusted = false
  }, 
  members of nsPrincipal: 
  mDomain = [(nsIURI*) 0x0], 
  mCodebase = [(nsResURL*) 0x7ff26565ac00], 
  mAppId = 4294967295, 
  mInMozBrowser = false, 
  mCodebaseImmutable = true, 
  mDomainImmutable = false, 
  mInitialized = true
}
(Reporter)

Updated

6 years ago
tracking-firefox18: --- → ?
Keywords: regression
(Reporter)

Comment 3

6 years ago
So this is broken until the next pdf.js merge?

Comment 4

6 years ago
Hmm, I patched the generated file, PdfStreamConverter.js
There's also issue 2134 opened for this on github.
(Reporter)

Comment 5

6 years ago
Oh, I probably installed the development version into this testing profile.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → INVALID

Updated

6 years ago
tracking-firefox18: ? → -
You need to log in before you can comment on or make changes to this bug.