Closed Bug 606320 Opened 14 years ago Closed 14 years ago

[Exception... "An invalid or illegal string was specified" code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)" location: "chrome://browser/content/aboutHome.js Line: 167"]

Categories

(Firefox :: General, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 4.0b8
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: marcia, Assigned: mak)

References

Details

(Whiteboard: [about-home])

Attachments

(1 file, 1 obsolete file)

Seen in the error console while running Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101021 Firefox/4.0b8pre with a clean profile.

Error: uncaught exception: [Exception... "An invalid or illegal string was specified"  code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)"  location: "chrome://browser/content/aboutHome.js Line: 167"]
Did you use anything that could have assigned snippets to the page? that path should be untouched till we have snippets online (on the other side looks like http://snippets.mozilla.com is now alive).
Regardless what happens, we should probably make the code robust against broken snippets, by using the default ones in case innerHTML fails.
Assignee: nobody → mak77
blocking2.0: --- → ?
yeah this must be the fact snippets website is now live
I got this error when creating a new profile.
In a debug build, right before the error, I see:

XML Parsing Error: XML or text declaration not at start of entity
Location: 
Line Number 1, Column 171:
<html xmlns="http://www.w3.org/1999/xhtml"><body xmlns="http://www.w3.org/1999/xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><?xml version="1.0" encoding="utf-8"?>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------^


The stack with which this error is printed is:

#1  nsExpatDriver::HandleError (this=0x1b5c620)
    at /home/dbaron/builds/mozilla-central/mozilla/parser/htmlparser/src/nsExpatDriver.cpp:935
#2  0x00007ffff4e58fd7 in nsExpatDriver::ConsumeToken (this=0x1b5c620, 
    aScanner=<value optimized out>, aFlushTokens=<value optimized out>)
    at /home/dbaron/builds/mozilla-central/mozilla/parser/htmlparser/src/nsExpatDriver.cpp:1169
#3  0x00007ffff4e6ddbd in nsParser::Tokenize (this=0x1b5be00, aIsFinalChunk=0)
    at /home/dbaron/builds/mozilla-central/mozilla/parser/htmlparser/src/nsParser.cpp:3090
#4  0x00007ffff4e7230d in nsParser::ResumeParse (this=0x1b5be00, 
    allowIteration=<value optimized out>, aIsFinalChunk=0, aCanInterrupt=0)
    at /home/dbaron/builds/mozilla-central/mozilla/parser/htmlparser/src/nsParser.cpp:2322
#5  0x00007ffff4e74877 in nsParser::Parse (this=<value optimized out>, 
    aSourceBuffer=..., aKey=0x7fffffffade0, aMimeType=<value optimized out>, 
    aLastCall=0, aMode=eDTDMode_full_standards)
    at /home/dbaron/builds/mozilla-central/mozilla/parser/htmlparser/src/nsParser.cpp:2115
#6  0x00007ffff4e73ca4 in nsParser::ParseFragment (this=0x1b5be00, 
    aSourceBuffer=<value optimized out>, aKey=<value optimized out>, 
    aTagStack=..., aXMLMode=<value optimized out>, 
    aMimeType=<value optimized out>, aMode=eDTDMode_full_standards)
    at /home/dbaron/builds/mozilla-central/mozilla/parser/htmlparser/src/nsParser.cpp:2231
#7  0x00007ffff52492d3 in nsContentUtils::CreateContextualFragment (
    aContextNode=<value optimized out>, aFragment=<value optimized out>, 
    aWillOwnFragment=<value optimized out>, aReturn=<value optimized out>)
    at /home/dbaron/builds/mozilla-central/mozilla/content/base/src/nsContentUtils.cpp:4046
#8  0x00007ffff541adf1 in nsGenericHTMLElement::SetInnerHTML (this=0x19230a0, 
    aInnerHTML=<value optimized out>)
    at /home/dbaron/builds/mozilla-central/mozilla/content/html/content/src/nsGenericHTMLElement.cpp:771
#9  0x00007ffff5c35630 in nsIDOMNSHTMLElement_SetInnerHTML (cx=0x14f18f0, 
    obj=<value optimized out>, id=..., vp=0x7fffffffbac0)
    at dom_quickstubs.cpp:21374
Attached patch patch v1.0 (obsolete) — Splinter Review
this also includes a change for bug 606508, I did not split them because code is clean enough and did not want to add further spam to you review queue.

I'm using an early return here, if you prefer I could refactor default snippets showing in a separate function and call it in the catch and else.
Attachment #486034 - Flags: review?(gavin.sharp)
Flags: in-testsuite?
Blocks: 606508
blocking2.0: ? → betaN+
Whiteboard: [needs review]
Comment on attachment 486034 [details] [diff] [review]
patch v1.0

>diff --git a/browser/base/content/aboutHome.js b/browser/base/content/aboutHome.js

>+    // Injecting snippets code can throw in case it's invalid xml.

nit: "Injecting snippets can throw if they're invalid XML"
Attachment #486034 - Flags: review?(gavin.sharp) → review+
Attached patch patch v1.1Splinter Review
Attachment #486034 - Attachment is obsolete: true
Whiteboard: [needs review] → [can land]
http://hg.mozilla.org/mozilla-central/rev/97df3b563c5c
Status: NEW → RESOLVED
Closed: 14 years ago
Flags: in-testsuite? → in-testsuite+
Resolution: --- → FIXED
Whiteboard: [can land]
Target Milestone: --- → Firefox 4.0b8
Whiteboard: [about-home]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: