big file downloaded through XMLHttpRequest causes crash
Reported by
pavel.za...@profiq.cz,
Mar 30 2016
|
||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0 Steps to reproduce the problem: 1. extract attachment, there is batch and html file 2. create ~600 MB file using "fsutil file createnew data 600000000" 2. run *.bat file in the attachment 3. it starts chrome, loads html file and downloads 600 MB file 4. crash happens What is the expected behavior? no crash What went wrong? crash Crashed report ID: How much crashed? Just one tab Is it a problem with a plugin? No Did this work before? N/A Chrome version: 49.0.2623.87 m Channel: stable OS Version: 7.0 Flash Version: Shockwave Flash 20.0 r0
,
Mar 31 2016
pavel.zaruba@Could you please respond to comment #1?
,
Mar 31 2016
Well, my opinion is different. Chromium is used by other 'runtimes', e.g. electron. Let's say an electron app needs to download an update file. When the app is downloading the update, it suddenly crashes. Developers can't inform user since whole process crashed and app window got black. Better would be for example to call abort or error event and inform the app about the error.
xhr.onabort = function(e) {
}
xhr.onerror = function(e) {
}
Developers could do something with it in that case. A message could be passed to event handler, sth like 'Insufficient memory' or 'Not enough memory allocated' in case it is memory issue. I've attached screenshot of task manager performance tab before and after the crash.
What comes to "I think this is working as intended", I suppose that the crash is invoked intentionally, something like this:
int *array = malloc(buff_size * sizeof(unsigned char));
if (array == NULL) {
force_crash();
}
or it is caused unintentionally by "dereferencing null pointer" etc. So I can't think it is working as it should.
Btw is it really problem to allocate 600 MB for Chromium with 1 tab running alone on clear Windows 7 32 bit installation?
,
Apr 1 2016
Thank you for providing more feedback. Adding requester "ssamanoori@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://sites.google.com/a/chromium.org/dev/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 4 2016
My belief is that we've made the policy decision in Chrome to not allow arbitrary web pages to take up arbitrary amounts of computer memory to avoid DOS attacks, though I grant responding by crashing isn't necessarily the best UI. Seth: Are you an appropriate person to speak to this?
,
Apr 4 2016
Chromium is used in Electron (http://electron.atom.io/) as well. So it can be a single page application. The whole app crashes in that case and developer can't do anything about it. When app creates request and something is wrong with the connection, or with the server, client gets appropriate error (error/abort event handler is called), but if the client loads more and more data, the whole app crashes. That's bad. Why not to simply close the request with error report in the same way as there would be a problem with connection/fetching data on the server? A request can't be fulfilled, so error is thrown. Why crash of whole application? (in Chrome browser sense, just a web page).
,
Apr 7 2016
,
Apr 11 2016
We generally don't have OOM handling in the renderer process. But, according to the fetch spec (https://fetch.spec.whatwg.org/) and the XHR spec (https://xhr.spec.whatwg.org/), we should throw a JavaScript exception when we fail to allocate an ArrayBuffer.
,
Apr 11 2016
Catching exception in an asynchronous code is quite problematic. See this: https://www.joyent.com/developers/node/design/errors You couldn't do sth. like this to handle OOM: try { xhr = new XMLHttpRequest(); xhr.open('GET', url); xhr.responseType = 'arraybuffer'; xhr.send(); xhr.onprogress = function(e) {}; xhr.onload = function(e) {}; xhr.onerror = function(e) {}; xhr.onabort = function(e) {}; } catch (e) { console.log(e); }
,
Apr 12 2016
Regarding XHR, terminating fetching and calling onerror when we can't allocate an ArrayBuffer seems the right behavior.
,
Apr 12 2016
Yes, it seems to be the right way. Definitely better than a crash.
,
Apr 12 2017
This issue has been available for more than 365 days, and should be re-evaluated. Please re-triage this issue. The Hotlist-Recharge-Cold label is applied for tracking purposes, and should not be removed after re-triaging the issue. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 26 2017
Closing as Fixed - at least part of the problem is fixed. ArrayBuffer allocation failure is handled by sof@'s change [1]. 1: https://chromium.googlesource.com/chromium/src/+/7c838d986a3d95e81971ef40050fecce0ea2be2c |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by rdsmith@chromium.org
, Mar 30 2016