[PATCH 8/8] docker: test-debug: disable LeakSanitizer

Paolo Bonzini posted 8 patches 6 years, 2 months ago
Maintainers: Fam Zheng <fam@euphon.net>, Aleksandar Markovic <amarkovic@wavecomp.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Thomas Huth <huth@tuxfamily.org>, Helge Deller <deller@gmx.de>, John Snow <jsnow@redhat.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Richard Henderson <rth@twiddle.net>, Aleksandar Rikalo <arikalo@wavecomp.com>, Michael Walle <michael@walle.cc>, "Hervé Poussineau" <hpoussin@reactos.org>, "Alex Bennée" <alex.bennee@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>
[PATCH 8/8] docker: test-debug: disable LeakSanitizer
Posted by Paolo Bonzini 6 years, 2 months ago
There are just too many leaks in device-introspect-test (especially for
the plethora of arm and aarch64 boards) to make LeakSanitizer useful;
disable it for now.

Whoever is interested in debugging leaks can also use valgrind like this:

   QTEST_QEMU_BINARY=aarch64-softmmu/qemu-system-aarch64 \
   QTEST_QEMU_IMG=qemu-img \
   valgrind --trace-children=yes --leak-check=full \
   tests/device-introspect-test -p /aarch64/device/introspect/concrete/defaults/none

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/docker/test-debug | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/docker/test-debug b/tests/docker/test-debug
index 137f4f2..c050fa0 100755
--- a/tests/docker/test-debug
+++ b/tests/docker/test-debug
@@ -21,6 +21,7 @@ cd "$BUILD_DIR"
 OPTS="--cxx=clang++ --cc=clang --host-cc=clang"
 OPTS="--enable-debug --enable-sanitizers $OPTS"
 
+export ASAN_OPTIONS=detect_leaks=0
 build_qemu $OPTS
 check_qemu check V=1
 install_qemu
-- 
1.8.3.1


Re: [PATCH 8/8] docker: test-debug: disable LeakSanitizer
Posted by Philippe Mathieu-Daudé 6 years, 2 months ago
On 10/1/19 3:36 PM, Paolo Bonzini wrote:
> There are just too many leaks in device-introspect-test (especially for
> the plethora of arm and aarch64 boards) to make LeakSanitizer useful;
> disable it for now.
> 
> Whoever is interested in debugging leaks can also use valgrind like this:
> 
>     QTEST_QEMU_BINARY=aarch64-softmmu/qemu-system-aarch64 \
>     QTEST_QEMU_IMG=qemu-img \
>     valgrind --trace-children=yes --leak-check=full \
>     tests/device-introspect-test -p /aarch64/device/introspect/concrete/defaults/none
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   tests/docker/test-debug | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/tests/docker/test-debug b/tests/docker/test-debug
> index 137f4f2..c050fa0 100755
> --- a/tests/docker/test-debug
> +++ b/tests/docker/test-debug
> @@ -21,6 +21,7 @@ cd "$BUILD_DIR"
>   OPTS="--cxx=clang++ --cc=clang --host-cc=clang"
>   OPTS="--enable-debug --enable-sanitizers $OPTS"
>   
> +export ASAN_OPTIONS=detect_leaks=0
>   build_qemu $OPTS
>   check_qemu check V=1
>   install_qemu
> 

Can we reduce it only for the arm/aarch64 targets?

Re: [PATCH 8/8] docker: test-debug: disable LeakSanitizer
Posted by Paolo Bonzini 6 years, 2 months ago
On 01/10/19 15:59, Philippe Mathieu-Daudé wrote:
> On 10/1/19 3:36 PM, Paolo Bonzini wrote:
>> There are just too many leaks in device-introspect-test (especially for
>> the plethora of arm and aarch64 boards) to make LeakSanitizer useful;
>> disable it for now.
>>
>> Whoever is interested in debugging leaks can also use valgrind like this:
>>
>>     QTEST_QEMU_BINARY=aarch64-softmmu/qemu-system-aarch64 \
>>     QTEST_QEMU_IMG=qemu-img \
>>     valgrind --trace-children=yes --leak-check=full \
>>     tests/device-introspect-test -p
>> /aarch64/device/introspect/concrete/defaults/none
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>   tests/docker/test-debug | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/tests/docker/test-debug b/tests/docker/test-debug
>> index 137f4f2..c050fa0 100755
>> --- a/tests/docker/test-debug
>> +++ b/tests/docker/test-debug
>> @@ -21,6 +21,7 @@ cd "$BUILD_DIR"
>>   OPTS="--cxx=clang++ --cc=clang --host-cc=clang"
>>   OPTS="--enable-debug --enable-sanitizers $OPTS"
>>   +export ASAN_OPTIONS=detect_leaks=0
>>   build_qemu $OPTS
>>   check_qemu check V=1
>>   install_qemu
> 
> Can we reduce it only for the arm/aarch64 targets?

Not easily, since check_qemu runs tests for all targets.  It's not
possible AFAICT to set ASAN_OPTIONS from inside the test, for example.

Paolo