+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_context);
+
+// The name of this function is currently hardcoded in MC (as string).
+// Do not change it without fixing those references as well.
+void smx_ctx_wrapper(simgrid::kernel::context::SwappedContext* context)
+{
+#if HAVE_SANITIZER_ADDRESS_FIBER_SUPPORT
+ __sanitizer_finish_switch_fiber(nullptr, &context->asan_ctx_->asan_stack_, &context->asan_ctx_->asan_stack_size_);
+#endif
+ try {
+ (*context)();
+ context->Context::stop();
+ } catch (simgrid::ForcefulKillException const&) {
+ XBT_DEBUG("Caught a ForcefulKillException");
+ } catch (simgrid::Exception const& e) {
+ XBT_INFO("Actor killed by an uncaught exception %s", boost::core::demangle(typeid(e).name()).c_str());
+ throw;
+ }
+#if HAVE_SANITIZER_ADDRESS_FIBER_SUPPORT
+ context->asan_stop_ = true;
+#endif
+ context->suspend();
+ THROW_IMPOSSIBLE;
+}