Closed Bug 782881 Opened 10 years ago Closed 10 years ago

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


(Toolkit :: Add-ons Manager, defect)

Not set





(Reporter: Unfocused, Assigned: mossop)




(1 file)

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
Attached patch Patch v2Splinter Review
Patch from bug 671894. Carrying over review, as all I did was fix the bitrot.
Attachment #652020 - Flags: review+
Bah, backed out thanks to orange on *everything* for debug builds (opt builds are all fine):

Seeing this everywhere:

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

That seems to be happening on shutdown.

Example logs:
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.
Assignee: bmcbride → dtownsend+bugmail
Closed: 10 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.