Skip to contentSkip to conversation

tests: make docker-test-debug@fedora run sanitizers

PATCH In review Marc-André Lureau 3 participants 5 messages Mar 12, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: make docker-test-debug@fedora run sanitizers

Since --enable-debug no longer enable sanitizers, we need explicit --enable-sanitizers.

llvm package is required for llvm-symbolizer, to get symbols in backtraces.

Add make V=1 to get details about failing tests.

---
 tests/docker/dockerfiles/fedora.docker | 2 +-
 tests/docker/test-debug                | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
tests/docker/dockerfiles/fedora.docker +1 -1
index 994a35a332..a00004319e 100644
@@ -2,7 +2,7 @@ FROM fedora:27
 ENV PACKAGES \
     ccache gettext git tar PyYAML sparse flex bison python3 bzip2 hostname \
     glib2-devel pixman-devel zlib-devel SDL-devel libfdt-devel \
-    gcc gcc-c++ clang make perl which bc findutils libaio-devel \
+    gcc gcc-c++ llvm clang make perl which bc findutils libaio-devel \
     nettle-devel libasan libubsan \
     mingw32-pixman mingw32-glib2 mingw32-gmp mingw32-SDL mingw32-pkg-config \
     mingw32-gtk2 mingw32-gtk3 mingw32-gnutls mingw32-nettle mingw32-libtasn1 \
tests/docker/test-debug +3 -3
index d020b06917..d3f9f70d01 100755
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Compile and check with clang & --enable-debug.
+# Compile and check with clang & --enable-debug --enable-sanitizers.
 #
 # Copyright (c) 2016-2018 Red Hat Inc.
 #
@@ -19,8 +19,8 @@ requires clang asan
 cd "$BUILD_DIR"
 
 OPTS="--cxx=clang++ --cc=clang --host-cc=clang"
-OPTS="--enable-debug $OPTS"
+OPTS="--enable-debug --enable-sanitizers $OPTS"
 
 build_qemu $OPTS
-make $MAKEFLAGS check
+make $MAKEFLAGS V=1 check
 install_qemu
Signature · 1 line
2.16.2.346.g9779355e34
#1 lore raw

Hi Fam,

It would be great if patchew could run the debug/sanitizer build. Unfortunately, except x86 target, the run is full of ASAN leaks or warnings.

Do you think patchew could learn to do regression testing? By that I mean that patchew could compare a patchset output with the current master (that output should be cached for multiple tests). The output to compare here would be the errors reported by ASAN during the build. (eventually, this could be used for other metrics some day). If so, would you be willing to help me implementing it?

Quoted 54 lines · Marc-André Lureau

Since --enable-debug no longer enable sanitizers, we need explicit --enable-sanitizers.

llvm package is required for llvm-symbolizer, to get symbols in backtraces.

Add make V=1 to get details about failing tests.

---
 tests/docker/dockerfiles/fedora.docker | 2 +-
 tests/docker/test-debug                | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
tests/docker/dockerfiles/fedora.docker +1 -1
index 994a35a332..a00004319e 100644
@@ -2,7 +2,7 @@ FROM fedora:27
 ENV PACKAGES \
     ccache gettext git tar PyYAML sparse flex bison python3 bzip2 hostname \
     glib2-devel pixman-devel zlib-devel SDL-devel libfdt-devel \
-    gcc gcc-c++ clang make perl which bc findutils libaio-devel \
+    gcc gcc-c++ llvm clang make perl which bc findutils libaio-devel \
     nettle-devel libasan libubsan \
     mingw32-pixman mingw32-glib2 mingw32-gmp mingw32-SDL mingw32-pkg-config \
     mingw32-gtk2 mingw32-gtk3 mingw32-gnutls mingw32-nettle mingw32-libtasn1 \
tests/docker/test-debug +3 -4
index d020b06917..d3f9f70d01 100755
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Compile and check with clang & --enable-debug.
+# Compile and check with clang & --enable-debug --enable-sanitizers.
 #
 # Copyright (c) 2016-2018 Red Hat Inc.
 #
@@ -19,8 +19,8 @@ requires clang asan
 cd "$BUILD_DIR"
 
 OPTS="--cxx=clang++ --cc=clang --host-cc=clang"
-OPTS="--enable-debug $OPTS"
+OPTS="--enable-debug --enable-sanitizers $OPTS"
 
 build_qemu $OPTS
-make $MAKEFLAGS check
+make $MAKEFLAGS V=1 check
 install_qemu
--

2.16.2.346.g9779355e34

Signature · 1 line
Marc-André Lureau
#2 lore raw
Quoted 6 lines · Marc-André Lureau

Hi Fam,

It would be great if patchew could run the debug/sanitizer build. Unfortunately, except x86 target, the run is full of ASAN leaks or warnings.

Quoted 6 lines

Do you think patchew could learn to do regression testing? By that I mean that patchew could compare a patchset output with the current master (that output should be cached for multiple tests). The output to compare here would be the errors reported by ASAN during the build. (eventually, this could be used for other metrics some day). If so, would you be willing to help me implementing it?

The question is can we simply rely on the exit code of cmp or diff for that kind of comparison? If there is any out-of-order texts, that simple diff won't work.

Anything more intelligent/sensible should go as a policy, and patchew should continue focus on mechanisms.

I'll send a pull for the patch. Thanks!

Thanks.

#3 lore raw

Hi

Quoted 14 lines · Fam Zheng
Quoted 6 lines · Marc-André Lureau

Hi Fam,

It would be great if patchew could run the debug/sanitizer build. Unfortunately, except x86 target, the run is full of ASAN leaks or warnings.

Quoted 6 lines

Do you think patchew could learn to do regression testing? By that I mean that patchew could compare a patchset output with the current master (that output should be cached for multiple tests). The output to compare here would be the errors reported by ASAN during the build. (eventually, this could be used for other metrics some day). If so, would you be willing to help me implementing it?

Quoted 2 lines

The question is can we simply rely on the exit code of cmp or diff for that kind of comparison? If there is any out-of-order texts, that simple diff won't work.

If the tests are run sequentially, i think it should produce the same output when run multiple times (to be verified).

However, if there are leaks already, and the address of allocation or symbols change, this may produce diff on existing lines.

What I would like to see is the diff of added (or removed) lines.

I suppose that should be possible, I'll do some experiments.

Quoted 2 lines

Anything more intelligent/sensible should go as a policy, and patchew should continue focus on mechanisms.

hmm ok :)

Quoted 2 lines

I'll send a pull for the patch. Thanks!

thanks

Signature · 1 line
Marc-André Lureau
#4 lore raw
Quoted 17 lines · Marc-André Lureau

Hi

Quoted 14 lines · Fam Zheng
Quoted 12 lines · Marc-André Lureau

Hi Fam,

It would be great if patchew could run the debug/sanitizer build. Unfortunately, except x86 target, the run is full of ASAN leaks or warnings.

Do you think patchew could learn to do regression testing? By that I mean that patchew could compare a patchset output with the current master (that output should be cached for multiple tests). The output to compare here would be the errors reported by ASAN during the build. (eventually, this could be used for other metrics some day). If so, would you be willing to help me implementing it?

Quoted 5 lines
Quoted 2 lines

The question is can we simply rely on the exit code of cmp or diff for that kind of comparison? If there is any out-of-order texts, that simple diff won't work.

If the tests are run sequentially, i think it should produce the same output when run multiple times (to be verified).

In that case the test will last for a long time. Currently patchew isn't very good as multi-tasking. But that is one option we can explore (like we can devote one VM for asan test).

Quoted 3 lines

However, if there are leaks already, and the address of allocation or symbols change, this may produce diff on existing lines.

Maybe we can come up with a 'make docker-test-debug-filtered@fedora' or a relatively simple 'make docker-test-debug@fedora | sed -e "..."' command that can be fed to diff.

Quoted 9 lines

What I would like to see is the diff of added (or removed) lines.

I suppose that should be possible, I'll do some experiments.

Quoted 2 lines

Anything more intelligent/sensible should go as a policy, and patchew should continue focus on mechanisms.

hmm ok :)

Like said above, I think it's possible to postprocess the output to make it easy to diff/cmp. By mechanism/policy I mean the place to draw a line to code Patchew. However patchew has a database where we can write test script snippets (as configurations) that is "the policy".

Fam