Closed
Bug 336999
Opened 19 years ago
Closed 18 years ago
Crash involving XUL menus, position: fixed, position: absolute [@ nsIFrame::GetNextSibling] [@ nsCSSFrameConstructor::FindFrameWithContent]
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
VERIFIED
FIXED
People
(Reporter: jruderman, Assigned: alfred.peng)
References
Details
(4 keywords, Whiteboard: [sg:critical] caused 341047)
Crash Data
Attachments
(4 files, 1 obsolete file)
(deleted),
application/vnd.mozilla.xul+xml
|
Details | |
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
neil
:
review+
bzbarsky
:
superreview+
dveditz
:
approval1.8.0.7+
mtschrep
:
approval1.8.1+
|
Details | Diff | Splinter Review |
(deleted),
text/plain
|
Details |
#0 0x073e7a9c in nsIFrame::GetNextSibling (this=0xdddddddd) at /Users/admin/trunk/mozilla/layout/base/../generic/nsIFrame.h:676
this=0xdddddddd means we're playing with deleted memory, so this is probably a security hole.
Reporter | ||
Comment 1•19 years ago
|
||
Reporter | ||
Comment 2•19 years ago
|
||
You'll probably need a debug build to reproduce the crash. I was able to reproduce reliably with a debug build but not at all with a nightly.
Whiteboard: [sg:critical]
Reporter | ||
Comment 3•19 years ago
|
||
Reporter | ||
Updated•19 years ago
|
Flags: blocking1.9a1?
Reporter | ||
Comment 4•19 years ago
|
||
Before I reduced this, it crashed at nsCSSFrameConstructor::FindFrameWithContent instead, with kidContent == (nsIContent *) 0xdddddddd.
Summary: Crash [@ nsIFrame::GetNextSibling] involving XUL menus, position: fixed, position: absolute → Crash involving XUL menus, position: fixed, position: absolute [@ nsIFrame::GetNextSibling] [@ nsCSSFrameConstructor::FindFrameWithContent]
Comment 5•19 years ago
|
||
Also see this in Windows XP.
OS: Mac OS X 10.4 → All
Hardware: Macintosh → PC
Reporter | ||
Updated•19 years ago
|
Hardware: PC → All
Assignee | ||
Comment 6•19 years ago
|
||
The "child->Destroy" will invoke function on the child frames in LineBox list again. If there're not only one child frames in the list, some child frames will have been destroyed at that time. Then comes the released memory access, which causes the crash. So I think we should destroy the LineBox list first.
I'm not quite sure whether the patch is the right direction. roc, do you have any comments?
I don't think this is the right patch. This will cause the frame(s) to not be found, so they won't be cleaned up properly.
The basic problem here is that nsMenuFrame is setting an attribute which triggers a restyle during frame destruction. That is REALLY bad. Restyles are usually delayed until later (which would make this OK) but it's done synchronously here:
http://lxr.mozilla.org/seamonkey/source/layout/base/nsCSSFrameConstructor.cpp#10778
specially for menus :-(
You might want to change that nsCSSFrameConstructorCode to not happen if the attribute is menugenerated and the attribute has been removed.
Assignee | ||
Comment 9•19 years ago
|
||
Patch v2 based on Roc's comments.
Roc, do I catch your idea by this patch?
Is this bug related to bug 279769? To fix that one, nsMenuFrame::UngenerateMenu was added to the Destroy function to get rid of the Menu. I've run the testcase for that one. No regression.
Attachment #221702 -
Attachment is obsolete: true
Attachment #221802 -
Flags: review?(roc)
Attachment #221702 -
Flags: review?(roc)
I think this is OK as a hack fix. The non-hack fix is probably to restructure XUL menu popups completely, which is a big project.
CCing Boris and Neil though since they know this code better than I.
Comment 11•19 years ago
|
||
Hmm... This might be ok, yes. Please check all testcase in the various bugs that are mentioned in the CVS blame there, going back to when async restyling landed; if all those pass this is fine. ;)
And yes, what we really need to do is to stop changing the DOM from frame code.
Assignee | ||
Comment 12•19 years ago
|
||
Comment on attachment 221802 [details] [diff] [review]
Patch v2
As bz pointed out, I tracked back to the bug 230170.
I divide all the bug fixes from that bug till now to the following categories:
1. Bugs causes crash & Hang. Run the testcases on Solaris, work well with the patch.
2. Standard-compatibility bugs(CSS standard etc.). Run the testcase on Solaris on two different builds: with and without this patch and compare the results. The results are the same.
3. SVG related bugs. Run the testcases on Fedora, work well with the patch.
4. Performance and function improvement bugs. No testcases.
Besides the above bugs, there are several bugs I suspect to have regression on the trunk, even without the patch(run on Solaris):
1. bug 3247(attachment 179566 [details])
2. bug 266968(attachment 164045 [details])
3. bug 271422(attachment 167944 [details])
bz, can this patch be reviewed now?
Attachment #221802 -
Flags: superreview?(bzbarsky)
Comment 13•19 years ago
|
||
Comment on attachment 221802 [details] [diff] [review]
Patch v2
Er... So what I _meant_ was to test the 2-3 bugs that actually added this sync code and modified it since. Those bugs fit in none of your categories that I can see. Things like bug 262031, for example. Or bug 279308. And so on.
Just look at the blame for this little chunk of code, going back to when it was first checked in, and check those bugs. If all those work, sr=bzbarsky.
Attachment #221802 -
Flags: superreview?(bzbarsky) → superreview+
Assignee | ||
Comment 14•19 years ago
|
||
(In reply to comment #13)
> (From update of attachment 221802 [details] [diff] [review] [edit])
> Er... So what I _meant_ was to test the 2-3 bugs that actually added this sync
> code and modified it since. Those bugs fit in none of your categories that I
> can see. Things like bug 262031, for example. Or bug 279308. And so on.
>
These two bugs don't regress with the patch. I classify them into category 2.:)
> Just look at the blame for this little chunk of code, going back to when it was
> first checked in, and check those bugs. If all those work, sr=bzbarsky.
>
Besides the above two, the following bugs are also related: bug 282792, bug 288365, bug 281957. No testcases for them. Category 4.
Assignee | ||
Comment 15•19 years ago
|
||
Comment on attachment 221802 [details] [diff] [review]
Patch v2
As roc recommended in comments #10, ask neil for review.
Attachment #221802 -
Flags: review?(roc) → review?(neil)
Comment 16•19 years ago
|
||
Comment on attachment 221802 [details] [diff] [review]
Patch v2
Whatever... I have no prospect of knowing layout well enough to know why there isn't some other way that menupopups can be synchronously generated.
Attachment #221802 -
Flags: review?(neil) → review+
Assignee | ||
Comment 17•19 years ago
|
||
Checking in layout/base/nsCSSFrameConstructor.cpp;
/cvsroot/mozilla/layout/base/nsCSSFrameConstructor.cpp,v <-- nsCSSFrameConstructor.cpp
new revision: 1.1231; previous revision: 1.1230
done
Assignee | ||
Comment 18•18 years ago
|
||
=> Fixed
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Comment 19•18 years ago
|
||
Same crash on the 1.8 branches
Flags: blocking1.8.1?
Flags: blocking1.8.0.6?
Updated•18 years ago
|
Flags: blocking1.8.1? → blocking1.8.1+
Assignee | ||
Updated•18 years ago
|
Attachment #221802 -
Flags: approval1.8.1?
Updated•18 years ago
|
Attachment #221802 -
Flags: approval1.8.1? → approval1.8.1+
Assignee | ||
Comment 20•18 years ago
|
||
Checking in nsCSSFrameConstructor.cpp;
/cvsroot/mozilla/layout/base/nsCSSFrameConstructor.cpp,v <-- nsCSSFrameConstructor.cpp
new revision: 1.1110.6.37; previous revision: 1.1110.6.36
done
Assignee | ||
Updated•18 years ago
|
Keywords: fixed1.8.1
Updated•18 years ago
|
Flags: blocking1.8.0.6? → blocking1.8.0.6+
Assignee | ||
Comment 21•18 years ago
|
||
With the patch applied to MOZILLA_1_8_0_BRANCH, Firefox still crashes for the testcase. And the core stack is different.
I also get the following assertion:
###!!! ASSERTION: We don't support out-of-flow kids: '!aListName', file nsBoxFrame.cpp, line 1164
Break: at file nsBoxFrame.cpp, line 1164
###!!! ASSERTION: Must have frame for destination coordinate system!: 'aOther', file nsFrame.cpp, line 2359
Break: at file nsFrame.cpp, line 2359
###!!! ASSERTION: No view on any parent? How did that happen?: 'Not Reached', file nsFrame.cpp, line 4320
Break: at file nsFrame.cpp, line 4320
Comment 22•18 years ago
|
||
That crash is bug 253479 (fixed on 1.8, but not 1.8.0 yet).
Assignee | ||
Comment 23•18 years ago
|
||
I think we'd better wait for that bug fixed in 1.8.0.6 first.
Comment 24•18 years ago
|
||
That bug is a null-dereference. This bug is a deleted-memory reference. So we should fix this even though we still crash -- at least we crash more safely.
Assignee | ||
Comment 25•18 years ago
|
||
Comment on attachment 221802 [details] [diff] [review]
Patch v2
This is also a potential security bug for 1.8.0 branch. And the patch has been in trunk and 1.8 branch for some time not causing problem till now.
Attachment #221802 -
Flags: approval1.8.0.6?
Comment 26•18 years ago
|
||
Comment on attachment 221802 [details] [diff] [review]
Patch v2
approved for 1.8.0 branch, a=dveditz for drivers
Attachment #221802 -
Flags: approval1.8.0.7? → approval1.8.0.7+
Assignee | ||
Comment 27•18 years ago
|
||
Checking in layout/base/nsCSSFrameConstructor.cpp;
/cvsroot/mozilla/layout/base/nsCSSFrameConstructor.cpp,v <-- nsCSSFrameConstructor.cpp
new revision: 1.1110.6.12.2.19; previous revision: 1.1110.6.12.2.18
done
=> Land on 1.8.0 branch.
Keywords: fixed1.8.0.7
Comment 28•18 years ago
|
||
https://bugzilla.mozilla.org/attachment.cgi?id=221170
ff2b2 windows, linux, macppc no crash, macppc does not show the select box though...
ff2b2 debug windows, linux no crash
###!!! ASSERTION: We don't support out-of-flow kids: '!aListName', file f:/work/mozilla/builds/ff/2.0/mozilla/layout/xul/base/src/nsBoxFrame.cpp, line 1164
Keywords: fixed1.8.1 → verified1.8.1
Comment 29•18 years ago
|
||
Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.7pre) Gecko/20060821 Firefox/1.5.0.7pre
https://bugzilla.mozilla.org/attachment.cgi?id=221170&action=view, no crash.
verified 1.8.0.7
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.0.7 → verified1.8.0.7
Updated•18 years ago
|
Whiteboard: [sg:critical] → [sg:critical] caused 341047
Updated•17 years ago
|
Group: security
Flags: in-testsuite?
Updated•17 years ago
|
Flags: blocking1.9a1?
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
Updated•13 years ago
|
Crash Signature: [@ nsIFrame::GetNextSibling]
[@ nsCSSFrameConstructor::FindFrameWithContent]
You need to log in
before you can comment on or make changes to this bug.
Description
•