New issue
Advanced search Search tips

Issue 820795 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

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:
 
Labels: Needs-Triage-M65

Comment 2 by kochi@chromium.org, Mar 12 2018

Components: -Blink Blink>JavaScript>WebAssembly

Comment 3 by titzer@chromium.org, Mar 12 2018

Status: WontFix (was: Unconfirmed)
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.
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.
And it works in Firefox.
OK, admittedly, Firefox doesnt allow to allocate 2GB, but throws the exception reliably.
I filed a new report Issue 822039.

Sign in to add a comment