Closed Bug 53358 Opened 25 years ago Closed 25 years ago

[FIX IN HAND] crash in FindPreviousAnonymousSibling (nsCSSFrameConstructor.cpp)

Categories

(Core :: Layout, defect, P1)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: Bienvenu, Assigned: attinasi)

References

Details

(Keywords: crash, Whiteboard: [nsbeta3++][PDTP1])

Attachments

(3 files)

I crash in FindPreviousAnonymousSibling (nsCSSFrameConstructor.cpp) occasionally when selecting the subject text frame after entering an e-mail address, because xblDoc is null. I don't know why xblDoc is null, but checking for null fixes the crash, and if I continue in the debugger, I don't run into any more problems. I'll attach the proposed fix next.
rods says this is marc's area, and that waterson and steve would be doing code review, so reassigning and cc'ing as appropriate.
Assignee: clayton → attinasi
I cannot reproduce the problem, and I've been using Netscape6 Mail and Mozilla Mail exclusively for days now... The fix looks good, however, and I can see no reason to NOT check for null. In fact, I'd check for null on the doc too, before the QI for xblDoc, since it is not guaranteed that the aContainer content will have a doc (or if it is, then at least assert it). Accepting: hopefully this can be reproduced, but if not, the code cleanup patch is good anyway (safer).
Status: NEW → ASSIGNED
Target Milestone: --- → M19
It's not easy to recreate - I suspect it is partly caused by the address completion widget trying to pop up at the wrong time. The larger your history address book is, the slower this will be. If you've only been running for a few days, your history address book will be puny :-) I've seen this crash in talback logs, so other people have seen this.
without knowing the code, it seems odd that your patch returns null in the first case if the xbldoc is null, and in the second case you don't return. cvs blame points to hyatt for this code. run it by him, and if it's ok with him, r=buster.
Updating some keyword fields to get this on the nsbeta3 radar
Keywords: crash, nsbeta3, patch
Summary: crash in FindPreviousAnonymousSibling (nsCSSFrameConstructor.cpp) → [FIX IN HAND] crash in FindPreviousAnonymousSibling (nsCSSFrameConstructor.cpp)
I think that either case will return null, the first one returns null directly, and the second causes the bulk of the method to be skipped and nextSibling is returned, which will be the initial value of null. It would probably be best to do the same fix in both cases, and I prefer the second approach. I'll attach another patch that treats the two cases the same, and also checks for a null document.
Steve, I don't need to return in the second case because nodeList will remain null, and we'll fall through to the end of the routine.
It seems very odd that the document would be null. It shouldn't be possible for us to notify the front end about an element that isn't even in the document. I think there's a deeper problem here. The null checks are great and will bypass the crash, but I'm a bit concerned about how we got into this situation in the first place.
Could this be related to joki's hover stuff? It also causes a crash in which there's an element with no document. He has an nsbeta3+ bug on this: crash in mailcompose.
hyatt: how about we check in the patch as a stability enhancement, but leave this bug open to find out how we got the null document. If that research points towards joki's bug, great. But if not, we'll have this to track the issue. If it's useful, the patch could be augmented by adding asserts when we get a null xbl doc. If it can't be null, the assert should be there anyway.
This sounds great to me. For reference, joki's bug is 53219. It looks suspiciously similar to me.
Yea, bug 53219 sure looks like the same problem. Marking dependent, but still want to check in this patch (actually, a new one with assertions - coming).
Depends on: 53219
*** Bug 53408 has been marked as a duplicate of this bug. ***
Marking nsbeta3+ P1.
Priority: P3 → P1
Whiteboard: [nsbeta3+]
PDT agrees P1
Whiteboard: [nsbeta3+] → [nsbeta3+][PDTP1]
a=buster
*** Bug 54039 has been marked as a duplicate of this bug. ***
upgrading the severity of this bug.
Severity: normal → major
marking nsbeta3++ per email with pdt.
Whiteboard: [nsbeta3+][PDTP1] → [nsbeta3++][PDTP1]
OK - I'll be checking it in on the branch as soon as my branch-build is done and the tree is open.
OS: Windows NT → All
Hardware: PC → All
*** Bug 53851 has been marked as a duplicate of this bug. ***
Fix checked into branch.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Checked into trunk too, for good measure.
great! I'll try out for mail in tomorrow's build.
Mail cases mentioned in bug 53408 and bug 53851 work for me using sept27 mn6 commercial branch builds, mac OS 9.0, NT 4.0 and linux rh6.0
Marking verfied per last comments.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: