Closed Bug 369560 Opened 18 years ago Closed 17 years ago

###!!! ASSERTION: *** XBL doc with no root element! Something went horribly wrong! ***: 'Error', file m:/trunk/mozilla/content/xbl/src/nsXBLService.cpp, line 417

Categories

(Core :: XBL, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: WeirdAl, Assigned: WeirdAl)

References

()

Details

(Keywords: assertion, testcase)

Attachments

(4 files)

Attached file stack trace
I hit this assertion visiting the URL above.  Firefox 1.9a2 (frozen code, not off the release), Windows.
How interesting.  At nsXBLStreamListener::Load(nsIDOMEvent * aEvent=0x04bb4738)  Line 417 + 0x1c bytes	C++, we have the following for documentURI->mSpec:

+		mData	0x080e5bc8 "http://static.technorati.com/css/moz-text-overflow.xml"	char *

The XML file referenced is a 404.


This assertion is bogus.  There are all sorts of reasons an XML document could have no root element.  I think we should just remove the assert.
Agreed, though we should keep it as a warning since this usually shouldn't happen.
Attached patch patch, v1Splinter Review
per comment 3, NS_ERROR -> NS_WARNING
Assignee: general → ajvincent
Status: NEW → ASSIGNED
Attachment #254319 - Flags: superreview?
Attachment #254319 - Flags: review?
Attachment #254319 - Flags: superreview?(jonas)
Attachment #254319 - Flags: superreview?
Attachment #254319 - Flags: review?(jonas)
Attachment #254319 - Flags: review?
Attachment #254319 - Flags: superreview?(jonas)
Attachment #254319 - Flags: superreview+
Attachment #254319 - Flags: review?(jonas)
Attachment #254319 - Flags: review+
Whiteboard: [checkin needed]
mozilla/content/xbl/src/nsXBLService.cpp  1.22
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Why was this marked in-testsuite-?
Because I thought that *absence* of bogus assertion is not something worth testing.
Testing that invalid docs don't assert seem like a good thing to me.
OK then, I'll ask sayrer if there's a way to test for assertions yet. BTW XBL code has lots of NS_ERRORS for malformed content, I hit three when making a testcase.
Flags: in-testsuite- → in-testsuite?
For the reference, I talked to sayrer a while ago and he said the test harnesses don't currently support testing for assertions and it's not a top priority.

I filed bug 370767 for that, but we might want to just check a simple testcase in and hope that developers will run the test suite in debug builds with assertions not suppressed :)
Here's the test I had in my tree, sorry it's not in the patch format - CVS sucks for making it hard to make patches that add new directories. If anyone thinks it should be checked in, feel free to r+ :)
FWIW, we trigger this warning when running layout/style mochitests, e.g. in this tbpl log:
 https://tbpl.mozilla.org/php/getParsedLog.php?id=10222026&tree=Firefox

{
11722 INFO TEST-PASS | /tests/layout/style/test/test_ch_ex_no_infloops.html | Setting 'text-rendering' to '2ch' should not cause infinite loop - auto should not equal
WARNING: *** XBL doc with no root element! Something went horribly wrong! ***: file ../../../../content/xbl/src/nsXBLService.cpp, line 405
11723 INFO TEST-END | /tests/layout/style/test/test_ch_ex_no_infloops.html | finished in 1434ms
}

It frightened me a little when I first noticed it locally (thought I might've broken something), due to the asterisks and the "horribly wrong". Given comment 2 & comment 3 here, we could probably stand to soften the language a bit. :)
Attached patch followupSplinter Review
Here's a followup to make this less scary sounding.

Basically just s/Something went horribly wrong/this usually shouldn't happen/ based on comment 3.
Attachment #607787 - Flags: review?(bzbarsky)
Comment on attachment 607787 [details] [diff] [review]
followup

r=me
Attachment #607787 - Flags: review?(bzbarsky) → review+
(Sorry, the DestroyFrom chunk in this patch is clearly unrelated -- I'll remove that before landing)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: