diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-01-16 16:11:52 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-02-07 14:09:24 +0100 |
commit | d83414e1fd1941ca8228b5cf6a06697bd1ff7f83 (patch) | |
tree | 98c3ab60afc07fc2d5abed2ef243e774d0c1e2b1 /include/qemu/compiler.h | |
parent | 247724cb302af5d70c8853154b640dfabf2bbb56 (diff) | |
download | qemu-d83414e1fd1941ca8228b5cf6a06697bd1ff7f83.zip qemu-d83414e1fd1941ca8228b5cf6a06697bd1ff7f83.tar.gz qemu-d83414e1fd1941ca8228b5cf6a06697bd1ff7f83.tar.bz2 |
ucontext: annotate coroutine stack for ASAN
It helps ASAN to detect more leaks on coroutine stacks, and to get rid
of some extra warnings.
Before:
tests/test-coroutine -p
/basic/lifecycle
/basic/lifecycle: ==20781==WARNING: ASan doesn't fully support
makecontext/swapcontext functions and may produce false positives in
some cases!
==20781==WARNING: ASan is ignoring requested __asan_handle_no_return:
stack top: 0x7ffcb184d000; bottom 0x7ff6c4cfd000; size: 0x0005ecb50000
(25446121472)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
OK
After:
tests/test-coroutine -p /basic/lifecycle
/basic/lifecycle: ==21110==WARNING: ASan doesn't fully support
makecontext/swapcontext functions and may produce false positives in
some cases!
OK
A similar work would need to be done for sigaltstack & windows fibers
to have similar coverage. Since ucontext is preferred, I didn't bother
checking the other coroutine implementations for now.
Update travis to fix the build with ASAN annotations.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180116151152.4040-4-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qemu/compiler.h')
-rw-r--r-- | include/qemu/compiler.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 340e5fd..5fcc4f7 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -111,4 +111,8 @@ #define GCC_FMT_ATTR(n, m) #endif +#ifndef __has_feature +#define __has_feature(x) 0 /* compatibility with non-clang compilers */ +#endif + #endif /* COMPILER_H */ |