Skip to contentSkip to conversation

ucontext: annotate coroutine stack for ASAN

PATCH In review Marc-André Lureau 2 participants 2 messages Jan 12, 2018 – Jan 15, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 ucontext: annotate coroutine stack for ASAN

It helps ASAN to detect more leaks on coroutine stacks, as found in the following patch.

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.

---
 include/qemu/compiler.h   |  4 ++++
 util/coroutine-ucontext.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++
 .travis.yml               |  3 ++-
 configure                 | 41 ++++++++++++++++++++++++++++++++++++++--
 4 files changed, 93 insertions(+), 3 deletions(-)
include/qemu/compiler.h +4 -0
index 340e5fdc09..5fcc4f7ec7 100644
@@ -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 */
util/coroutine-ucontext.c +48 -0

101 lines not on this page · raw message

.travis.yml +2 -1
index f583839755..f2291e87a6 100644
@@ -13,12 +13,13 @@ addons:
       - libattr1-dev
       - libbrlapi-dev
       - libcap-ng-dev
+      - libgcc-6-dev
       - libgnutls-dev
       - libgtk-3-dev
       - libiscsi-dev
       - liblttng-ust-dev
-      - libnfs-dev
       - libncurses5-dev
+      - libnfs-dev
       - libnss3-dev
       - libpixman-1-dev
       - libpng12-dev
configure +39 -2

64 lines not on this page · raw message

Signature · 1 line
2.16.0.rc1.1.gef27df75a1
Reviewed-by on v4 1/1
#1 lore raw
Quoted 7 lines · Marc-André Lureau

It helps ASAN to detect more leaks on coroutine stacks, as found in the following patch.

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.

Quoted 7 lines
---
 include/qemu/compiler.h   |  4 ++++
 util/coroutine-ucontext.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++
 .travis.yml               |  3 ++-
 configure                 | 41 ++++++++++++++++++++++++++++++++++++++--
 4 files changed, 93 insertions(+), 3 deletions(-)