Open Bug 1252016 Opened 9 years ago Updated 2 years ago

Parsing error with big json files on Firefox

Categories

(Core :: DOM: Core & HTML, defect)

44 Branch
x86_64
Windows 7
defect

Tracking

()

UNCONFIRMED

People

(Reporter: u564798, Unassigned)

References

Details

(Whiteboard: btpp-followup-2016-03-11)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Steps to reproduce: I created a light html web app which loads four times with XMLHttpRequest the same big json file (150Mo). The web app is hosted in apache. This big json file have valid structure. I use Firefox v44.0.2 for Windows. See https://jsfiddle.net/asicfr/bvmfv4ea/ for the web app and the following link for the big json file : https://drive.google.com/file/d/0B09g_WmDUmoFd0FYU05SQTFWQW8/view?usp=sharing Actual results: Part loadings end in success and the others in error : SyntaxError: JSON.parse: unterminated string at line 4233392 column 290 of the JSON data Expected results: The same big json file should be loaded with success four times.
OS: Unspecified → Windows 7
Hardware: Unspecified → x86_64
I don't see this error in the web console, only syntax error: syntax error datas2.json:1:1 syntax error datas2.json:1:1 syntax error datas2.json:1:1 syntax error datas2.json:1:1
Have you downloaded the json file on local ? Do not use directly my link from Google drive.
Yes, I tested all locally, the .html testcase and the JSON file in a same folder.
Thx for your response. I use apache to serve the files and Firefox v44.0.2 for Windows. And you ?
I desactivate all plugin (firebug etc) but the problem is still there. The problem cannot be reproduce in a portable version of Firefox. Seriously, I do not understand what's going on ...
Component: Untriaged → Developer Tools: JSON Viewer
Did you enable JSON Viewer manually from about:config then in 44? I believe it's not yet enabled by default in release.
Flags: needinfo?(asicfr)
Another question is: where do you see the error appear? Not clear from the bug if we're actually talking about the new JSON Viewer feature.
It's not about the new JSON Viewer feature. I see the error in the console.
Flags: needinfo?(asicfr)
Okay. While this error itself may appear in the console, I think we'll have more success diagnosing this in a component that knows more about XHR, etc.
Component: Developer Tools: JSON Viewer → DOM
Product: Firefox → Core
Ok, i activated Json Viewer in about:config. Now what is the next step ? How can i use the Json Viewer ? Thx again
(In reply to asicfr from comment #10) > Ok, i activated Json Viewer in about:config. > Now what is the next step ? How can i use the Json Viewer ? > Thx again I just wanted to know if you were using the JSON Viewer at all, to know if it was a bug in that feature. Since you are using XHR, it sounds like the JSON Viewer does not apply to your problem. But anyway, to use it, you go to any URL that serves an application/json response. The viewer appears in the main content area, instead of a plain text view. See more at https://developer.mozilla.org/en-US/docs/Tools/JSON_viewer.
I reproduce the same pb in Firefox Developer Edition 46.0.a2
Does it work in other browsers?
Flags: needinfo?(asicfr)
Whiteboard: btpp-followup-2016-03-11
Yes it works with Chrome for example.
Flags: needinfo?(asicfr)
I'm not getting the error when loading from a server, and I see the same as in comment 1 when loading locally, but the json file is actually loaded properly (so the "syntax error datas2.json:1:1" is bogus here.). Reporter, is it possible that you're running out of memory here?
syntax error datas2.json:1:1 is coming from Expat (xml parsing), so it is rather bogus here. http://mxr.mozilla.org/mozilla-central/source/dom/locales/en-US/chrome/layout/xmlparser.properties#7
(In reply to Olli Pettay [:smaug] from comment #15) > I'm not getting the error when loading from a server, and I see the same as > in comment 1 when loading locally, but the json file is actually loaded > properly (so the "syntax error datas2.json:1:1" is bogus here.). > > > Reporter, is it possible that you're running out of memory here? No, isn't a memory pb and i doesn't crash on line / column 1:1 but in line 4233392 column 290

Hi
Sorry to bump this report but i've come accros this bug.
The steps to reproduce are simple but doesn't involve the json viewer in the main window.
A little context before detailing my steps :
The api i talk to is not on https
A token needs to be sent in the request header
Only POST method is supported.
The request paramaters needs to be a json encoded object
So in order to test this particular endpoint in firefox i need to use the header tab of the dev tools network tab.
1 - Open the network pane in a new tab
2 - go to the url of the endpoint
3 - get a 405 because the GET method is not supported
4 - modify the headers to include the token, content-type, accept-encoding and change the method to POST
5 - SEND
200 code for the response but in the response tab i get the error

----- SyntaxError: JSON.parse: unterminated string at line 1 column 1049461 of the JSON data -----

REQUEST HEADERS

Host: apiv2.europeansourcing.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: application/json;q=0.9,/;q=0.8
Accept-Language: fr,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Content-Encoding: gzip, deflate
content-type: application/json
DNT: 1
Connection: keep-alive
x-auth-token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Content-Length: 322
Pragma: no-cache
Cache-Control: no-cache

RESPONSE HEADERS

HTTP/1.1 200 OK
Date: Thu, 17 Jan 2019 16:21:16 GMT
Server: Apache/2.4.25 (Debian)
Set-Cookie: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX; path=/; HttpOnly
Cache-Control: max-age=0, must-revalidate, private
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/json

Forgot to mention that i'm on firefox 60.4esr from debian stretch

Component: DOM → DOM: Core & HTML

Seeing the same problem using the fetch api (ff 65).
The dev tools just give up on bigger json responses ~2mb =>

SyntaxError: JSON.parse: unterminated string at line 1 column 1048577 of the JSON

Chrome got no problem parsing.

Firefox nightly (67.0a1 (2019-03-13)) is different
Response has been truncated which is great, but it makes the (apple) beach ball appear.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.