Bug 223959 - Add Options::exitOnResourceExhaustion() to enable exiting instead of crashing on resource exhaustion.
Summary: Add Options::exitOnResourceExhaustion() to enable exiting instead of crashing...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-30 14:54 PDT by Mark Lam
Modified: 2021-03-30 15:47 PDT (History)
11 users (show)

See Also:


Attachments
proposed patch. (12.92 KB, patch)
2021-03-30 15:01 PDT, Mark Lam
tzagallo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2021-03-30 14:54:08 PDT
This is useful to unblock fuzzers from false positive crashes due to resource exhaustion.

rdar://63934158
Comment 1 Mark Lam 2021-03-30 15:01:32 PDT
Created attachment 424704 [details]
proposed patch.
Comment 2 Tadeu Zagallo 2021-03-30 15:24:42 PDT
Comment on attachment 424704 [details]
proposed patch.

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

r=me

> Source/JavaScriptCore/runtime/ResourceExhaustion.cpp:36
> +    WTFReportAssertionFailureWithMessage(file, line, function, assertion, "ResourceExhaustion(%d): %s", static_cast<int>(exitCode), failureMessage);

Since this isn't called directly, you could use the macro to stringify the ResourceExhaustionCode.
Comment 3 Mark Lam 2021-03-30 15:41:35 PDT
Comment on attachment 424704 [details]
proposed patch.

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

Thanks for the review.

>> Source/JavaScriptCore/runtime/ResourceExhaustion.cpp:36
>> +    WTFReportAssertionFailureWithMessage(file, line, function, assertion, "ResourceExhaustion(%d): %s", static_cast<int>(exitCode), failureMessage);
> 
> Since this isn't called directly, you could use the macro to stringify the ResourceExhaustionCode.

I had debated back and forth on whether I should do this initially.  I think I'll go with adding the stringified code.
Comment 4 Mark Lam 2021-03-30 15:47:55 PDT
Landed in r275243: <http://trac.webkit.org/r275243>.