It's already called just before the exception is thrown by the stop() method
(SwappedContext or ThreadContext).
Asan likes it better when it's called before throwing the exception.
#endif
try {
(*context)();
#endif
try {
(*context)();
+ context->Context::stop();
} catch (StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
} catch (simgrid::Exception const& e) {
XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
throw;
}
} catch (StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
} catch (simgrid::Exception const& e) {
XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
throw;
}
- context->Context::stop();
ASAN_ONLY(context->asan_stop_ = true);
context->suspend();
}
ASAN_ONLY(context->asan_stop_ = true);
context->suspend();
}
ASAN_FINISH_SWITCH(nullptr, &context->asan_ctx_->asan_stack_, &context->asan_ctx_->asan_stack_size_);
try {
(*context)();
ASAN_FINISH_SWITCH(nullptr, &context->asan_ctx_->asan_stack_, &context->asan_ctx_->asan_stack_size_);
try {
(*context)();
+ context->Context::stop();
} catch (StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
} catch (simgrid::Exception const& e) {
XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
throw;
}
} catch (StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
} catch (simgrid::Exception const& e) {
XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
throw;
}
- context->Context::stop();
-
ASAN_ONLY(context->asan_stop_ = true);
context->suspend();
}
ASAN_ONLY(context->asan_stop_ = true);
context->suspend();
}
+ if (not context->is_maestro()) // Just in case somebody detached maestro
+ context->Context::stop();
} catch (StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
xbt_assert(not context->is_maestro(), "Maestro shall not receive StopRequests, even when detached.");
} catch (StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
xbt_assert(not context->is_maestro(), "Maestro shall not receive StopRequests, even when detached.");
XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
throw;
}
XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
throw;
}
- if (not context->is_maestro()) // Just in case somebody detached maestro
- context->Context::stop();
-
// Signal to the caller (normally the maestro) that we have finished:
context->yield();
// Signal to the caller (normally the maestro) that we have finished:
context->yield();
ASAN_FINISH_SWITCH(nullptr, &context->asan_ctx_->asan_stack_, &context->asan_ctx_->asan_stack_size_);
try {
(*context)();
ASAN_FINISH_SWITCH(nullptr, &context->asan_ctx_->asan_stack_, &context->asan_ctx_->asan_stack_size_);
try {
(*context)();
+ context->Context::stop();
} catch (simgrid::kernel::context::Context::StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
} catch (simgrid::Exception const& e) {
XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
throw;
}
} catch (simgrid::kernel::context::Context::StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
} catch (simgrid::Exception const& e) {
XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
throw;
}
- context->Context::stop();
ASAN_ONLY(context->asan_stop_ = true);
context->suspend();
}
ASAN_ONLY(context->asan_stop_ = true);
context->suspend();
}