Closed
Bug 922814
Opened 12 years ago
Closed 12 years ago
nsIAppStartup.shuttingDown is reset to false during shutdown
Categories
(Toolkit :: Startup and Profile System, defect)
Tracking
()
RESOLVED
FIXED
mozilla27
People
(Reporter: smacleod, Assigned: Yoric)
References
Details
(Whiteboard: [Async Shutdown])
Attachments
(1 file, 1 obsolete file)
916 bytes,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
Both nsAppExitEvent (http://mxr.mozilla.org/mozilla-central/source/toolkit/components/startup/nsAppStartup.cpp#111 ) and nsAppStartup::Quit (http://mxr.mozilla.org/mozilla-central/source/toolkit/components/startup/nsAppStartup.cpp#459 ) reset nsIAppStartup.shuttingDown to false when the application is definitely shutting down.
This causes problems for any code relying on |shuttingDown| which is still executing after the flag is reset, such as the final session store file write - see Bug 922785
Assignee | ||
Comment 1•12 years ago
|
||
Looking at the source code of nsAppStartup.cpp, it is not quite clear why we set |mShuttingDown = false|. There is a comment "turn off the reentrancy check flag" that makes me wary of getting rid of all occurrences of |mShuttingDown = false|.
Ehsan, since you are the author of one of these occurrences, could you tell us whether you think we would be breaking something?
Flags: needinfo?(ehsan)
Comment 2•12 years ago
|
||
(In reply to David Rajchenbach Teller [:Yoric] from comment #1)
> Ehsan, since you are the author of one of these occurrences, could you tell
> us whether you think we would be breaking something?
Did you look at the change I made there? :-) I just replaced PR_FALSE with false across our code base, I don't know anything about this code.
Flags: needinfo?(ehsan)
Comment 3•12 years ago
|
||
(Note that getting useful blames for the code often involves looking at the actual changes and blaming on the parent revisions if the changes do not seem to match what you're looking for.)
Assignee | ||
Comment 4•12 years ago
|
||
Oops :)
Hey, look what I found – that piece of code was written by a certain bsmedberg, a long time ago, in a galaxy far far away: https://github.com/jrmuizel/mozilla-cvs-history/commit/3055933c278e6a315788ee06fade12ac152a0159
Assignee | ||
Comment 5•12 years ago
|
||
Let's see if we break something: https://tbpl.mozilla.org/?tree=Try&rev=2000dc9f298d
Reporter | ||
Comment 6•12 years ago
|
||
Comment on attachment 812842 [details] [diff] [review]
Once the application is shutting down, it remains shutting down until there is no more application
Review of attachment 812842 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/startup/nsAppStartup.cpp
@@ -456,5 @@
>
> - // turn off the reentrancy check flag, but not if we have
> - // more asynchronous work to do still.
> - if (!postedExitEvent)
> - mShuttingDown = false;
After looking at this again, this case should probably be left in. We only reset |mShuttingDown| here when |!postedExitEvent|, so we aren't actually shutting down right now from this call to nsAppStartup::Quit.
I suspect the culprit for the unexpected reset is just that other case you removed.
Assignee | ||
Comment 7•12 years ago
|
||
I'm not quite clear. It's the nsAppExitEvent that used to reset mShuttingDown to false. The snippet you mention performs the reset even if for some reason we haven't posted that event.
Assignee | ||
Updated•12 years ago
|
Attachment #812842 -
Flags: review?(benjamin)
Updated•12 years ago
|
Assignee: nobody → dteller
Comment 8•12 years ago
|
||
Comment on attachment 812842 [details] [diff] [review]
Once the application is shutting down, it remains shutting down until there is no more application
smacleod is correct. The hunk at the bottom of nsAppStartup::Quit needs to stay in so that if we are using eConsiderQuit or eAttemptQuit and we decided *not* to quit that the flag reverts to its normal false state.
Attachment #812842 -
Flags: review?(benjamin) → review-
Assignee | ||
Comment 9•12 years ago
|
||
In that case, here we go.
Attachment #812842 -
Attachment is obsolete: true
Attachment #814871 -
Flags: review?(benjamin)
Assignee | ||
Updated•12 years ago
|
Whiteboard: [Async Shutdown]
Updated•12 years ago
|
Attachment #814871 -
Flags: review?(benjamin) → review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 10•12 years ago
|
||
Keywords: checkin-needed
Whiteboard: [Async Shutdown] → [Async Shutdown][fixed-in-fx-team]
Comment 11•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [Async Shutdown][fixed-in-fx-team] → [Async Shutdown]
Target Milestone: --- → mozilla27
You need to log in
before you can comment on or make changes to this bug.
Description
•