Closed Bug 1541934 Opened 6 years ago Closed 6 years ago

mozStorageConnection can crash on shutdown

Categories

(Core :: Permission Manager, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: baku, Assigned: baku)

References

Details

Attachments

(1 file, 2 obsolete files)

NS_GetCurrentThread() can return null during the shutdown and in mozStorageConnection we have many assertion such as:
MOZ_ASSERT(threadOpenedOn == NS_GetCurrentThread())

https://searchfox.org/mozilla-central/rev/14dc5b7d8a6da1854b2f9f33f1da77a97368cd54/storage/mozStorageConnection.cpp#978

:baku and I are discussing/investigating this further on IRC (specifically the consumer), but I think this will be a WONTFIX because it's too late to drop a connection reference at ShutdownPhase::ShutdownFinal from mozStorage's perspective.

mozStorage shuts down at xpcom-shutdown-threads, which is already very late. Arguably, all its consumers should have shutdown at profile-before-change, profile-before-change-qm, or profile-before-change-telemetry. (And indeed, the consumer in question is trying to shutdown mozStorage at profile-before-change, so there's something weird going on.)

Component: DOM: Web Storage → Storage
Product: Core → Toolkit

And omitted context: the consumer is nsPermissionManager that gets its singleton cleared by ClearOnShutdown()'s default of ShutdownFinal and it has retained a database reference that it should not have.

Attachment #9055901 - Attachment is obsolete: true

Moving components since the fix is now in permission manager.

Component: Storage → Permission Manager
Product: Toolkit → Core
Assignee: nobody → amarchesini
Status: NEW → ASSIGNED
Priority: -- → P1
Attachment #9055930 - Attachment is obsolete: true
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6e87244c4b89 mozStorageConnection can crash on shutdown, r=asuth
Flags: needinfo?(amarchesini)
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9a8e3ac367f8 mozStorageConnection can crash on shutdown, r=asuth
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Regressions: 1707963
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: