Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Asan sometimes chokes on RUNNING_ON_VALGRIND. Workaround by changing the test.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 30 Apr 2021 09:03:12 +0000 (11:03 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 30 Apr 2021 09:05:38 +0000 (11:05 +0200)
src/kernel/context/ContextSwapped.cpp
src/kernel/context/ContextSwapped.hpp

index 35e8d89..177c54a 100644 (file)
@@ -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
 
index 47921c1..7677850 100644 (file)
@@ -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;