Closed Bug 819746 Opened 12 years ago Closed 8 years ago

nsNSSComponent makes bad assumptions about the XPCOM startup/shutdown sequence and how it is notified of various events

Categories

(Core :: Security: PSM, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: briansmith, Unassigned)

Details

+++ This bug was initially created as a clone of Bug #769288 +++

nsNSSComponent expects to be instantiated early during startup so it can receive the various XPCOM startup and shutdown profile-* events. However, we don't actually have any code that explicitly instantiates nsNSSComponent early to ensure that it receives all these events; it just happens to be instantiated early in a normal Gecko program indirectly through instantiating other components (the Secret Decoder Ring component and/or the networking components).

In bug 769288 comment 90 jdm observed that the test_httpauth.js test did not instantiate nsNSSComponent until after the XPCOM profile-change-net-teardown event was fired. This caused nsNSSComponent to complain "nsNSSComponent relies on profile manager to wait for synchronous shutdown of all network activity" in debug builds, due to an assertion in its profile-before-change observer code. (nsNSSComponent expected to receive the profile-change-net-teardown event, but that event was already sent before nsNSSComponent was even instantiated.)

We should change nsNSSComponent so that it stops assuming that it's profile-change-net-teardown code will be called.

One curious thing: StopCRLUpdateTimer() is called in response to profile-before-change, but the CRL update stuff is doing network I/O, so presumably StopCRLUpdateTimer() should be called in response to profile-change-net-teardown.
I also see this assertion in the try build mentioned in bug 61491 comment 154.
That assertion was removed (and nsNSSComponent no longer expects to receive a profile-change-net-teardown event). Also, StopCRLUpdateTimer no longer exists.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.