google / oss-fuzz

OSS-Fuzz - continuous fuzzing for open source software.
https://google.github.io/oss-fuzz
Apache License 2.0
10.13k stars 2.15k forks source link

reproduce: Test for a directory exists instead of a regular file #12070

Closed armfazh closed 2 weeks ago

armfazh commented 3 weeks ago

The -f flag checks for a file exists and is a regular file, while the -d checks for a directory exists.

Doc: https://www.gnu.org/software/coreutils/manual/html_node/File-type-tests.html

jonathanmetzman commented 2 weeks ago

Did this cause a problem for you? i think the testcase should be a file not a dir.

armfazh commented 2 weeks ago

I raised this issue as I found it while I'm try to running in my setup. Note that the documentation mentions that the command expects a PATH instead of a single file.

jonathanmetzman commented 2 weeks ago

I raised this issue as I found it while I'm try to running in my setup. Note that the documentation mentions that the command expects a PATH instead of a single file.

I think it means a path to a single testcase, not a directory.

armfazh commented 2 weeks ago

When I specify the path of one single file I got as a result the following message:

***
*** NOTE: fuzzing was not performed, you have only
***       executed the target code on a fixed set of inputs.
***

does that means the fuzzer didn't run? or which flag should I enable to forze the fuzzer to run with one single test case?

jonathanmetzman commented 2 weeks ago

When I specify the path of one single file I got as a result the following message:

***
*** NOTE: fuzzing was not performed, you have only
***       executed the target code on a fixed set of inputs.
***

does that means the fuzzer didn't run? or which flag should I enable to forze the fuzzer to run with one single test case?

I think it did run because libfuzzer will run testcases in a directory or a single one in a file, but when users want to reproduce a tetcase, they almost always mean a file.

armfazh commented 2 weeks ago

I see thanks for clarifying. The warning message make me think that argument is a directory instead of a file. Closing this, code is right.