Bug 214354

Summary: Add handling of out of memory handling while adding a worklet module.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: WebCore JavaScriptAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, esprehn+autocc, ews-watchlist, kangil.han, keith_miller, kondapallykalyan, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=214386
Attachments:
Description Flags
proposed patch. keith_miller: review+

Description Mark Lam 2020-07-15 08:14:39 PDT
<rdar://problem/65271931>
Comment 1 Mark Lam 2020-07-15 08:27:41 PDT
Created attachment 404342 [details]
proposed patch.
Comment 2 Yusuke Suzuki 2020-07-15 11:36:08 PDT
Comment on attachment 404342 [details]
proposed patch.

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

r=me with comment.

> LayoutTests/fast/css-custom-paint/out-of-memory-while-adding-worklet-module-expected.txt:5
> +    RenderBody {BODY} at (8,8) size 784x584

Please include js-pre.js and js-post.js and disable this layout dump.
Comment 3 Keith Miller 2020-07-15 11:37:56 PDT
Comment on attachment 404342 [details]
proposed patch.

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

r=me too with nit.

> Source/JavaScriptCore/runtime/VM.cpp:473
> +            else
> +                RELEASE_ASSERT(bigInt);

Nit: I don't think this is needed and will probably be removed by the compiler.
Comment 4 Mark Lam 2020-07-15 12:11:08 PDT
Comment on attachment 404342 [details]
proposed patch.

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

>> Source/JavaScriptCore/runtime/VM.cpp:473
>> +                RELEASE_ASSERT(bigInt);
> 
> Nit: I don't think this is needed and will probably be removed by the compiler.

It is needed.  If the success pointer is null, we want to RELEASE_ASSERT(the result).  This will be compiled into an unconditional crash.
Comment 5 Mark Lam 2020-07-15 12:21:51 PDT
Thanks for the reviews.  I've made the requested test changes.

Landed in r264413: <http://trac.webkit.org/r264413>.