Closed Bug 331117 Opened 18 years ago Closed 18 years ago

Layout module should not shut down until all documents have been released

Categories

(Core :: Layout, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8final

People

(Reporter: benjamin, Assigned: benjamin)

References

()

Details

(Keywords: fixed1.8.1)

Attachments

(3 files, 2 obsolete files)

The layout module currently shuts down services like nsContentUtils during the "xpcom-shutdown" phase, but it is possible to have documents outstanding after that point, due to module-shutdown sequencing and GC.

I want to keep a "module refcount" of outstanding document objects that would delay layout shutdown.
Attachment #215808 - Flags: superreview?(dbaron)
Attachment #215808 - Flags: review?(dbaron)
Blocks: 237736
I'm looking at perhaps backporting this to branches to solve issues like bug 237736.
Target Milestone: mozilla1.9alpha → mozilla1.8final
Priority: -- → P1
So the idea here is that this patch doesn't change anything but you'll do that in a later patch?
Attached patch Actually use it (obsolete) — Splinter Review
That was my original intent: but this is the only consumer I need at this time.
Attachment #217710 - Flags: superreview?(dbaron)
Attachment #217710 - Flags: review?(dbaron)
Update to trunk, and this also refcounts in globalwindow impls.
Attachment #215808 - Attachment is obsolete: true
Attachment #217710 - Attachment is obsolete: true
Attachment #217859 - Flags: superreview?(dbaron)
Attachment #217859 - Flags: review?(dbaron)
Attachment #215808 - Flags: superreview?(dbaron)
Attachment #215808 - Flags: review?(dbaron)
Attachment #217710 - Flags: superreview?(dbaron)
Attachment #217710 - Flags: review?(dbaron)
Blocks: 311332
Blocks: 337481
Comment on attachment 222092 [details] [diff] [review]
v1.1 updated to current trunk

This patch addresses the startup crash reported in bug 337481.
Raising severity here, because this seems to be the appropriate way to resolve 337481, which very much blocks testing on OS X right now.
Severity: normal → blocker
(Hunk 6 of nsLayoutModule.cpp's patch here conflicts for me now, likely easy to solve.)
I'm not going to remake this patch until I get agreement from dbaron on the general premise that I'm taking. 
The code inserted into dom/src/base/nsGlobalWindow.h bumps the comment and causes it to lose context.  Not intended, right?
Another solution to this bug might be to make Layout (and content) cancel all network requests and other asynchronous operations during shutdown.  That's typically how most consumers of necko behave.  Of course that doesn't help if someone else holds onto a document post xpcom-shutdown.
Comment on attachment 217859 [details] [diff] [review]
Layout shutdown refcountuing, rev. 1.1

I suppose with comment 11 fixed this is ok with me.  Although I'm a little concerned that nsAutoLayoutStatics might add to the size of the objects that use it -- have you tested whether it does so?  It might be better to just add to constructor/destructor.
Attachment #217859 - Flags: superreview?(dbaron)
Attachment #217859 - Flags: superreview+
Attachment #217859 - Flags: review?(dbaron)
Attachment #217859 - Flags: review+
Summary: Layout module should not shut down until all documents have been release → Layout module should not shut down until all documents have been released
Darin, the problem is that canceling the network connection at xpcom-shutdown is too late, since the OnStopRequest happens async sometime after that.  Hence my suggestion for a separate phase in shutdown for canceling anything async, with event processing after to make sure the notifications trigger...
Shutting down network requests early doesn't help in general, only in some specific cases.

Fixed on trunk, with the comment-move, and nsAutoLayoutStatics removed (it takes up a byte per-instance, because C++ pointer-to-members require it).
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
> Shutting down network requests early doesn't help in general, only in some
> specific cases.

Sure.  As in, all specific cases when anyone has a network connection open at shutdown.  As in, I feel we should do the network thing in addition to this patch.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060519 Minefield/3.0a1 ID:2006051905 [cairo]

is this check-in cause below?

on Exit/shutdown Minefield.
http://img253.imageshack.us/img253/7456/clear2og.jpg

History>Clear Private Data
this window is fine.
Attachment #229153 - Flags: review?(dbaron)
Attachment #229153 - Flags: approval1.8.1?
Comment on attachment 229153 [details] [diff] [review]
Merged to 1.8 branch

a=dbaron on behalf of drivers.  Please check in to MOZILLA_1_8_BRANCH and marked fixed1.8.1 when you have done so.
Attachment #229153 - Flags: review?(dbaron)
Attachment #229153 - Flags: review+
Attachment #229153 - Flags: approval1.8.1?
Attachment #229153 - Flags: approval1.8.1+
Fixed on 1.8 branch.
Keywords: fixed1.8.1
Blocks: 345157
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: