[PATCH] [libFuzzer] Allow non-fuzzer args after "--"

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 14 15:29:01 PDT 2017


Updated to use -ignore_remaining_args=1 here: https://reviews.llvm.org/D35442

Kostya Serebryany <kcc at google.com> writes:
>  -ignore-remaining-args=1 sounds good!
>
> On Fri, Jul 14, 2017 at 2:56 PM, Justin Bogner <mail at justinbogner.com> wrote:
>> Kostya Serebryany <kcc at google.com> writes:
>>> thought a bit more...
>>> It's really hard for me to verify that this change won't break anything,
>>> so how about making this in some different way?
>>> e.g.
>>> ./fuzzer-binary -flag1=foo -flag2=bar -ignore-all-following-arguments=1
>>> llvm-arg1 llvm-arg2
>>
>> I really can't see it breaking anything that works today - most argument
>> parsers that treat '--' specially probably have a hard time with the
>> fuzzer args anyway. That said, I'm fine with some other sigil (though
>> this suggestion seems a little long). How about -ignore-remaining-args=1 ?
>>
>>> (And please do use phabricator :)
>>
>> Sure. I really find phabricator painful to use for reviewing, but I
>> suppose you're reviewing this, not me :)
>>
>>> On Wed, Jul 12, 2017 at 2:52 PM, Kostya Serebryany <kcc at google.com> wrote:
>>>
>>>> 1. phabricator maybe?
>>>> 2. need to think. This flag business is messy
>>>>
>>>> On Wed, Jul 12, 2017 at 2:41 PM, Justin Bogner <mail at justinbogner.com>
>>>> wrote:
>>>>
>>>>> With this change, libFuzzer will ignore any arguments after an empty
>>>>> double dash argument, but it will preserve these arguments at the end
>>>>> of the command line when launching subprocesses. Using this, its
>>>>> possible to handle positional and single-dash arguments to the program
>>>>> under test by discarding everything up to "--" in LLVMFuzzerInitialize.
>>>>>
>>>>> The motivation here is in trying to set up fuzzers that use the LLVM
>>>>> backend, for example so that we can pass "-global-isel" in an ISel
>>>>> fuzzer to test that instead of SelectionDAG.
>>>>>
>>>>> Ok to commit?
>>>>>
>>>>>
>>>>


More information about the llvm-commits mailing list