If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

"ASSERTION: mDocElement not in doc?" if documentElement is removed during onload

RESOLVED FIXED in mozilla2.0b7

Status

()

Core
XML
RESOLVED FIXED
10 years ago
5 years ago

People

(Reporter: Jesse Ruderman, Assigned: philor)

Tracking

({assertion, intermittent-failure, testcase})

Trunk
mozilla2.0b7
assertion, intermittent-failure, testcase
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

10 years ago
Created attachment 269774 [details]
testcase that removes documentElement during onload

###!!! ASSERTION: mDocElement not in doc?: 'mDocument->IndexOf(mDocElement) != -1', file mozilla/content/xml/document/src/nsXMLContentSink.cpp, line 343
(Reporter)

Comment 1

10 years ago
Created attachment 269775 [details]
testcase that removes documentElement from an inline script

This triggers the assertion, too.

Comment 2

10 years ago
It seems to me that the assertion is bogus; that guarantee simply doesn't exist because of scripts like this one.  (XML parsing is still consistent even if the document tree is being modified as it is parsed.)
Created attachment 358507 [details]
another testcase

Here's another testcase (XHTML this time).
(Assignee)

Comment 4

7 years ago
And http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1285965566.1285966438.9435.gz says that reftest/tests/layout/svg/crashtests/385840-1.svg is another testcase.
(Assignee)

Comment 5

7 years ago
Created attachment 480355 [details] [diff] [review]
rm

I'm way out of my depth, but I think that the state of the code in 1.8,

317     if (mDocElement) {
318       // Notify document observers that all the content has been stuck
319       // into the document.
320       // XXX do we need to notify for things like PIs?  Or just the
321       // documentElement?
322       NS_ASSERTION(mDocument->IndexOf(mDocElement) != -1,
323                    "mDocElement not in doc?");
324 
325       mozAutoDocUpdate docUpdate(mDocument, UPDATE_CONTENT_MODEL, PR_TRUE);
326       mDocument->ContentInserted(nsnull, mDocElement,
327                                  // XXXbz is this last arg relevant if
328                                  // the container is null?
329                                  mDocument->IndexOf(mDocElement));
330     }

means that the assertion was related to notifying mDocument's observers about mDocElement, and not wanting to tell them about something that wasn't in their document, and so bogus or not it's no longer related to anything that's actually happening where it's being asserted.
Assignee: nobody → philringnalda
Status: NEW → ASSIGNED
Attachment #480355 - Flags: review?(bzbarsky)
(Assignee)

Updated

7 years ago
OS: Mac OS X → All
Hardware: x86 → All
Version: unspecified → Trunk
Comment on attachment 480355 [details] [diff] [review]
rm

r=me
Attachment #480355 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 7

7 years ago
Comment on attachment 480355 [details] [diff] [review]
rm

Tempting to claim I can just push this, since it's an orange fix and practically speaking NPOToptB.
Attachment #480355 - Flags: approval2.0?
(Assignee)

Updated

7 years ago
Whiteboard: [needs approval]
(Assignee)

Comment 8

7 years ago
http://hg.mozilla.org/mozilla-central/rev/cc874004357b
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [needs approval]
Target Milestone: --- → mozilla2.0b8
(Assignee)

Updated

7 years ago
Attachment #480355 - Flags: approval2.0?
(Assignee)

Comment 9

7 years ago
And http://hg.mozilla.org/mozilla-central/rev/891a83ede325 since I somehow failed to notice the annotation about how layout/xul/base/src/crashtests/321056-1.xhtml was yet another testcase for this.
(Reporter)

Updated

7 years ago
Blocks: 438871
Whiteboard: [orange]
Target Milestone: mozilla2.0b8 → mozilla2.0b7
Keywords: intermittent-failure
Whiteboard: [orange]
You need to log in before you can comment on or make changes to this bug.