mirror of
https://github.com/qemu/qemu.git
synced 2026-04-05 21:46:25 +00:00
The oss-fuzz code uses an lsan_suppressions file to suppress certain leak-sanitizer cases that are known issues or not our code's bug. This is useful more widely than just for the fuzzer harness: if you want to build QEMU with the leak sanitizer enabled and run 'make check' then you will want to suppress some bogus leak reports. Move the file up a directory. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Yodel Eldar <yodel.eldar@yodel.dev> Message-id: 20260302092225.4088227-2-peter.maydell@linaro.org
29 lines
800 B
Bash
Executable File
29 lines
800 B
Bash
Executable File
#!/bin/bash -e
|
|
#
|
|
# Compile and check with oss-fuzz.
|
|
#
|
|
# Copyright (c) 2023 Linaro Ltd.
|
|
#
|
|
# Authors:
|
|
# Alex Bennée <alex.bennee@linaro.org>
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
. common.rc
|
|
|
|
requires_binary clang
|
|
|
|
# the build script runs out of $src so we need to copy across
|
|
cd "$BUILD_DIR"
|
|
cp -a $QEMU_SRC .
|
|
cd src
|
|
mkdir build-oss-fuzz
|
|
export LSAN_OPTIONS=suppressions=scripts/lsan_suppressions.txt
|
|
env CC="clang" CXX="clang++" CFLAGS="-fsanitize=address" ./scripts/oss-fuzz/build.sh
|
|
export ASAN_OPTIONS="fast_unwind_on_malloc=0"
|
|
for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f | grep -v slirp); do
|
|
grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
|
|
echo Testing ${fuzzer} ... ;
|
|
"${fuzzer}" -runs=1 -seed=1 || exit 1 ;
|
|
done
|