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

NEW
Unassigned

Status

P3
normal
3 years ago
17 days ago

People

(Reporter: jujjyl, Unassigned)

Tracking

(Blocks: 1 bug)

43 Branch

Firefox Tracking Flags

(firefox43 affected)

Details

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

Attachments

(2 attachments)

167.05 KB, application/x-gzip
Details
126.10 KB, application/x-zip-compressed
Details
(Reporter)

Description

3 years ago
Created attachment 8663302 [details]
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.
(Reporter)

Comment 1

3 years ago
(Fixing the not well-formed message on the page in question is being discussed elsewhere in bug https://github.com/kripken/emscripten/issues/3792 )
Blocks: 1212468
Whiteboard: [polish-backlog]

Comment 2

3 years ago
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.

Comment 3

3 years ago
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
(Reporter)

Comment 4

3 years ago
Created attachment 8734001 [details]
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.

Comment 5

10 months ago
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.

Updated

3 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.