Bug 202011

Summary: stress/test-out-of-memory.js is not throwing OOM into ARMv7 and MIPS
Product: WebKit Reporter: Caio Lima <ticaiolima>
Component: JavaScriptCoreAssignee: Caio Lima <ticaiolima>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, mark.lam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Caio Lima 2019-09-19 15:44:40 PDT
After https://trac.webkit.org/r249578, the test `stress/test-out-of-memory.js` was introduced to test some paths that are taken during memory allocation, mainly the path where `allocationLarge` fails due to unavailable space for large allocations (m_largeFree). However, this test has some assumptions that are not valid into ARMv7 and MIPS ports. The current behavior of the test in those architectures is that it does not throw during `new ArrayBuffer(1000)` allocation site, because eden collection keeps happening between iterations. The collection is trigged into those architectures because the amount of stress `new Promise` generates into GC limits is not enough to avoid collection while loop is executing.
Changing the size of `UInt8Array` from `80000000` to `160000000` enables us to finally avoid collection happening during `ArrayBuffer` allocation loop, but we can't guarantee this test is always going to execute without error when Gigacage is disabled, given we can reach an OOM state in some allocations that need to succeed, turning this test flawky for those architectures.
Given that, I think we should skip this test for ARMv7 and MIPS.
Comment 1 Caio Lima 2019-09-19 16:04:19 PDT
Created attachment 379170 [details]
Patch
Comment 2 Mark Lam 2019-09-20 19:16:07 PDT
Comment on attachment 379170 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=379170&action=review

> JSTests/ChangeLog:12
> +        is trigged into those architectures because the amount of stress 

/trigged into/triggered on/

> JSTests/ChangeLog:20
> +        some allocations that need to succeed, turning this test flawky for those

/turning this test flawky/making this test flaky/
Comment 3 Caio Lima 2019-09-21 12:34:08 PDT
Created attachment 379319 [details]
Patch
Comment 4 Caio Lima 2019-09-21 12:34:54 PDT
Thank you very much for the review!
Comment 5 WebKit Commit Bot 2019-09-21 13:21:03 PDT
Comment on attachment 379319 [details]
Patch

Clearing flags on attachment: 379319

Committed r250185: <https://trac.webkit.org/changeset/250185>
Comment 6 WebKit Commit Bot 2019-09-21 13:21:04 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2019-09-21 13:22:24 PDT
<rdar://problem/55591617>