Protect against attempts to use the Add-ons Manager APIs after shutdown.

RESOLVED FIXED in mozilla17

Status

()

Toolkit
Add-ons Manager
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Unfocused, Assigned: mossop)

Tracking

(Depends on: 1 bug)

unspecified
mozilla17
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Split off from bug 671894, since it's separate enough for its own bug.


Comment from bug 671894 comment 31 describing this:
> Been trying to figure out potential problems and solutions here. One thing
> I've seen in a number of logs is evidence of something attempting to access
> the add-ons manager after it has been shutdown. I can only guess at three
> causes for this, a fault in our code, or some add-on either shutting down
> the add-ons manager itself or calling it during shutdown. Either that or an
> async operation is waiting to complete when we start shutdown and completes
> after, trying to use the DB again in the process.
> 
> When this happens the DB is already locked and so we attempt to delete it
> and recreate from scratch to continue, but since the add-ons manager is
> shutdown most of the variables we need are uninitialised so this fails
> probably leaving an empty DB in the profile. This is probably why some
> people see empty add-ons lists until they install a new add-on (causes a
> complete re-scan of the profile).
> 
> This first patch attempts to protect against a lot of this. It removes the
> currently fairly visible API to shutdown the add-ons manager (it's still
> possible to do, just harder) and rejects any attempts to use the API while
> it is shutdown.
Blocks: 671894
Created attachment 652020 [details] [diff] [review]
Patch v2

Patch from bug 671894. Carrying over review, as all I did was fix the bitrot.
Attachment #652020 - Flags: review+
https://hg.mozilla.org/integration/fx-team/rev/42bc5a310a29
Assignee: bmcbride → dtownsend+bugmail
Bah, backed out thanks to orange on *everything* for debug builds (opt builds are all fine):
https://hg.mozilla.org/integration/fx-team/rev/7a847385e42b


Seeing this everywhere:

Assertion failure: !connections[i]->ConnectionReady(), at ../../../storage/src/mozStorageService.cpp:853

That seems to be happening on shutdown.


Example logs:
https://tbpl.mozilla.org/php/getParsedLog.php?id=14393594&full=1&branch=fx-team#error0
https://tbpl.mozilla.org/php/getParsedLog.php?id=14395245&tree=Fx-Team&full=1#error0
Assignee: dtownsend+bugmail → bmcbride
Whiteboard: [backed out]
That was due to a typo in AddonManagerInternal.observe(), causing AddonManagerInternal.shutdown() to never be called. Going to run this through Try just to be sure.
https://hg.mozilla.org/integration/fx-team/rev/d33742ea515f
Whiteboard: [backed out]
Assignee: bmcbride → dtownsend+bugmail
https://hg.mozilla.org/mozilla-central/rev/d33742ea515f
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
Depends on: 788378
You need to log in before you can comment on or make changes to this bug.