threads / patch / 58446

patchfuzz: reorganise the path for existing oss-fuzz fuzzers

Subject: [PATCH] fuzz: reorganise the path for existing oss-fuzz fuzzers

## tl;dr

9 messages between Sep 16, 2022 and Sep 19, 2022. Diffs are folded; open one to read it.

replies: 8people: 3as markdown or json

Arthur Chan via GitGitGadget· Sep 16, 2022, 19:03 UTC · lore
From: Arthur Chan <arthur.chan@adalogics.com>

This patch is aimed to provide a better organisation for oss-fuzz fuzzers, allowing more fuzzers for the git project to be added in a later development.

A new folder oss-fuzz has been created and existing fuzzers are moved into the new folders. Makefile has been fixed accordingly.

CC: Josh Steadmon <steadmon@google.com>
CC: David Korczynski <david@adalogics.com>
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
---
    fuzz: reorganise the path for existing oss-fuzz fuzzers
    
    This patch is aimed to provide a better organisation for oss-fuzz
    fuzzers, allowing more fuzzers for the git project to be added in a
    later development.
    
    A new folder oss-fuzz has been created and existing fuzzers are moved
    into the new folders. Makefile has been fixed accordingly.
    
    CC: Josh Steadmon steadmon@google.com CC: David Korczynski
    david@adalogics.com Signed-off-by: Arthur Chan arthur.chan@adalogics.com
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1353%2Farthurscchan%2Frelocate-fuzzer-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1353/arthurscchan/relocate-fuzzer-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1353
 Makefile                                            | 6 +++---
 fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c | 0
 fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c | 0
 fuzz-pack-idx.c => oss-fuzz/fuzz-pack-idx.c         | 0
 4 files changed, 3 insertions(+), 3 deletions(-)
 rename fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c (100%)
 rename fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c (100%)
 rename fuzz-pack-idx.c => oss-fuzz/fuzz-pack-idx.c (100%)
Show changes to 4 files +3 −3

Makefile, fuzz-commit-graph.c, fuzz-pack-headers.c, fuzz-pack-idx.c

diff --git a/Makefile b/Makefile
index d9247ead45b..2d56aae7a1d 100644
--- a/Makefile
+++ b/Makefile
@@ -686,9 +686,9 @@ SCRIPTS = $(SCRIPT_SH_GEN) \
 
 ETAGS_TARGET = TAGS
 
-FUZZ_OBJS += fuzz-commit-graph.o
-FUZZ_OBJS += fuzz-pack-headers.o
-FUZZ_OBJS += fuzz-pack-idx.o
+FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o
+FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o
+FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o
 .PHONY: fuzz-objs
 fuzz-objs: $(FUZZ_OBJS)
 
diff --git a/fuzz-commit-graph.c b/oss-fuzz/fuzz-commit-graph.c
similarity index 100%
rename from fuzz-commit-graph.c
rename to oss-fuzz/fuzz-commit-graph.c
diff --git a/fuzz-pack-headers.c b/oss-fuzz/fuzz-pack-headers.c
similarity index 100%
rename from fuzz-pack-headers.c
rename to oss-fuzz/fuzz-pack-headers.c
diff --git a/fuzz-pack-idx.c b/oss-fuzz/fuzz-pack-idx.c
similarity index 100%
rename from fuzz-pack-idx.c
rename to oss-fuzz/fuzz-pack-idx.c

base-commit: d3fa443f97e3a8d75b51341e2d5bac380b7422df
-- 
gitgitgadget
Junio C Hamano· Sep 16, 2022, 21:55 UTC · re: Arthur Chan via GitGitGadget · lore

Re: [PATCH] fuzz: reorganise the path for existing oss-fuzz fuzzers

"Arthur Chan via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 8 quoted lines
> From: Arthur Chan <arthur.chan@adalogics.com>
>
> This patch is aimed to provide a better organisation for oss-fuzz
> fuzzers, allowing more fuzzers for the git project to be added
> in a later development.
>
> A new folder oss-fuzz has been created and existing fuzzers are
> moved into the new folders. Makefile has been fixed accordingly.
"folder" -> "directory" everywhere.
Show 8 quoted lines
>  Makefile                                            | 6 +++---
>  fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c | 0
>  fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c | 0
>  fuzz-pack-idx.c => oss-fuzz/fuzz-pack-idx.c         | 0
>  4 files changed, 3 insertions(+), 3 deletions(-)
>  rename fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c (100%)
>  rename fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c (100%)
>  rename fuzz-pack-idx.c => oss-fuzz/fuzz-pack-idx.c (100%)

It is curious that we do not have any changes to .gitignore patterns.

    $ git grep fuzz .gitignore Makefile
    .gitignore:/fuzz-commit-graph
    .gitignore:/fuzz_corpora
    .gitignore:/fuzz-pack-headers
    .gitignore:/fuzz-pack-idx
    Makefile:FUZZ_OBJS += fuzz-commit-graph.o
    Makefile:FUZZ_OBJS += fuzz-pack-headers.o
    Makefile:FUZZ_OBJS += fuzz-pack-idx.o
    Makefile:.PHONY: fuzz-objs
    Makefile:fuzz-objs: $(FUZZ_OBJS)
    Makefile:# Always build fuzz objects even if not testing, to prevent bit-rot.
    Makefile:# Building fuzz targets generally requires a special set of compiler flags that
    Makefile:#      CFLAGS="-fsanitize=fuzzer-no-link,address" \
    Makefile:#      LIB_FUZZING_ENGINE="-fsanitize=fuzzer" \
    Makefile:#      fuzz-all
    Makefile:.PHONY: fuzz-all
    Makefile:fuzz-all: $(FUZZ_PROGRAMS)

I do not know what "fuzz_corpora" is, which step in build creates it, and why we do not have to bother removing it in "make clean", the last of which is not the fault of this patch, but I suspect that at least other three existing entries that name $(FUZZ_PROGRAMS) need to be updated, because ...

Show 14 quoted lines
> diff --git a/Makefile b/Makefile
> index d9247ead45b..2d56aae7a1d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -686,9 +686,9 @@ SCRIPTS = $(SCRIPT_SH_GEN) \
>  
>  ETAGS_TARGET = TAGS
>  
> -FUZZ_OBJS += fuzz-commit-graph.o
> -FUZZ_OBJS += fuzz-pack-headers.o
> -FUZZ_OBJS += fuzz-pack-idx.o
> +FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o
> +FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o
> +FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o
... FUZZ_OBJS now live in the oss-fuzz/ directory, and Makefile has
    FUZZ_PROGRAMS += $(patsubst %.o,%,$(FUZZ_OBJS))
    $(FUZZ_PROGRAMS): all
	$(QUIET_LINK)$(CXX) $(FUZZ_CXXFLAGS) $(LIB_OBJS) $(BUILTIN_OBJS) \
		$(XDIFF_OBJS) $(EXTLIBS) git.o $@.o $(LIB_FUZZING_ENGINE) -o $@

neither of which has been touched by the patch, so presumably the executables are now created in the oss-fuzz/ directory as well, and they are what .gitignore should be listing, right?

Also, compiling the exectuable files would not be the end of the story, right? Do folks (like test script, makefile targets and CI recipes) who used to run ./fuzz-commit-graph need to be told that they now need to run oss-fuzz/fuzz-commit-graph instead? They may not be inside my tree, but what's the best way to inform them? Add entries to release notes (not asking you to add one immediately --- asking you to help formulating the plans).

Thanks.
Arthur Chan· Sep 17, 2022, 00:45 UTC · re: Junio C Hamano · lore

Re: [PATCH] fuzz: reorganise the path for existing oss-fuzz fuzzers

On 16/9/2022 10:55 pm, Junio C Hamano wrote:
Show 11 quoted lines
> "Arthur Chan via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> From: Arthur Chan <arthur.chan@adalogics.com>
>>
>> This patch is aimed to provide a better organisation for oss-fuzz
>> fuzzers, allowing more fuzzers for the git project to be added
>> in a later development.
>>
>> A new folder oss-fuzz has been created and existing fuzzers are
>> moved into the new folders. Makefile has been fixed accordingly.
> "folder" -> "directory" everywhere.
Thanks for the suggestion. I will change it in v2.
Show 34 quoted lines
>>   Makefile                                            | 6 +++---
>>   fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c | 0
>>   fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c | 0
>>   fuzz-pack-idx.c => oss-fuzz/fuzz-pack-idx.c         | 0
>>   4 files changed, 3 insertions(+), 3 deletions(-)
>>   rename fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c (100%)
>>   rename fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c (100%)
>>   rename fuzz-pack-idx.c => oss-fuzz/fuzz-pack-idx.c (100%)
> It is curious that we do not have any changes to .gitignore
> patterns.
>
>      $ git grep fuzz .gitignore Makefile
>      .gitignore:/fuzz-commit-graph
>      .gitignore:/fuzz_corpora
>      .gitignore:/fuzz-pack-headers
>      .gitignore:/fuzz-pack-idx
>      Makefile:FUZZ_OBJS += fuzz-commit-graph.o
>      Makefile:FUZZ_OBJS += fuzz-pack-headers.o
>      Makefile:FUZZ_OBJS += fuzz-pack-idx.o
>      Makefile:.PHONY: fuzz-objs
>      Makefile:fuzz-objs: $(FUZZ_OBJS)
>      Makefile:# Always build fuzz objects even if not testing, to prevent bit-rot.
>      Makefile:# Building fuzz targets generally requires a special set of compiler flags that
>      Makefile:#      CFLAGS="-fsanitize=fuzzer-no-link,address" \
>      Makefile:#      LIB_FUZZING_ENGINE="-fsanitize=fuzzer" \
>      Makefile:#      fuzz-all
>      Makefile:.PHONY: fuzz-all
>      Makefile:fuzz-all: $(FUZZ_PROGRAMS)
>
> I do not know what "fuzz_corpora" is, which step in build creates
> it, and why we do not have to bother removing it in "make clean",
> the last of which is not the fault of this patch, but I suspect that
> at least other three existing entries that name $(FUZZ_PROGRAMS)
> need to be updated, because ...

I also have no idea what fuzz_corpora is, I will ask the person who wrote the three fuzzers to see if he got any idea.

And yes, indeed, I miss the change in .gitignore, I will modify it and push it to v2.

Show 25 quoted lines
>> diff --git a/Makefile b/Makefile
>> index d9247ead45b..2d56aae7a1d 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -686,9 +686,9 @@ SCRIPTS = $(SCRIPT_SH_GEN) \
>>
>>   ETAGS_TARGET = TAGS
>>
>> -FUZZ_OBJS += fuzz-commit-graph.o
>> -FUZZ_OBJS += fuzz-pack-headers.o
>> -FUZZ_OBJS += fuzz-pack-idx.o
>> +FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o
>> +FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o
>> +FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o
> ... FUZZ_OBJS now live in the oss-fuzz/ directory, and Makefile has
>
>      FUZZ_PROGRAMS += $(patsubst %.o,%,$(FUZZ_OBJS))
>
>      $(FUZZ_PROGRAMS): all
>          $(QUIET_LINK)$(CXX) $(FUZZ_CXXFLAGS) $(LIB_OBJS) $(BUILTIN_OBJS) \
>                  $(XDIFF_OBJS) $(EXTLIBS) git.o $@.o $(LIB_FUZZING_ENGINE) -o $@
>
> neither of which has been touched by the patch, so presumably the
> executables are now created in the oss-fuzz/ directory as well, and
> they are what .gitignore should be listing, right?

Yes, indeed. sorry for missing out the changes in .gitignore. I will modify it and push it to v2

Show 8 quoted lines
>
> Also, compiling the exectuable files would not be the end of the
> story, right?  Do folks (like test script, makefile targets and CI
> recipes) who used to run ./fuzz-commit-graph need to be told that
> they now need to run oss-fuzz/fuzz-commit-graph instead?  They may
> not be inside my tree, but what's the best way to inform them?  Add
> entries to release notes (not asking you to add one immediately ---
> asking you to help formulating the plans).

In general, for the oss-fuzz project, there will be a dockerfile and build script prepared for each of the target project. The Dockerfile will pull out the target version of the the target project, setting them up for the build script. Then the build script will compile the target project together with the fuzzers. After that it will move the compiled fuzzer into correct location for the oss-fuzz library to grab them and start the fuzzing process. The fuzzing and execution of those fuzzers are all on the oss-fuzz side. We are just trying to push fuzzers to the git upstream in order to allow it to compile and sync with the git repository which the fuzzers depending on. This is the existing execution plan for those fuzzers as far as I know. We are actually in offline discussion with the person who create that three fuzzers and we agree to go on this route. For your reference, you could find the dockerfile and build script of the oss-fuzz for the git repository in https://github.com/google/oss-fuzz/tree/master/projects/git. We will of course need to update the build script on the oss-fuzz tree in order to allow oss-fuzz to retrieve the fuzzers after it has been reloacted. But this won't affect the git tree.

Thanks again for pointing out my careless mistake on .gitignore. I will fix that together with the comment and push a v2. Thanks very much for your time. Cheers

> Thanks.
> ADA Logics Ltd is registered in England. No: 11624074.
> Registered office: 266 Banbury Road, Post Box 292,
> OX2 7DL, Oxford, Oxfordshire , United Kingdom

ADA Logics Ltd is registered in England. No: 11624074. Registered office: 266 Banbury Road, Post Box 292, OX2 7DL, Oxford, Oxfordshire , United Kingdom

Arthur Chan via GitGitGadget· Sep 17, 2022, 23:28 UTC · re: Arthur Chan via GitGitGadget · lore

[PATCH v2] fuzz: reorganise the path for existing oss-fuzz fuzzers

From: Arthur Chan <arthur.chan@adalogics.com>

This patch is aimed to provide a better organisation for oss-fuzz fuzzers, allowing more fuzzers for the git project to be added in later development.

A new direrctory oss-fuzz has been created and existing fuzzers are moved into the new directory. Makefile and .gitignore have been fixed accordingly.

CC: Josh Steadmon <steadmon@google.com>
CC: David Korczynski <david@adalogics.com>
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
---
    fuzz: reorganise the path for existing oss-fuzz fuzzers
    
    This patch is aimed to provide a better organisation for oss-fuzz
    fuzzers, allowing more fuzzers for the git project to be added in later
    development.
    
    A new directory oss-fuzz has been created and existing fuzzers are moved
    into the new directory. Makefile and .gitignore have been fixed
    accordingly.
    
    CC: Josh Steadmon steadmon@google.com CC: David Korczynski
    david@adalogics.com Signed-off-by: Arthur Chan arthur.chan@adalogics.com
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1353%2Farthurscchan%2Frelocate-fuzzer-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1353/arthurscchan/relocate-fuzzer-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1353
Range-diff vs v1:
 1:  1cc90522b7b ! 1:  c056429897a fuzz: reorganise the path for existing oss-fuzz fuzzers
     @@ Commit message
      
          This patch is aimed to provide a better organisation for oss-fuzz
          fuzzers, allowing more fuzzers for the git project to be added
     -    in a later development.
     +    in later development.
      
     -    A new folder oss-fuzz has been created and existing fuzzers are
     -    moved into the new folders. Makefile has been fixed accordingly.
     +    A new direrctory oss-fuzz has been created and existing fuzzers are
     +    moved into the new directory. Makefile and .gitignore have been
     +    fixed accordingly.
      
          CC: Josh Steadmon <steadmon@google.com>
          CC: David Korczynski <david@adalogics.com>
          Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
      
     + ## .gitignore ##
     +@@
     +-/fuzz-commit-graph
     +-/fuzz_corpora
     +-/fuzz-pack-headers
     ++/oss-fuzz/fuzz-commit-graph
     ++/oss-fuzz/fuzz_corpora
     ++/oss-fuzz/fuzz-pack-headers
     + /fuzz-pack-idx
     + /GIT-BUILD-OPTIONS
     + /GIT-CFLAGS
     +
       ## Makefile ##
      @@ Makefile: SCRIPTS = $(SCRIPT_SH_GEN) \
       
 .gitignore                                          | 6 +++---
 Makefile                                            | 6 +++---
 fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c | 0
 fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c | 0
 fuzz-pack-idx.c => oss-fuzz/fuzz-pack-idx.c         | 0
 5 files changed, 6 insertions(+), 6 deletions(-)
 rename fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c (100%)
 rename fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c (100%)
 rename fuzz-pack-idx.c => oss-fuzz/fuzz-pack-idx.c (100%)
Show changes to 5 files +6 −6

.gitignore, Makefile, fuzz-commit-graph.c, fuzz-pack-headers.c, fuzz-pack-idx.c

diff --git a/.gitignore b/.gitignore
index 80b530bbed2..9e810c07ba9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
-/fuzz-commit-graph
-/fuzz_corpora
-/fuzz-pack-headers
+/oss-fuzz/fuzz-commit-graph
+/oss-fuzz/fuzz_corpora
+/oss-fuzz/fuzz-pack-headers
 /fuzz-pack-idx
 /GIT-BUILD-OPTIONS
 /GIT-CFLAGS
diff --git a/Makefile b/Makefile
index d9247ead45b..2d56aae7a1d 100644
--- a/Makefile
+++ b/Makefile
@@ -686,9 +686,9 @@ SCRIPTS = $(SCRIPT_SH_GEN) \
 
 ETAGS_TARGET = TAGS
 
-FUZZ_OBJS += fuzz-commit-graph.o
-FUZZ_OBJS += fuzz-pack-headers.o
-FUZZ_OBJS += fuzz-pack-idx.o
+FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o
+FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o
+FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o
 .PHONY: fuzz-objs
 fuzz-objs: $(FUZZ_OBJS)
 
diff --git a/fuzz-commit-graph.c b/oss-fuzz/fuzz-commit-graph.c
similarity index 100%
rename from fuzz-commit-graph.c
rename to oss-fuzz/fuzz-commit-graph.c
diff --git a/fuzz-pack-headers.c b/oss-fuzz/fuzz-pack-headers.c
similarity index 100%
rename from fuzz-pack-headers.c
rename to oss-fuzz/fuzz-pack-headers.c
diff --git a/fuzz-pack-idx.c b/oss-fuzz/fuzz-pack-idx.c
similarity index 100%
rename from fuzz-pack-idx.c
rename to oss-fuzz/fuzz-pack-idx.c

base-commit: d3fa443f97e3a8d75b51341e2d5bac380b7422df
-- 
gitgitgadget
Arthur Chan via GitGitGadget· Sep 18, 2022, 23:08 UTC · re: Arthur Chan via GitGitGadget · lore

[PATCH v3] fuzz: reorganise the path for existing oss-fuzz fuzzers

From: Arthur Chan <arthur.chan@adalogics.com>

This patch is aimed to provide a better organisation for oss-fuzz fuzzers, allowing more fuzzers for the git project to be added in later development.

A new direrctory oss-fuzz has been created and existing fuzzers are moved into the new directory. Makefile and .gitignore have been fixed accordingly.

CC: Josh Steadmon <steadmon@google.com>
CC: David Korczynski <david@adalogics.com>
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
---
    fuzz: reorganise the path for existing oss-fuzz fuzzers
    
    This patch is aimed to provide a better organisation for oss-fuzz
    fuzzers, allowing more fuzzers for the git project to be added in later
    development.
    
    A new directory oss-fuzz has been created and existing fuzzers are moved
    into the new directory. Makefile and .gitignore have been fixed
    accordingly.
    
    Fix wrong push for v2
    
    CC: Josh Steadmon steadmon@google.com CC: David Korczynski
    david@adalogics.com Signed-off-by: Arthur Chan arthur.chan@adalogics.com
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1353%2Farthurscchan%2Frelocate-fuzzer-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1353/arthurscchan/relocate-fuzzer-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/1353
Range-diff vs v2:
 1:  c056429897a ! 1:  21714e583aa fuzz: reorganise the path for existing oss-fuzz fuzzers
     @@ Commit message
       ## .gitignore ##
      @@
      -/fuzz-commit-graph
     --/fuzz_corpora
     --/fuzz-pack-headers
      +/oss-fuzz/fuzz-commit-graph
     -+/oss-fuzz/fuzz_corpora
     + /fuzz_corpora
     +-/fuzz-pack-headers
     +-/fuzz-pack-idx
      +/oss-fuzz/fuzz-pack-headers
     - /fuzz-pack-idx
     ++/oss-fuzz/fuzz-pack-idx
       /GIT-BUILD-OPTIONS
       /GIT-CFLAGS
     + /GIT-LDFLAGS
      
       ## Makefile ##
      @@ Makefile: SCRIPTS = $(SCRIPT_SH_GEN) \
 .gitignore                                          | 6 +++---
 Makefile                                            | 6 +++---
 fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c | 0
 fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c | 0
 fuzz-pack-idx.c => oss-fuzz/fuzz-pack-idx.c         | 0
 5 files changed, 6 insertions(+), 6 deletions(-)
 rename fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c (100%)
 rename fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c (100%)
 rename fuzz-pack-idx.c => oss-fuzz/fuzz-pack-idx.c (100%)
Show changes to 5 files +6 −6

.gitignore, Makefile, fuzz-commit-graph.c, fuzz-pack-headers.c, fuzz-pack-idx.c

diff --git a/.gitignore b/.gitignore
index 80b530bbed2..d11fa8297d2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,7 @@
-/fuzz-commit-graph
+/oss-fuzz/fuzz-commit-graph
 /fuzz_corpora
-/fuzz-pack-headers
-/fuzz-pack-idx
+/oss-fuzz/fuzz-pack-headers
+/oss-fuzz/fuzz-pack-idx
 /GIT-BUILD-OPTIONS
 /GIT-CFLAGS
 /GIT-LDFLAGS
diff --git a/Makefile b/Makefile
index d9247ead45b..2d56aae7a1d 100644
--- a/Makefile
+++ b/Makefile
@@ -686,9 +686,9 @@ SCRIPTS = $(SCRIPT_SH_GEN) \
 
 ETAGS_TARGET = TAGS
 
-FUZZ_OBJS += fuzz-commit-graph.o
-FUZZ_OBJS += fuzz-pack-headers.o
-FUZZ_OBJS += fuzz-pack-idx.o
+FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o
+FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o
+FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o
 .PHONY: fuzz-objs
 fuzz-objs: $(FUZZ_OBJS)
 
diff --git a/fuzz-commit-graph.c b/oss-fuzz/fuzz-commit-graph.c
similarity index 100%
rename from fuzz-commit-graph.c
rename to oss-fuzz/fuzz-commit-graph.c
diff --git a/fuzz-pack-headers.c b/oss-fuzz/fuzz-pack-headers.c
similarity index 100%
rename from fuzz-pack-headers.c
rename to oss-fuzz/fuzz-pack-headers.c
diff --git a/fuzz-pack-idx.c b/oss-fuzz/fuzz-pack-idx.c
similarity index 100%
rename from fuzz-pack-idx.c
rename to oss-fuzz/fuzz-pack-idx.c

base-commit: d3fa443f97e3a8d75b51341e2d5bac380b7422df
-- 
gitgitgadget
Ævar Arnfjörð Bjarmason· Sep 19, 2022, 11:10 UTC · re: Arthur Chan via GitGitGadget · lore

Re: [PATCH v3] fuzz: reorganise the path for existing oss-fuzz fuzzers

On Sun, Sep 18 2022, Arthur Chan via GitGitGadget wrote:
Show 5 quoted lines
> From: Arthur Chan <arthur.chan@adalogics.com>
>
> This patch is aimed to provide a better organisation for oss-fuzz
> fuzzers, allowing more fuzzers for the git project to be added
> in later development.

I don't see any problem with this change per-se, but this rationale really doesn't explain anything in the end to the reader. How does just having x/y-*.c files rather than x-y-*.c allow for more fuzzers to be added? We could also add new fuzzers to the top-level now, why does this change help us to do so.

I suspect the unstated reason is just "adding a lot more would make the top-level cluttered", or perhaps some design reason you hinted at in https://lore.kernel.org/git/2405897f-a774-e0d3-99bb-2185dcbb5432@adalogics.com/ (but I haven't taken the time to fully understand).

So, I'm fine with this v3 as-is, but also wouldn't mind a v4 with an updated commit message to address the above confusion.

Show 13 quoted lines
> --- a/.gitignore
> +++ b/.gitignore
> @@ -1,7 +1,7 @@
> -/fuzz-commit-graph
> +/oss-fuzz/fuzz-commit-graph
>  /fuzz_corpora
> -/fuzz-pack-headers
> -/fuzz-pack-idx
> +/oss-fuzz/fuzz-pack-headers
> +/oss-fuzz/fuzz-pack-idx
>  /GIT-BUILD-OPTIONS
>  /GIT-CFLAGS
>  /GIT-LDFLAGS

Speaking of clutter, a much better change here IMO would be to create a /oss-fuzz/.gitignore file, and then move these there. For prior art see:

	git ls-files '**/.gitignore'

Even better (but I'm not sure how this is all used in the end), can we perhaps build those in a .gitignore'd oss-fuzz/.build/.

But maybe not, and in any case that would be a larger change to the Makefile logic, so we can leave it for now, but I do think it makes sense to create a oss-fuzz/.gitignore in a v4.

Arthur Chan via GitGitGadget· Sep 19, 2022, 14:36 UTC · re: Arthur Chan via GitGitGadget · lore

[PATCH v4] fuzz: reorganise the path for existing oss-fuzz fuzzers

From: Arthur Chan <arthur.chan@adalogics.com>

This patch is aimed to provide a better organisation for oss-fuzz fuzzers and to avoid top-level clustters in the git repository when more fuzzers are introduced. In addition, grouping the fuzzers into their own directory separate their application on fuzz-testing from the core functionalities of the git code. It also provide better and tidier structure the oss-fuzz fuzzing library to manage, locate, build and execute those fuzzers for fuzz-testing purposes in future development.

A new direrctory oss-fuzz has been created and existing fuzzers are moved into the new directory. Makefile and .gitignore have been fixed accordingly.

CC: Josh Steadmon <steadmon@google.com>
CC: David Korczynski <david@adalogics.com>
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
---
    fuzz: reorganise the path for existing oss-fuzz fuzzers
    
    This patch is aimed to provide a better organisation for oss-fuzz
    fuzzers and to avoid top-level clustters in the git repository when more
    fuzzers are introduced. In addition, grouping the fuzzers into their own
    directory separate their application on fuzz-testing from the core
    functionalities of the git code. It also provide better and tidier
    structure the oss-fuzz fuzzing library to manage, locate, build and
    execute those fuzzers for fuzz-testing purposes in future development.
    
    A new direrctory oss-fuzz has been created and existing fuzzers are
    moved into the new directory. Makefile and .gitignore have been fixed
    accordingly.
    
    Create new .gitignore file for the new directory in v4 and fix the
    commit message.
    
    CC: Josh Steadmon steadmon@google.com CC: David Korczynski
    david@adalogics.com Signed-off-by: Arthur Chan arthur.chan@adalogics.com
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1353%2Farthurscchan%2Frelocate-fuzzer-v4
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1353/arthurscchan/relocate-fuzzer-v4
Pull-Request: https://github.com/gitgitgadget/git/pull/1353
Range-diff vs v3:
 1:  21714e583aa ! 1:  82d9568ea65 fuzz: reorganise the path for existing oss-fuzz fuzzers
     @@ Commit message
          fuzz: reorganise the path for existing oss-fuzz fuzzers
      
          This patch is aimed to provide a better organisation for oss-fuzz
     -    fuzzers, allowing more fuzzers for the git project to be added
     -    in later development.
     +    fuzzers and to avoid top-level clustters in the git repository when
     +    more fuzzers are introduced. In addition, grouping the fuzzers into
     +    their own directory separate their application on fuzz-testing from
     +    the core functionalities of the git code. It also provide better
     +    and tidier structure the oss-fuzz fuzzing library to manage, locate,
     +    build and execute those fuzzers for fuzz-testing purposes in future
     +    development.
      
          A new direrctory oss-fuzz has been created and existing fuzzers are
          moved into the new directory. Makefile and .gitignore have been
     @@ Commit message
       ## .gitignore ##
      @@
      -/fuzz-commit-graph
     -+/oss-fuzz/fuzz-commit-graph
       /fuzz_corpora
      -/fuzz-pack-headers
      -/fuzz-pack-idx
     -+/oss-fuzz/fuzz-pack-headers
     -+/oss-fuzz/fuzz-pack-idx
       /GIT-BUILD-OPTIONS
       /GIT-CFLAGS
       /GIT-LDFLAGS
     @@ Makefile: SCRIPTS = $(SCRIPT_SH_GEN) \
       fuzz-objs: $(FUZZ_OBJS)
       
      
     + ## oss-fuzz/.gitignore (new) ##
     +@@
     ++fuzz-commit-graph
     ++fuzz-pack-headers
     ++fuzz-pack-idx
     +
       ## fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c ##
      
       ## fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c ##
 .gitignore                                          | 3 ---
 Makefile                                            | 6 +++---
 oss-fuzz/.gitignore                                 | 3 +++
 fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c | 0
 fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c | 0
 fuzz-pack-idx.c => oss-fuzz/fuzz-pack-idx.c         | 0
 6 files changed, 6 insertions(+), 6 deletions(-)
 create mode 100644 oss-fuzz/.gitignore
 rename fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c (100%)
 rename fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c (100%)
 rename fuzz-pack-idx.c => oss-fuzz/fuzz-pack-idx.c (100%)
Show changes to 6 files +6 −6

.gitignore, Makefile, oss-fuzz/.gitignore, fuzz-commit-graph.c, fuzz-pack-headers.c, fuzz-pack-idx.c

diff --git a/.gitignore b/.gitignore
index 80b530bbed2..ed8b9f04e5c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,4 @@
-/fuzz-commit-graph
 /fuzz_corpora
-/fuzz-pack-headers
-/fuzz-pack-idx
 /GIT-BUILD-OPTIONS
 /GIT-CFLAGS
 /GIT-LDFLAGS
diff --git a/Makefile b/Makefile
index d9247ead45b..2d56aae7a1d 100644
--- a/Makefile
+++ b/Makefile
@@ -686,9 +686,9 @@ SCRIPTS = $(SCRIPT_SH_GEN) \
 
 ETAGS_TARGET = TAGS
 
-FUZZ_OBJS += fuzz-commit-graph.o
-FUZZ_OBJS += fuzz-pack-headers.o
-FUZZ_OBJS += fuzz-pack-idx.o
+FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o
+FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o
+FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o
 .PHONY: fuzz-objs
 fuzz-objs: $(FUZZ_OBJS)
 
diff --git a/oss-fuzz/.gitignore b/oss-fuzz/.gitignore
new file mode 100644
index 00000000000..9acb74412ef
--- /dev/null
+++ b/oss-fuzz/.gitignore
@@ -0,0 +1,3 @@
+fuzz-commit-graph
+fuzz-pack-headers
+fuzz-pack-idx
diff --git a/fuzz-commit-graph.c b/oss-fuzz/fuzz-commit-graph.c
similarity index 100%
rename from fuzz-commit-graph.c
rename to oss-fuzz/fuzz-commit-graph.c
diff --git a/fuzz-pack-headers.c b/oss-fuzz/fuzz-pack-headers.c
similarity index 100%
rename from fuzz-pack-headers.c
rename to oss-fuzz/fuzz-pack-headers.c
diff --git a/fuzz-pack-idx.c b/oss-fuzz/fuzz-pack-idx.c
similarity index 100%
rename from fuzz-pack-idx.c
rename to oss-fuzz/fuzz-pack-idx.c

base-commit: d3fa443f97e3a8d75b51341e2d5bac380b7422df
-- 
gitgitgadget
Junio C Hamano· Sep 19, 2022, 16:38 UTC · re: Arthur Chan via GitGitGadget · lore

Re: [PATCH v4] fuzz: reorganise the path for existing oss-fuzz fuzzers

"Arthur Chan via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 19 quoted lines
> From: Arthur Chan <arthur.chan@adalogics.com>
>
> This patch is aimed to provide a better organisation for oss-fuzz
> fuzzers and to avoid top-level clustters in the git repository when
> more fuzzers are introduced. In addition, grouping the fuzzers into
> their own directory separate their application on fuzz-testing from
> the core functionalities of the git code. It also provide better
> and tidier structure the oss-fuzz fuzzing library to manage, locate,
> build and execute those fuzzers for fuzz-testing purposes in future
> development.
>
> A new direrctory oss-fuzz has been created and existing fuzzers are
> moved into the new directory. Makefile and .gitignore have been
> fixed accordingly.
>
> CC: Josh Steadmon <steadmon@google.com>
> CC: David Korczynski <david@adalogics.com>
> Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
> ---
Thanks.  Will queue with a bit of rephrasing of the above.
Junio C Hamano· Sep 19, 2022, 16:40 UTC · re: Arthur Chan via GitGitGadget · lore

Re: [PATCH v4] fuzz: reorganise the path for existing oss-fuzz fuzzers

"Arthur Chan via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 17 quoted lines
> From: Arthur Chan <arthur.chan@adalogics.com>
>
> This patch is aimed to provide a better organisation for oss-fuzz
> fuzzers and to avoid top-level clustters in the git repository when
> more fuzzers are introduced. In addition, grouping the fuzzers into
> their own directory separate their application on fuzz-testing from
> the core functionalities of the git code. It also provide better
> and tidier structure the oss-fuzz fuzzing library to manage, locate,
> build and execute those fuzzers for fuzz-testing purposes in future
> development.
>
> A new direrctory oss-fuzz has been created and existing fuzzers are
> moved into the new directory. Makefile and .gitignore have been
> fixed accordingly.
>
> CC: Josh Steadmon <steadmon@google.com>
> CC: David Korczynski <david@adalogics.com>

If you mean to tell these people about your work, write these lines on the header of your outgoing e-mail (or instruct GitGitGadget to do so), not here (if writing them here is the only way to instruct GGG to do so then I wouldn't object, but apparently that is not happening and I had to add them manually to this message.

Thanks.
Show 137 quoted lines
> Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
> ---
>     fuzz: reorganise the path for existing oss-fuzz fuzzers
>     
>     This patch is aimed to provide a better organisation for oss-fuzz
>     fuzzers and to avoid top-level clustters in the git repository when more
>     fuzzers are introduced. In addition, grouping the fuzzers into their own
>     directory separate their application on fuzz-testing from the core
>     functionalities of the git code. It also provide better and tidier
>     structure the oss-fuzz fuzzing library to manage, locate, build and
>     execute those fuzzers for fuzz-testing purposes in future development.
>     
>     A new direrctory oss-fuzz has been created and existing fuzzers are
>     moved into the new directory. Makefile and .gitignore have been fixed
>     accordingly.
>     
>     Create new .gitignore file for the new directory in v4 and fix the
>     commit message.
>     
>     CC: Josh Steadmon steadmon@google.com CC: David Korczynski
>     david@adalogics.com Signed-off-by: Arthur Chan arthur.chan@adalogics.com
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1353%2Farthurscchan%2Frelocate-fuzzer-v4
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1353/arthurscchan/relocate-fuzzer-v4
> Pull-Request: https://github.com/gitgitgadget/git/pull/1353
>
> Range-diff vs v3:
>
>  1:  21714e583aa ! 1:  82d9568ea65 fuzz: reorganise the path for existing oss-fuzz fuzzers
>      @@ Commit message
>           fuzz: reorganise the path for existing oss-fuzz fuzzers
>       
>           This patch is aimed to provide a better organisation for oss-fuzz
>      -    fuzzers, allowing more fuzzers for the git project to be added
>      -    in later development.
>      +    fuzzers and to avoid top-level clustters in the git repository when
>      +    more fuzzers are introduced. In addition, grouping the fuzzers into
>      +    their own directory separate their application on fuzz-testing from
>      +    the core functionalities of the git code. It also provide better
>      +    and tidier structure the oss-fuzz fuzzing library to manage, locate,
>      +    build and execute those fuzzers for fuzz-testing purposes in future
>      +    development.
>       
>           A new direrctory oss-fuzz has been created and existing fuzzers are
>           moved into the new directory. Makefile and .gitignore have been
>      @@ Commit message
>        ## .gitignore ##
>       @@
>       -/fuzz-commit-graph
>      -+/oss-fuzz/fuzz-commit-graph
>        /fuzz_corpora
>       -/fuzz-pack-headers
>       -/fuzz-pack-idx
>      -+/oss-fuzz/fuzz-pack-headers
>      -+/oss-fuzz/fuzz-pack-idx
>        /GIT-BUILD-OPTIONS
>        /GIT-CFLAGS
>        /GIT-LDFLAGS
>      @@ Makefile: SCRIPTS = $(SCRIPT_SH_GEN) \
>        fuzz-objs: $(FUZZ_OBJS)
>        
>       
>      + ## oss-fuzz/.gitignore (new) ##
>      +@@
>      ++fuzz-commit-graph
>      ++fuzz-pack-headers
>      ++fuzz-pack-idx
>      +
>        ## fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c ##
>       
>        ## fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c ##
>
>
>  .gitignore                                          | 3 ---
>  Makefile                                            | 6 +++---
>  oss-fuzz/.gitignore                                 | 3 +++
>  fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c | 0
>  fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c | 0
>  fuzz-pack-idx.c => oss-fuzz/fuzz-pack-idx.c         | 0
>  6 files changed, 6 insertions(+), 6 deletions(-)
>  create mode 100644 oss-fuzz/.gitignore
>  rename fuzz-commit-graph.c => oss-fuzz/fuzz-commit-graph.c (100%)
>  rename fuzz-pack-headers.c => oss-fuzz/fuzz-pack-headers.c (100%)
>  rename fuzz-pack-idx.c => oss-fuzz/fuzz-pack-idx.c (100%)
>
> diff --git a/.gitignore b/.gitignore
> index 80b530bbed2..ed8b9f04e5c 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -1,7 +1,4 @@
> -/fuzz-commit-graph
>  /fuzz_corpora
> -/fuzz-pack-headers
> -/fuzz-pack-idx
>  /GIT-BUILD-OPTIONS
>  /GIT-CFLAGS
>  /GIT-LDFLAGS
> diff --git a/Makefile b/Makefile
> index d9247ead45b..2d56aae7a1d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -686,9 +686,9 @@ SCRIPTS = $(SCRIPT_SH_GEN) \
>  
>  ETAGS_TARGET = TAGS
>  
> -FUZZ_OBJS += fuzz-commit-graph.o
> -FUZZ_OBJS += fuzz-pack-headers.o
> -FUZZ_OBJS += fuzz-pack-idx.o
> +FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o
> +FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o
> +FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o
>  .PHONY: fuzz-objs
>  fuzz-objs: $(FUZZ_OBJS)
>  
> diff --git a/oss-fuzz/.gitignore b/oss-fuzz/.gitignore
> new file mode 100644
> index 00000000000..9acb74412ef
> --- /dev/null
> +++ b/oss-fuzz/.gitignore
> @@ -0,0 +1,3 @@
> +fuzz-commit-graph
> +fuzz-pack-headers
> +fuzz-pack-idx
> diff --git a/fuzz-commit-graph.c b/oss-fuzz/fuzz-commit-graph.c
> similarity index 100%
> rename from fuzz-commit-graph.c
> rename to oss-fuzz/fuzz-commit-graph.c
> diff --git a/fuzz-pack-headers.c b/oss-fuzz/fuzz-pack-headers.c
> similarity index 100%
> rename from fuzz-pack-headers.c
> rename to oss-fuzz/fuzz-pack-headers.c
> diff --git a/fuzz-pack-idx.c b/oss-fuzz/fuzz-pack-idx.c
> similarity index 100%
> rename from fuzz-pack-idx.c
> rename to oss-fuzz/fuzz-pack-idx.c
>
> base-commit: d3fa443f97e3a8d75b51341e2d5bac380b7422df

← back to recent threads