Closed Bug 1110067 Opened 9 years ago Closed 9 years ago

Presence of asmjs cache in storage/temporary causing indexedDB.open() to fail for non-persistent storage

Categories

(Core :: Storage: IndexedDB, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37
Tracking Status
firefox36 --- fixed
firefox37 --- fixed

People

(Reporter: hectorz, Assigned: janv)

References

Details

Attachments

(3 files)

(excerpt from Jan Varga [:janv]'s bug 1083927 comment #42)
> > @@ +5005,5 @@
> > > +        }
> > > +
> > > +        originProps->mTimestamp = timestamp;
> > > +      } else {
> > > +        NS_WARNING("chrome in temporary storage directory?!");
> > 
> > This can happen, can't it? If chrome explicitly asks for storage:persistent?
> 
> This is actually a case when "chrome" appears in storage/temporary and that
> shouldn't happen, because we don't allow default/temporary storage for
> chrome currently.

asmjs cache is stored in storage/temporary/chrome, and its .metadata is not updated with the isApp byte, causing indexedDB.open() to fail for non-persistent storage.

Output from debug Firefox:
> [30734] WARNING: 'NS_FAILED(rv)', file /.../dom/quota/QuotaManager.cpp, line 1135
> [30734] WARNING: 'NS_FAILED(rv)', file /.../dom/quota/QuotaManager.cpp, line 1959
> [30734] WARNING: 'NS_FAILED(rv)', file /.../dom/quota/QuotaManager.cpp, line 2323
> [30734] WARNING: 'NS_FAILED(rv)', file /.../dom/indexedDB/ActorsParent.cpp, line 11103
> [30734] WARNING: 'NS_FAILED(rv)', file /.../dom/indexedDB/ActorsParent.cpp, line 10969
> [30734] WARNING: Converting non-IndexedDB error code (0x80004005) to 
> NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR: file /.../dom/indexedDB/ActorsParent.cpp, line 407
Oh, I thought that chrome doesn't store anything in temporary storage. Obviously that's true for IndexedDB, but not for asmjscache. I'll fix it.
Anyway, Luke, do you know where we use asm.js in chrome ?
Flags: needinfo?(luke)
(In reply to Jan Varga [:janv] from comment #1)
> Anyway, Luke, do you know where we use asm.js in chrome ?

In my case, it's the language detector for the (default off) translation feature.
Hector, can you zip and attach your storage/temporary/chrome.metadata and storage/temporary/chrome/asmjs
I'd like to add it to our test.
(In reply to Jan Varga [:janv] from comment #3)
> Hector, can you zip and attach your storage/temporary/chrome.metadata and
> storage/temporary/chrome/asmjs
> I'd like to add it to our test.

From Aurora 2014-12-11, generated by set browser.translation.detectLanguage to true, restart Firefox, and browse some webpages.
IIRC, b2g also uses asm.js for the pinyin keyboard, but I don't know if that's chrome.
Flags: needinfo?(luke)
Attached patch patch v1Splinter Review
I added storage/temporary/chrome/.metadata (without the isApp flag) to defaultStorageUpgrade_profile.zip
Assignee: nobody → Jan.Varga
Attachment #8535097 - Flags: review?(bent.mozilla)
Attachment #8535097 - Flags: review?(bent.mozilla) → review+
Copy this file to <profile>/storage/temporary/chrome to restore temporary storage.
https://hg.mozilla.org/mozilla-central/rev/c630febb1985
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Comment on attachment 8535097 [details] [diff] [review]
patch v1

Approval Request Comment
[Feature/regressing bug #]:
[User impact if declined]:
[Describe test coverage new/current, TBPL]:
[Risks and why]: 
[String/UUID change made/needed]:

Approval Request Comment

[Feature/regressing bug #]: This is a followup fix for bug 1083927 which just landed on aurora.

[User impact if declined]: All databases in temporary storage fail to open if asmjs was cached by chrome.

[Describe test coverage new/current, TBPL]: The fix landed on m-c on Dec 11th, 2014. A test has been updated to catch this problem in future.

[Risks and why]: The patch is simple and it has been working ok on trunk for 4 weeks.

[String/UUID change made/needed]: No string/UUID changes.
Attachment #8535097 - Flags: approval-mozilla-aurora?
Attachment #8535097 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.