FreeBSD Bugzilla – Attachment 228345 Details for
Bug 258762
www/chromium: Serious typed array initialization problem 92.0.4515.159 (Official Build) (64-bit)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Same repro rewritten for convenience
zeros.html (text/html), 953 bytes, created by
Alex S
on 2021-10-02 04:37:21 UTC
(
hide
)
Description:
Same repro rewritten for convenience
Filename:
MIME Type:
Creator:
Alex S
Created:
2021-10-02 04:37:21 UTC
Size:
953 bytes
patch
obsolete
><script> >const test_slice_length = 20; > >function alloc(array_length) { > if (array_length < 2) { > return null; > } > try { > return new Int32Array(array_length); > } catch (error) { > if (error instanceof RangeError) { > return alloc(array_length / 2); > } > } >} > >function print(msg) { > console.log(msg); > if (document) { > document.write(msg + '<br>'); > } >} > >function test(iterations, array_length) { > > let arrays = []; > > for (let i = 0; i < iterations; i++) { > > let a = alloc(array_length); > if (a == null) { > print('out of memory after ' + i + ' iterations'); > return true; > } > > if (!a.slice(0, test_slice_length).every(n => n == 0)) { > print('found a failure case after ' + i + ' iterations: '); > print(JSON.stringify(Array.from(a.slice(0, test_slice_length)))); > return false; > } > > arrays.push(a); > } > > return true; >} > >if (test(100_000, 1_000)) { > document.write('ok'); >} ></script>
<script> const test_slice_length = 20; function alloc(array_length) { if (array_length < 2) { return null; } try { return new Int32Array(array_length); } catch (error) { if (error instanceof RangeError) { return alloc(array_length / 2); } } } function print(msg) { console.log(msg); if (document) { document.write(msg + '<br>'); } } function test(iterations, array_length) { let arrays = []; for (let i = 0; i < iterations; i++) { let a = alloc(array_length); if (a == null) { print('out of memory after ' + i + ' iterations'); return true; } if (!a.slice(0, test_slice_length).every(n => n == 0)) { print('found a failure case after ' + i + ' iterations: '); print(JSON.stringify(Array.from(a.slice(0, test_slice_length)))); return false; } arrays.push(a); } return true; } if (test(100_000, 1_000)) { document.write('ok'); } </script>
View Attachment As Raw
Actions:
View
Attachments on
bug 258762
:
228233
| 228345