Open Bug 1206403 Opened 9 years ago Updated 2 years ago

Unhelpful error message "not well-formed 1:1"

Categories

(DevTools :: Debugger, defect, P3)

43 Branch
defect

Tracking

(firefox43 affected)

Tracking Status
firefox43 --- affected

People

(Reporter: jujjyl, Unassigned)

References

Details

(Whiteboard: [polish-backlog][gaming-tools])

Attachments

(2 files)

Attached file not_well_formed.tar.gz
STR: Open attached not_well_formed.html.

Observed: Web console says error "not well-formed not_well_formed.js:1:1". The file:line points to the first line of the .js file, which is a comment as follows:

"// The Module object: Our interface to the outside world. We import"

What is not well-formed? What does being well-formed mean? The line:column info regarding the first character on the first line does not have anything that looks not-well-formed.

Expected: Browser should be able to point to the cause of the error more clearly, so that the developer is able to debug (and learn!) what causes the error.
(Fixing the not well-formed message on the page in question is being discussed elsewhere in bug https://github.com/kripken/emscripten/issues/3792 )
I didn't investigate any deeper but the message comes from

https://dxr.mozilla.org/mozilla-central/source/dom/locales/en-US/chrome/layout/xmlparser.properties#9

(Tested by modifying the message.)
So maybe a bug in the XML parser.
The test in question is doing this:

  var codeXHR = new XMLHttpRequest();
  codeXHR.open('GET', 'not_well_formed.js', true);

The error is being logged when it turns out that this .js file can't be parsed as XML,
starting around here:
https://dxr.mozilla.org/mozilla-central/source/parser/htmlparser/nsExpatDriver.cpp#893

So this seems to be a parser bug in the end.


One idea for fixing it is bug 906239.  We already arrange to attach stacks
on the XHR *callbacks*, but if we captured the stack on the nsXMLHttpRequest
itself, we could report it here somehow.

Ideally we'd audit all the uses of the console service in platform and see
what else needs to be fixed.
Whiteboard: [polish-backlog] → [polish-backlog][gaming-tools]
Priority: -- → P3
Attached file threadprofiler.zip
Another test case. Opening this by drag-n-drop (via file:// URL) causes a "syntax error" message, and behaves very similar to the above test case.
One idea would be to attach the async stack by making a synthetic frame for the error.
The same idea came up in bug 1316067.
Product: Firefox → DevTools

I believe this is a captured stack bug. CC brian

Flags: needinfo?(bhackett1024)

Hmm, per comment 0 this bug is about the error message not being helpful, rather than the lack of an associated stack. If we want to investigate saving a stack for parse errors like this, I think it would be better to do in a different bug. Currently, these testcases give different errors:

XML Parsing Error: not well-formed
Location: not_well_formed.js
Line Number 1, Column 1:

XML Parsing Error: syntax error
Location: threadprofiler.asm.js
Line Number 1, Column 1:

These messages clearly indicate that the errors happened when parsing the files as XML, which seems much clearer than the message in comment 0, so I think this bug is fixed.

Flags: needinfo?(bhackett1024)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: