Closed Bug 318276 Opened 19 years ago Closed 19 years ago

Crash [@ nsXULDocument::LoadOverlay ]

Categories

(Core :: XUL, defect)

1.8 Branch
defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla1.8.1

People

(Reporter: Waldo, Assigned: Waldo)

References

()

Details

(4 keywords)

Crash Data

Attachments

(1 file, 1 obsolete file)

See testcase at URL and click the bottom button to get a crash; I'd attach it in the bug except that it would require two attachments instead of one. Basically, when an overlay load fails, nsXULDocument::LoadOverlay tries to remove the observer it added to the observer hashtable earlier. The observer was only added if aObserver wasn't nsnull, but the observer is unconditionally removed if the overlay load fails. Consequently, if you set up a situation where the overlay load will fail (such as when the overlay isn't found or a security exception occurs [the latter demo'd in the testcase]) and pass in a null observer you'll get a crash.
Attached patch Add a null-check (obsolete) — Splinter Review
Attachment #204531 - Flags: superreview?
Attachment #204531 - Flags: review?
Attachment #204531 - Flags: superreview?(jst)
Attachment #204531 - Flags: superreview?
Attachment #204531 - Flags: review?(jst)
Attachment #204531 - Flags: review?
I can confirm the crash. Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051130 Firefox/1.5 ID:2005113004
Flags: blocking1.8.1?
Flags: blocking1.8.0.1?
Comment on attachment 204531 [details] [diff] [review] Add a null-check - if (NS_FAILED(rv)) - mOverlayLoadObservers.Remove(uri); // remove the observer if LoadOverlayInternal generated an error + if (aObserver && NS_FAILED(rv)) + mOverlayLoadObservers.Remove(uri); // remove the observer if LoadOverlayInternal generated an error Seems like the more correct fix here would be to check if mOverlayLoadObservers is initialized (i.e. if (NS_FAILED(rv) && mOverlayLoadObserver.IsInitialized()) before trying to remove from it, not whether the observer is null. r+sr=jst with that change.
Attachment #204531 - Flags: superreview?(jst)
Attachment #204531 - Flags: superreview+
Attachment #204531 - Flags: review?(jst)
Attachment #204531 - Flags: review+
Attaching updated patch with reviews carried over...
Attachment #204531 - Attachment is obsolete: true
Attachment #205660 - Flags: superreview+
Attachment #205660 - Flags: review+
Comment on attachment 205660 [details] [diff] [review] Addresses comment This patch has been baking on trunk a couple days; to the best of my knowledge it hasn't introduced any new bugs. (Indeed, given the extremely small amount of code changed and the way in which it was changed I would be highly surprised if one had been introduced.) This is an obvious and simple patch to fix a crasher, so I think this should be in Firefox 1.5.0.1. Requesting approval...
Attachment #205660 - Flags: approval1.8.0.1?
Let's bake a couple more days on the trunk and then consider for 1.8.0.1.
Comment on attachment 205660 [details] [diff] [review] Addresses comment a=dveditz for drivers. Please land on both 1.8.0.1 and 1.8.1 branches, and add the appropriate "fixed" keywords when checked-in.
Attachment #205660 - Flags: approval1.8.1+
Attachment #205660 - Flags: approval1.8.0.1?
Attachment #205660 - Flags: approval1.8.0.1+
Flags: blocking1.8.1?
Flags: blocking1.8.1+
Flags: blocking1.8.0.1?
Flags: blocking1.8.0.1+
1_8: mozilla/content/xul/document/src/nsXULDocument.cpp; new revision: 1.664.2.6; 1_8_0: mozilla/content/xul/document/src/nsXULDocument.cpp; new revision: 1.664.2.5.2.1;
Target Milestone: mozilla1.9alpha → mozilla1.8.1
Version: Trunk → 1.8 Branch
verified fixed on the branching using Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1. Clicking on the bottom button in the URL cited does not produce a crash.
Verified FIXED using Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20060111 Firefox/1.5 and the testcase on Jeff's web site. (Also doesn't crash in a branch build from today.)
Status: RESOLVED → VERIFIED
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
Summary: Crash [ @ nsXULDocument::LoadOverlay ] → Crash [@ nsXULDocument::LoadOverlay ]
Crash Signature: [@ nsXULDocument::LoadOverlay ]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: