All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Thomas Huth <thuth@redhat.com>
Cc: darren.kenny@oracle.com, qemu-devel@nongnu.org,
	Wainer dos Santos Moschetta <wainersm@redhat.com>,
	Alexander Bulekov <alxndr@bu.edu>,
	bsd@redhat.com, stefanha@redhat.com, pbonzini@redhat.com,
	philmd@redhat.com
Subject: Re: [PATCH] gitlab-ci.yml: Add oss-fuzz build tests
Date: Fri, 17 Jul 2020 09:30:55 +0100	[thread overview]
Message-ID: <87pn8uv8zk.fsf@linaro.org> (raw)
In-Reply-To: <75839163-5e7c-3ff4-6d89-870d69ea5979@redhat.com>


Thomas Huth <thuth@redhat.com> writes:

> On 16/07/2020 18.33, Alexander Bulekov wrote:
>> This tries to build and run the fuzzers with the same build-script used
>> by oss-fuzz. This doesn't guarantee that the builds on oss-fuzz will
>> also succeed, since oss-fuzz provides its own compiler and fuzzer vars,
>> but it can catch changes that are not compatible with the the
>> ./scripts/oss-fuzz/build.sh script.
>> The strange way of finding fuzzer binaries stems from the method used by
>> oss-fuzz:
>> https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-runner/targets_list
>> 
>> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
>> ---
>> 
>> Similar to Thomas' patch:
>> 
>>> Note: This patch needs two other patches merged first to work correctly:
>> 
>>> - 'fuzz: Expect the cmdline in a freeable GString' from Alexander
>> 
>>> - 'qom: Plug memory leak in "info qom-tree"' from Markus
>> 
>> Otherwise the test will fail due to detected memory leaks.
>> 
>> Fair warning: I haven't been able to trigger this new job yet. I tried
>> to run the pipeline with these changes on my forked repo on gitlab, but
>> did not reach the build-oss-fuzz. I think this is due to some failures
>> in the Containers-layer-2 stage:
>> 
>> ...
>> Error response from daemon: manifest for
>> registry.gitlab.com/a1xndr/qemu/qemu/debian-all-test-cross:latest not
>> found: manifest unknown: manifest unknown
>> #2 [internal] load .dockerignore
>> #2 transferring context:
>> #2 transferring context: 2B 0.1s done
>> #2 DONE 0.1s
>> #1 [internal] load build definition from tmpg8j4xoop.docker
>> #1 transferring dockerfile: 2.21kB 0.1s done
>> #1 DONE 0.2s
>> #3 [internal] load metadata for docker.io/qemu/debian10:latest
>> #3 ERROR: pull access denied, repository does not exist or may require
>> authorization: server message: insufficient_scope: authorization failed
>
> These look like the problems that we've seen with the main repo until
> two days ago, too, e.g.:
>
>  https://gitlab.com/qemu-project/qemu/-/jobs/640410842
>
> Maybe Alex (Bennée) can comment on how to resolve them?

It all should be working now the qemu-project container repository has
been properly seeded:

  https://gitlab.com/qemu-project/qemu/container_registry

>
>> 
>>  .gitlab-ci.yml | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>> 
>> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
>> index e96f8794b9..a50df420c9 100644
>> --- a/.gitlab-ci.yml
>> +++ b/.gitlab-ci.yml
>> @@ -182,6 +182,20 @@ build-fuzzer:
>>              || exit 1 ;
>>        done
>
> As mentioned in my other mail, I think you can replace my build-fuzzer
> job once this is working.
>
>> +build-oss-fuzz:
>> +  <<: *native_build_job_definition
>> +  variables:
>> +    IMAGE: fedora
>> +  script:
>> +    - OUT_DIR="./build" CC=clang-9 CXX=clang++-9 CFLAGS="-fsanitize=address"
>> +      LIB_FUZZING_ENGINE="-fsanitize=fuzzer" CFL
>
> That "CFL" at the end seems to be a typo (leftover from "CFLAGS")?
>
> Also the fedora container does not have clang-9 :
>
>  https://gitlab.com/huth/qemu/-/jobs/643383032#L28
>
> I think it is at clang 10 already, so maybe just use CC=clang (without
> version number)?

I think all the clang-10 fixes are in now so yes.

>
>> +      ./scripts/oss-fuzz/build.sh
>> +    - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f); do
>> +        grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
>> +        echo Testing ${fuzzer} ... ;
>> +        "${fuzzer}" -runs=1000 || exit 1 ;
>> +      done
>
> Should we exclude the virtio-net tests, since they could leak network
> traffic to the host?
>
>  Thomas


-- 
Alex Bennée


  parent reply	other threads:[~2020-07-17  8:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 16:33 [PATCH] gitlab-ci.yml: Add oss-fuzz build tests Alexander Bulekov
2020-07-17  5:40 ` Thomas Huth
2020-07-17  7:51   ` Thomas Huth
2020-07-17 13:20     ` Alexander Bulekov
2020-07-17 15:39       ` Thomas Huth
2020-07-17  8:30   ` Alex Bennée [this message]
2020-07-17 13:03   ` Alexander Bulekov

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=87pn8uv8zk.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=alxndr@bu.edu \
    --cc=bsd@redhat.com \
    --cc=darren.kenny@oracle.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    --cc=wainersm@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.