From: Arnaud Giersch Date: Fri, 30 Apr 2021 09:03:12 +0000 (+0200) Subject: Asan sometimes chokes on RUNNING_ON_VALGRIND. Workaround by changing the test. X-Git-Tag: v3.28~389 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ed1d5b032cd43c1038d7c6f1b024adef777811d7 Asan sometimes chokes on RUNNING_ON_VALGRIND. Workaround by changing the test. --- diff --git a/src/kernel/context/ContextSwapped.cpp b/src/kernel/context/ContextSwapped.cpp index 35e8d89281..177c54a000 100644 --- a/src/kernel/context/ContextSwapped.cpp +++ b/src/kernel/context/ContextSwapped.cpp @@ -147,7 +147,7 @@ SwappedContext::~SwappedContext() __tsan_destroy_fiber(tsan_fiber_); #endif #if HAVE_VALGRIND_H - if (RUNNING_ON_VALGRIND) + if (valgrind_stack_id_ != 0) VALGRIND_STACK_DEREGISTER(valgrind_stack_id_); #endif diff --git a/src/kernel/context/ContextSwapped.hpp b/src/kernel/context/ContextSwapped.hpp index 47921c1718..7677850177 100644 --- a/src/kernel/context/ContextSwapped.hpp +++ b/src/kernel/context/ContextSwapped.hpp @@ -73,7 +73,7 @@ private: SwappedContextFactory& factory_; // for sequential and parallel run_all() #if HAVE_VALGRIND_H - unsigned int valgrind_stack_id_; + unsigned int valgrind_stack_id_ = 0; #endif #if HAVE_SANITIZER_ADDRESS_FIBER_SUPPORT const void* asan_stack_ = nullptr;