qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Darren Kenny <darren.kenny@oracle.com>
To: Alexander Bulekov <alxndr@bu.edu>, qemu-devel@nongnu.org
Cc: thuth@redhat.com, f4bug@amsat.org,
	Alexander Bulekov <alxndr@bu.edu>,
	bsd@redhat.com, stefanha@redhat.com, pbonzini@redhat.com,
	dimastep@yandex-team.ru
Subject: Re: [PATCH v7 16/17] scripts/oss-fuzz: use hardlinks instead of copying
Date: Fri, 23 Oct 2020 17:02:44 +0100	[thread overview]
Message-ID: <m2sga5lyl7.fsf@oracle.com> (raw)
In-Reply-To: <20201023150746.107063-17-alxndr@bu.edu>

On Friday, 2020-10-23 at 11:07:45 -04, Alexander Bulekov wrote:
> Prior to this, fuzzers in the output oss-fuzz directory were exactly
> the same executable, with a different name to do argv[0]-based
> fuzz-target selection. This is a waste of space, especially since these
> binaries can weigh many MB.
>
> Instead of copying, use hard links, to cut down on wasted space. We need
> to place the primary copy of the executable into DEST_DIR, since this is
> a separate file-system on oss-fuzz. We should not place it directly into
> $DEST_DIR, since oss-fuzz will treat it as an independent fuzzer and try
> to run it for fuzzing. Instead, we create a DEST_DIR/bin directory to
> store the primary copy.
>
> Suggested-by: Darren Kenny <darren.kenny@oracle.com>
> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>

Reviewed-by: Darren Kenny <darren.kenny@oracle.com>

> ---
>  scripts/oss-fuzz/build.sh | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/oss-fuzz/build.sh b/scripts/oss-fuzz/build.sh
> index 0c3ca9e06f..0ce2867732 100755
> --- a/scripts/oss-fuzz/build.sh
> +++ b/scripts/oss-fuzz/build.sh
> @@ -62,6 +62,9 @@ fi
>  
>  mkdir -p "$DEST_DIR/lib/"  # Copy the shared libraries here
>  
> +mkdir -p "$DEST_DIR/bin/"  # Copy executables that shouldn't
> +                           # be treated as fuzzers by oss-fuzz here
> +
>  # Build once to get the list of dynamic lib paths, and copy them over
>  ../configure --disable-werror --cc="$CC" --cxx="$CXX" --enable-fuzzing \
>      --prefix="$DEST_DIR" --bindir="$DEST_DIR" --datadir="$DEST_DIR/data/" \
> @@ -88,13 +91,16 @@ make "-j$(nproc)" qemu-fuzz-i386 V=1
>  # Copy over the datadir
>  cp  -r ../pc-bios/ "$DEST_DIR/pc-bios"
>  
> +cp "./qemu-fuzz-i386" "$DEST_DIR/bin/"
> +
>  # Run the fuzzer with no arguments, to print the help-string and get the list
>  # of available fuzz-targets. Copy over the qemu-fuzz-i386, naming it according
>  # to each available fuzz target (See 05509c8e6d fuzz: select fuzz target using
>  # executable name)
>  for target in $(./qemu-fuzz-i386 | awk '$1 ~ /\*/  {print $2}');
>  do
> -    cp qemu-fuzz-i386 "$DEST_DIR/qemu-fuzz-i386-target-$target"
> +    ln  "$DEST_DIR/bin/qemu-fuzz-i386" \
> +        "$DEST_DIR/qemu-fuzz-i386-target-$target"
>  done
>  
>  echo "Done. The fuzzers are located in $DEST_DIR"
> -- 
> 2.28.0


  reply	other threads:[~2020-10-23 16:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23 15:07 [PATCH v7 00/17] Add a Generic Virtual Device Fuzzer Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 01/17] memory: Add FlatView foreach function Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 02/17] fuzz: Add generic virtual-device fuzzer Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 03/17] fuzz: Add PCI features to the generic fuzzer Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 04/17] fuzz: Add DMA support to the generic-fuzzer Alexander Bulekov
2020-10-26  8:48   ` Thomas Huth
2020-10-23 15:07 ` [PATCH v7 05/17] fuzz: Declare DMA Read callback function Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 06/17] fuzz: Add fuzzer callbacks to DMA-read functions Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 07/17] fuzz: Add support for custom crossover functions Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 08/17] fuzz: add a DISABLE_PCI op to generic-fuzzer Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 09/17] fuzz: add a crossover function " Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 10/17] scripts/oss-fuzz: Add script to reorder a generic-fuzzer trace Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 11/17] scripts/oss-fuzz: Add crash trace minimization script Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 12/17] fuzz: Add instructions for using generic-fuzz Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 13/17] fuzz: add an "opaque" to the FuzzTarget struct Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 14/17] fuzz: add generic-fuzz configs for oss-fuzz Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 15/17] fuzz: register predefined generic-fuzz configs Alexander Bulekov
2020-10-23 15:07 ` [PATCH v7 16/17] scripts/oss-fuzz: use hardlinks instead of copying Alexander Bulekov
2020-10-23 16:02   ` Darren Kenny [this message]
2020-10-23 15:07 ` [PATCH v7 17/17] scripts/oss-fuzz: ignore the generic-fuzz target Alexander Bulekov
2020-10-23 16:03   ` Darren Kenny
2020-10-26  8:53   ` Thomas Huth

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

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

  git send-email \
    --in-reply-to=m2sga5lyl7.fsf@oracle.com \
    --to=darren.kenny@oracle.com \
    --cc=alxndr@bu.edu \
    --cc=bsd@redhat.com \
    --cc=dimastep@yandex-team.ru \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.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.
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 NNTP newsgroup(s).