Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
A simcall on Actor destruction doesn't make much sense.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 9 Jan 2020 14:33:21 +0000 (15:33 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 9 Jan 2020 14:35:53 +0000 (15:35 +0100)
This fixes Asan errors on s4u-actor-kill.

src/kernel/actor/ActorImpl.cpp

index ee550fd..d9ef6c1 100644 (file)
@@ -60,13 +60,8 @@ ActorImpl::ActorImpl(xbt::string name, s4u::Host* host) : host_(host), name_(std
 
 ActorImpl::~ActorImpl()
 {
-  if (simix_global != nullptr && this != simix_global->maestro_) {
-    if (context_.get() != nullptr) /* the actor was not start()ed yet. This happens if its host was initially off */
-      context_->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops
-    actor::simcall([this] { s4u::Actor::on_destruction(*ciface()); });
-    if (context_.get() != nullptr)
-      context_->iwannadie = true;
-  }
+  if (simix_global != nullptr && this != simix_global->maestro_)
+    s4u::Actor::on_destruction(*ciface());
 }
 
 /* Become an actor in the simulation