Bug 204886

Summary: computeIfUsingFuzzerAgent() is called before parsing command line arguments
Product: WebKit Reporter: Tuomas Karkkainen <tuomas.webkit>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch.
none
proposed patch.
none
proposed patch. saam: review+

Tuomas Karkkainen
Reported 2019-12-05 05:38:56 PST
computeIfUsingFuzzerAgent(); is called in the lambda inside Options::initialize() which is invoked at the top of CommandLine::parseArguments(). The options are only set later in CommandLine::parseArguments() at > if (!JSC::Options::setOption(&arg[2])) { This means that computeIfUsingFuzzerAgent(); will always determine that no FuzzerAgents are in use because at the time of the check all relevant options are still false regardless of the command line. similarly I don't believe this will ever be executed either: > if (Options::dumpOptions()) { > printf("Command line:"); the thing that actually dumps the options with --dumpOptions is at the end.
Attachments
proposed patch. (3.52 KB, patch)
2019-12-05 10:41 PST, Mark Lam
no flags
proposed patch. (3.48 KB, patch)
2019-12-05 10:46 PST, Mark Lam
no flags
proposed patch. (5.04 KB, patch)
2019-12-05 12:17 PST, Mark Lam
saam: review+
Mark Lam
Comment 1 2019-12-05 10:31:55 PST
(In reply to Tuomas Karkkainen from comment #0) > computeIfUsingFuzzerAgent(); is called in the lambda inside > Options::initialize() which is invoked at the top of > CommandLine::parseArguments(). > > The options are only set later in CommandLine::parseArguments() at > > > if (!JSC::Options::setOption(&arg[2])) { > > This means that computeIfUsingFuzzerAgent(); will always determine that no > FuzzerAgents are in use because at the time of the check all relevant > options are still false regardless of the command line. Will fix. > similarly I don't believe this will ever be executed either: > > if (Options::dumpOptions()) { > > printf("Command line:"); > > the thing that actually dumps the options with --dumpOptions is at the end. This does run but only if you use the env var JSC_dumpOptions=true.
Mark Lam
Comment 2 2019-12-05 10:41:39 PST
Created attachment 384919 [details] proposed patch.
Mark Lam
Comment 3 2019-12-05 10:46:23 PST
Created attachment 384921 [details] proposed patch.
Saam Barati
Comment 4 2019-12-05 11:03:46 PST
Comment on attachment 384921 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=384921&action=review > Source/JavaScriptCore/ChangeLog:3 > + computeIfUsingFuzzerAgent() is called before parsing command line arguments. can we just go back to the world where we checked all of the options individually?
Mark Lam
Comment 5 2019-12-05 12:01:11 PST
(In reply to Saam Barati from comment #4) > Comment on attachment 384921 [details] > proposed patch. > > View in context: > https://bugs.webkit.org/attachment.cgi?id=384921&action=review > > > Source/JavaScriptCore/ChangeLog:3 > > + computeIfUsingFuzzerAgent() is called before parsing command line arguments. > > can we just go back to the world where we checked all of the options > individually? Fine. I'll roll it out.
Mark Lam
Comment 6 2019-12-05 12:17:42 PST
Created attachment 384933 [details] proposed patch.
Mark Lam
Comment 7 2019-12-05 12:24:08 PST
Thanks for the review. Landed in r253164: <http://trac.webkit.org/r253164>.
Radar WebKit Bug Importer
Comment 8 2019-12-05 12:25:22 PST
Note You need to log in before you can comment on or make changes to this bug.