[Qemu-devel] [PATCH v3 00/18] Various build-sys and sanitizer related fixes

Marc-André Lureau posted 18 patches 7 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180104160523.22995-1-marcandre.lureau@redhat.com
Test checkpatch failed
Test docker passed
Test ppc passed
Test s390x passed
include/qemu/compiler.h                |  4 +++
include/qemu/readline.h                |  1 +
crypto/ivgen-essiv.c                   |  2 +-
disas/s390.c                           | 16 +++++-------
hw/nvram/ds1225y.c                     |  4 +--
monitor.c                              |  2 +-
tests/check-qobject.c                  |  2 ++
tests/migration-test.c                 |  3 ++-
tests/qmp-test.c                       |  3 ++-
tests/test-coroutine.c                 |  1 -
util/coroutine-ucontext.c              | 46 ++++++++++++++++++++++++++++++++++
util/qemu-config.c                     |  3 ++-
util/readline.c                        | 18 ++++++++++++-
vl.c                                   |  9 ++++---
Makefile                               |  7 ++++--
configure                              | 23 +++++++++++++++--
docs/devel/build-system.txt            | 13 ++++++++++
rules.mak                              |  2 ++
tests/docker/dockerfiles/fedora.docker |  4 +--
tests/docker/test-clang                |  2 +-
tests/docker/test-debug                | 26 +++++++++++++++++++
tests/docker/test-mingw                |  2 --
22 files changed, 162 insertions(+), 31 deletions(-)
create mode 100755 tests/docker/test-debug
[Qemu-devel] [PATCH v3 00/18] Various build-sys and sanitizer related fixes
Posted by Marc-André Lureau 7 years, 9 months ago
Hi,

This is a series that improves a bit the build system, and introduces
ASAN/UBSan by default when --enable-debug. Then it fixes a few leaks
that occur during make check: common and x86_64 target tests are leak
free after this series. The other targets will need some work to fix
the leaks & warnings.

v3:
- add ubsan too with --enable-debug, since it is recommended and has
  low runtime cost
- add a patch "compile with -Og or -O1 when --enable-debug", suggested
  by Paolo
- add 2 new fixes to pass full make check with asan/ubsan
- modify docker tests to run --enable-debug & asan with new test-debug
- add some r-b/a-b tags

v2:
- simplify "build-sys: silence make by default or V=0": make it a
  oneliner MAKEFLAGS, use --quiet.
- document print-VAR rule in docs/devel/build-system.txt
- fix ASAN coroutine instrumentation failure
- should fix builds on gcc 4.4.7 (centos 6)
- new coroutine test leak fix
- add some r-b tags

Marc-André Lureau (18):
  build-sys: fix qemu-ga -pthread linking
  build-sys: silence make by default or V=0
  build-sys: add a rule to print a variable
  build-sys: compile with -Og or -O1 when --enable-debug
  tests/docker: add some sanitizers to fedora dockerfile
  tests/docker: add test-debug
  build-sys: add some sanitizers when --enable-debug if possible
  tests: fix check-qobject leak
  vl: fix direct firmware directories leak
  readline: add a free function
  tests: fix migration-test leak
  crypto: fix stack-buffer-overflow error
  qemu-config: fix leak in query-command-line-options
  tests: fix qmp-test leak
  ucontext: annotate coroutine stack for ASAN
  tests: fix coroutine leak in /basic/entered
  mips: fix potential fopen(NULL,...)
  disas/s390: fix global-buffer-overflow

 include/qemu/compiler.h                |  4 +++
 include/qemu/readline.h                |  1 +
 crypto/ivgen-essiv.c                   |  2 +-
 disas/s390.c                           | 16 +++++-------
 hw/nvram/ds1225y.c                     |  4 +--
 monitor.c                              |  2 +-
 tests/check-qobject.c                  |  2 ++
 tests/migration-test.c                 |  3 ++-
 tests/qmp-test.c                       |  3 ++-
 tests/test-coroutine.c                 |  1 -
 util/coroutine-ucontext.c              | 46 ++++++++++++++++++++++++++++++++++
 util/qemu-config.c                     |  3 ++-
 util/readline.c                        | 18 ++++++++++++-
 vl.c                                   |  9 ++++---
 Makefile                               |  7 ++++--
 configure                              | 23 +++++++++++++++--
 docs/devel/build-system.txt            | 13 ++++++++++
 rules.mak                              |  2 ++
 tests/docker/dockerfiles/fedora.docker |  4 +--
 tests/docker/test-clang                |  2 +-
 tests/docker/test-debug                | 26 +++++++++++++++++++
 tests/docker/test-mingw                |  2 --
 22 files changed, 162 insertions(+), 31 deletions(-)
 create mode 100755 tests/docker/test-debug

-- 
2.15.1.355.g36791d7216


Re: [Qemu-devel] [PATCH v3 00/18] Various build-sys and sanitizer related fixes
Posted by no-reply@patchew.org 7 years, 9 months ago
Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20180104160523.22995-1-marcandre.lureau@redhat.com
Subject: [Qemu-devel] [PATCH v3 00/18] Various build-sys and sanitizer related fixes

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 t [tag update]            patchew/20180104160523.22995-1-marcandre.lureau@redhat.com -> patchew/20180104160523.22995-1-marcandre.lureau@redhat.com
 * [new tag]               patchew/20180104163652.65450-1-marcel@redhat.com -> patchew/20180104163652.65450-1-marcel@redhat.com
Switched to a new branch 'test'
96cafa2be4 disas/s390: fix global-buffer-overflow
4245ebd52a mips: fix potential fopen(NULL,...)
3bacf5b2ac tests: fix coroutine leak in /basic/entered
d40798477c ucontext: annotate coroutine stack for ASAN
2bd3966455 tests: fix qmp-test leak
919691db5a qemu-config: fix leak in query-command-line-options
736e215840 crypto: fix stack-buffer-overflow error
55ff41af25 tests: fix migration-test leak
e80f140372 readline: add a free function
645e97ba93 vl: fix direct firmware directories leak
6c79d4befa tests: fix check-qobject leak
ff1f9a1136 build-sys: add some sanitizers when --enable-debug if possible
2c8797bcad tests/docker: add test-debug
448f1c05e1 tests/docker: add some sanitizers to fedora dockerfile
7a1cf8e3a8 build-sys: compile with -Og or -O1 when --enable-debug
5085640b16 build-sys: add a rule to print a variable
2436eb64e1 build-sys: silence make by default or V=0
34bc0f9b4b build-sys: fix qemu-ga -pthread linking

=== OUTPUT BEGIN ===
Checking PATCH 1/18: build-sys: fix qemu-ga -pthread linking...
Checking PATCH 2/18: build-sys: silence make by default or V=0...
Checking PATCH 3/18: build-sys: add a rule to print a variable...
Checking PATCH 4/18: build-sys: compile with -Og or -O1 when --enable-debug...
Checking PATCH 5/18: tests/docker: add some sanitizers to fedora dockerfile...
Checking PATCH 6/18: tests/docker: add test-debug...
Checking PATCH 7/18: build-sys: add some sanitizers when --enable-debug if possible...
Checking PATCH 8/18: tests: fix check-qobject leak...
Checking PATCH 9/18: vl: fix direct firmware directories leak...
Checking PATCH 10/18: readline: add a free function...
Checking PATCH 11/18: tests: fix migration-test leak...
Checking PATCH 12/18: crypto: fix stack-buffer-overflow error...
Checking PATCH 13/18: qemu-config: fix leak in query-command-line-options...
Checking PATCH 14/18: tests: fix qmp-test leak...
Checking PATCH 15/18: ucontext: annotate coroutine stack for ASAN...
WARNING: architecture specific defines should be avoided
#29: FILE: include/qemu/compiler.h:114:
+#ifndef __has_feature

WARNING: architecture specific defines should be avoided
#42: FILE: util/coroutine-ucontext.c:34:
+#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer)

total: 0 errors, 2 warnings, 107 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 16/18: tests: fix coroutine leak in /basic/entered...
Checking PATCH 17/18: mips: fix potential fopen(NULL,...)...
Checking PATCH 18/18: disas/s390: fix global-buffer-overflow...
ERROR: braces {} are necessary even for single statement blocks
#83: FILE: disas/s390.c:216:
+  for (i = s390_num_opcodes; i--; )
+    opc_index[s390_opcodes[i].opcode[0]] = i;

total: 1 errors, 0 warnings, 24 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org
Re: [Qemu-devel] [PATCH v3 00/18] Various build-sys and sanitizer related fixes
Posted by Paolo Bonzini 7 years, 9 months ago
On 04/01/2018 17:05, Marc-André Lureau wrote:
> Hi,
> 
> This is a series that improves a bit the build system, and introduces
> ASAN/UBSan by default when --enable-debug. Then it fixes a few leaks
> that occur during make check: common and x86_64 target tests are leak
> free after this series. The other targets will need some work to fix
> the leaks & warnings.
> 
> v3:
> - add ubsan too with --enable-debug, since it is recommended and has
>   low runtime cost
> - add a patch "compile with -Og or -O1 when --enable-debug", suggested
>   by Paolo
> - add 2 new fixes to pass full make check with asan/ubsan
> - modify docker tests to run --enable-debug & asan with new test-debug
> - add some r-b/a-b tags
> 
> v2:
> - simplify "build-sys: silence make by default or V=0": make it a
>   oneliner MAKEFLAGS, use --quiet.
> - document print-VAR rule in docs/devel/build-system.txt
> - fix ASAN coroutine instrumentation failure
> - should fix builds on gcc 4.4.7 (centos 6)
> - new coroutine test leak fix
> - add some r-b tags
> 
> Marc-André Lureau (18):
>   build-sys: fix qemu-ga -pthread linking
>   build-sys: silence make by default or V=0
>   build-sys: add a rule to print a variable
>   build-sys: compile with -Og or -O1 when --enable-debug
>   tests/docker: add some sanitizers to fedora dockerfile
>   tests/docker: add test-debug
>   build-sys: add some sanitizers when --enable-debug if possible
>   tests: fix check-qobject leak
>   vl: fix direct firmware directories leak
>   readline: add a free function
>   tests: fix migration-test leak
>   crypto: fix stack-buffer-overflow error
>   qemu-config: fix leak in query-command-line-options
>   tests: fix qmp-test leak
>   ucontext: annotate coroutine stack for ASAN
>   tests: fix coroutine leak in /basic/entered
>   mips: fix potential fopen(NULL,...)
>   disas/s390: fix global-buffer-overflow
> 
>  include/qemu/compiler.h                |  4 +++
>  include/qemu/readline.h                |  1 +
>  crypto/ivgen-essiv.c                   |  2 +-
>  disas/s390.c                           | 16 +++++-------
>  hw/nvram/ds1225y.c                     |  4 +--
>  monitor.c                              |  2 +-
>  tests/check-qobject.c                  |  2 ++
>  tests/migration-test.c                 |  3 ++-
>  tests/qmp-test.c                       |  3 ++-
>  tests/test-coroutine.c                 |  1 -
>  util/coroutine-ucontext.c              | 46 ++++++++++++++++++++++++++++++++++
>  util/qemu-config.c                     |  3 ++-
>  util/readline.c                        | 18 ++++++++++++-
>  vl.c                                   |  9 ++++---
>  Makefile                               |  7 ++++--
>  configure                              | 23 +++++++++++++++--
>  docs/devel/build-system.txt            | 13 ++++++++++
>  rules.mak                              |  2 ++
>  tests/docker/dockerfiles/fedora.docker |  4 +--
>  tests/docker/test-clang                |  2 +-
>  tests/docker/test-debug                | 26 +++++++++++++++++++
>  tests/docker/test-mingw                |  2 --
>  22 files changed, 162 insertions(+), 31 deletions(-)
>  create mode 100755 tests/docker/test-debug
> 

Queued, thanks.

Paolo