diff --git a/smocore/marionette/marionette.cpp b/smocore/marionette/marionette.cpp index a2a9872..9d6904f 100644 --- a/smocore/marionette/marionette.cpp +++ b/smocore/marionette/marionette.cpp @@ -49,12 +49,22 @@ void ComponentThread::marionetteMain(ComponentThread& self) bool callFinalizeReq = false; try { - // Register SIGINT (Ctrl+C) handler to request user shutdown + // Register SIGINT (Ctrl+C) and SIGSEGV handlers signals.async_wait( - [&self](const boost::system::error_code& ec, int /*signal*/) + [&self](const boost::system::error_code& ec, int signal) { if (ec) { return; } - // Post user shutdown indication + + switch (signal) { + case SIGINT: + std::cerr << "SIGINT (Ctrl+C) received. Initiating shutdown..." << std::endl; + break; + case SIGSEGV: + std::cerr << "FATAL: Segmentation fault detected. Initiating shutdown..." << std::endl; + break; + default: + break; + } self.userShutdownInd(); } );