git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Arthur Chan <arthur.chan@adalogics.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Arthur Chan via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Arthur Chan <arthur.chan@adalogics.com>,
	david@adalogics.com
Subject: Re: [PATCH] fuzz: add basic fuzz testing for git command
Date: Fri, 16 Sep 2022 16:54:14 +0100	[thread overview]
Message-ID: <a6308a8c-3b43-77fe-6a6d-cd9f296ec8ec@adalogics.com> (raw)
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:
> 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

  reply	other threads:[~2022-09-16 15:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-13 14:22 [PATCH] fuzz: add basic fuzz testing for git command Arthur Chan via GitGitGadget
2022-09-13 15:57 ` Ævar Arnfjörð Bjarmason
2022-09-16 15:54   ` Arthur Chan [this message]
2022-09-13 16:13 ` Junio C Hamano
2022-09-16 16:06   ` Arthur Chan
2022-09-16 17:29 ` [PATCH v2] " Arthur Chan via GitGitGadget
2022-09-16 17:37   ` Junio C Hamano
2022-09-16 18:07     ` Arthur Chan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6308a8c-3b43-77fe-6a6d-cd9f296ec8ec@adalogics.com \
    --to=arthur.chan@adalogics.com \
    --cc=avarab@gmail.com \
    --cc=david@adalogics.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).