Ah Snap error on allocating webassembly memory
Reported by
joe.fisc...@googlemail.com,
Mar 11 2018
|
|||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36
Steps to reproduce the problem:
1. type in console:
var wasmMemory = new WebAssembly.Memory({ initial:32000, minimum:2048});
2. repeat 2-5 times
What is the expected behavior?
success or exception thrown
What went wrong?
"Ah snap" page crash instead of exception
Did this work before? N/A
Chrome version: 65.0.3325.146 Channel: stable
OS Version: 10.0
Flash Version:
,
Mar 12 2018
,
Mar 12 2018
This looks like a classic out-of-memory (OOM) condition. Doing this in the console may leak memory because the console keeps a history of the results of previous commands. A memory of 32000 pages is just shy of 2gb, so 2-5 of them is really a lot. Marking as WontFix, as it is an inherent leak in the example. If you have an application where an OOM occurs where the WebAssembly memories should be collected by the GC and are not, please file another bug.
,
Mar 12 2018
Actually, this happens the same way without console being involved.
With a supersimple html file like this:
<html>
<body>
<div id="output"></div>
<script>
var wasmMemory = new WebAssembly.Memory({ initial:32000, minimum:2048});
document.querySelector('#output').innerHTML = "memory allocated: "+wasmMemory.buffer.byteLength;
</script>
</body>
</html>
If I show this in chrome, it is successful on every second page reload and shows ah snap on every other second reload.
So its not possible to savefly allocate big memories if even the previously loaded page has influence on wether or not an exception is thrown.
,
Mar 12 2018
And it works in Firefox.
,
Mar 12 2018
OK, admittedly, Firefox doesnt allow to allocate 2GB, but throws the exception reliably.
,
Mar 14 2018
I filed a new report Issue 822039. |
|||
►
Sign in to add a comment |
|||
Comment 1 by krajshree@chromium.org
, Mar 11 2018