Closed Bug 193847 Opened 23 years ago Closed 23 years ago

crash with "pure virtual method called" on Javascript DOM modification

Categories

(Core :: DOM: Core & HTML, defect, P1)

x86
All
defect

Tracking

()

RESOLVED FIXED
mozilla1.3final

People

(Reporter: robinson, Assigned: dbaron)

References

()

Details

(Keywords: crash, regression, Whiteboard: [patch] fixed1.3)

Attachments

(2 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210 On the page <http://research.salutia.com/tiki/tiki-view_faq.php?faqId=1>, clicking the "show comments" link at the bottom immediately crashes the browser with "pure virtual method called", and no talkback window. Reproducible: Always Steps to Reproduce: See details. Actual Results: Immediate crash with "pure virtual method called". Expected Results: Show comments.
Attached file stacktrace
==> DOM0 (?) marking NEW
Assignee: asa → jst
Status: UNCONFIRMED → NEW
Component: Browser-General → DOM Level 0
Ever confirmed: true
Keywords: crash
QA Contact: asa → ashishbhatt
regression between 2003010805 and 2003010905
Keywords: regression
Actaully, it regressed between 2003010821 and 2003010905 In that range, there's bryner's checkin to deCOMify stylecontext. The code that's most likely dying in nsElementSH::PostCreate is: 4575 const nsStyleDisplay* display; 4576 pctx->ResolveStyleContextAndGetStyleData(content, eStyleStruct_Display, 4577 (const nsStyleStruct*&) display); 4578 NS_ENSURE_TRUE(display, NS_ERROR_UNEXPECTED); 4579 4580 if (display->mBinding.IsEmpty()) { Maybe we're getting garbage out for "display"?
ResolveStyleContextAndGetStyleData is broken. One needs to hold on to the style context while using the data. We should probably just remove the method.
Well, then we have a few options: 1) link all this code in with layout so it can use nsIStyleContext 2) Go back to using computed style (with the resulting perf hit) 3) Make the method clearly XBL-specific since this is the only user. eg, on nsIPresContext: NS_IMETHOD HasXBLBinding(nsIContent* aContent, PRBool* aHasBinding); I like #3 myself, as a short-term measure....
Confirmed with build 2003021008 under Windows XP SP1. Talkback ID: TB17296928Z
*** Bug 194181 has been marked as a duplicate of this bug. ***
OS: Linux → All
Is this something we're likely to run into a lot in the real world? Should this block 1.3?
I'm surprised it's not come up more than it has -- we're basically reading potentially garbage memory on some-to-all element creations. If bryner has absolutely no time for this, I can try to whip up a patch... (but I'm really swamped with trying to not fail a class or two right now, so I really mean _absolutely_ no time).
Flags: blocking1.3?
I can take it.
Priority: -- → P1
Whiteboard: [patch]
Target Milestone: --- → mozilla1.3final
er, really
Assignee: jst → dbaron
Attached patch patch (obsolete) — Splinter Review
(I haven't tested this yet, since it's still recompiling.)
Attached patch patchSplinter Review
Correct comment; remove extra whitespace.
Attachment #115278 - Attachment is obsolete: true
Attachment #115280 - Flags: superreview?(bzbarsky)
Attachment #115280 - Flags: review?(bzbarsky)
Comment on attachment 115280 [details] [diff] [review] patch >+ nsCOMPtr<nsIStyleContext> sc; >+ nsresult rv = ResolveStyleContextFor(aContent, nsnull, getter_AddRefs(sc)); >+ NS_ENSURE_SUCCESS(rv, rv); That should be (as of bryner's landing today): nsRefPtr<nsStyleContext> sc = ResolveStyleContextFor(aContent, nsnull); NS_ENSURE_SUCCESS(sc, NS_ERROR_FAILURE); r+sr=bzbarsky with that change.
Attachment #115280 - Flags: superreview?(bzbarsky)
Attachment #115280 - Flags: superreview+
Attachment #115280 - Flags: review?(bzbarsky)
Attachment #115280 - Flags: review+
shouldn't that be NS_ENSURE_TRUE rather than _FAILURE? |sc| is a pointer, not a nsresult...
I wrote this patch in a 1.3-branch tree, but when I move it to the trunk I'll do that.
er, yes. I was thinking NS_ENSURE_TRUE and writing NS_ENSURE_SUCCESS... ;)
Attachment #115280 - Flags: approval1.3? → approval1.3+
Fix checked in to trunk, 2003-02-23 09:20 PST. Fix checked in to MOZILLA_1_3_BRANCH, 2003-02-24 13:16 PST.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Flags: blocking1.3?
*** Bug 195763 has been marked as a duplicate of this bug. ***
Whiteboard: [patch] → [patch] fixed1.3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: