git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] fuzz: add basic fuzz testing for git command

From
Arthur Chan <arthur.chan@adalogics.com>
Date
Sep 16, 2022, 15:54 UTC
Message-ID
<a6308a8c-3b43-77fe-6a6d-cd9f296ec8ec@adalogics.com>
In-Reply-To
<220913.864jxb6z8u.gmgdl@evledraar.gmail.com>

Thanks for the styling suggestions. I have review my patch and change most of the styling accordingly. And I am just a little bit confused with two of the suggestions.

1) I am really sorry that I did not find any similar API for generate
random files for fuzzing, which not only required random file names, but
also random content that is purposely generated by the fuzzing engine.
Could you kindly suggest which existing APIs I could use for this
purpose? Thanks.
2) The existence of those system command in the code because the fuzzer
needed to reset the git repository on each round of fuzzing and it is
integrated inside the LLVM oss-fuzz library, thus it is necessary to
increase such resetting logic within the code.
Thanks again for your helpful comments and hope to hear back from you.
On 13/9/2022 4:57 pm, Ævar Arnfjörð Bjarmason wrote:
Show 24 quoted lines
> On Tue, Sep 13 2022, Arthur Chan via GitGitGadget wrote:
>
>> From: Arthur Chan <arthur.chan@adalogics.com>
>> [...]
> Just a quick comment. The coding style of this project is to:
>
>> +void randomize_git_files(char *dir, char *name_set[], int files_count, char *data, int size) {
> ...try to wrap at 79 columns.
>
>> +   int data_size = size / files_count;
> ...and to use \t for indentation, not spaces.
>
>> +   for(int i=0; i<files_count; i++) {
> ...and e.g. to use "for (", not "for(", spaces around "<" etc. We also
> tend to pre-declare "int" instead of putting it in "for" etc.
>
>> +void generate_random_file(char *data, int size) {
> Can we really not use the APIs we have already for this (maybe not due
> to the fuzz testing aspect of this...)
>
>> +   ret += system("git add TEMP-*-TEMP");
>> +   ret += system("git commit -m\"New Commit\"");
> (I have not looked deeply). We usually write *.sh tests in t/*.sh, can
> this really not be driven by that sort of infrastructure?

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

Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 3 of 8 in “fuzz: add basic fuzz testing for git command”
  1. fuzz: add basic fuzz testing for git commandArthur Chan via GitGitGadget, Sep 13, 2022
  2. Ævar Arnfjörð BjarmasonSep 13, 2022
  3. Arthur ChanSep 16, 2022
  4. Junio C HamanoSep 13, 2022
  5. Arthur ChanSep 16, 2022
  6. fuzz: add basic fuzz testing for git commandArthur Chan via GitGitGadget, Sep 16, 2022
  7. Junio C HamanoSep 16, 2022
  8. Arthur ChanSep 16, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.