From 9925d6666f930f5510f71ec5d2200b6407bbe988 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 27 Feb 2024 00:08:01 +0100 Subject: [PATCH] [calamares] Improve "crash self" functionality Instead of UB, use POSIX signals and terminate the Calamares process with a recognizable signal number (TRAP, which is highly unusual). --- src/calamares/DebugWindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calamares/DebugWindow.cpp b/src/calamares/DebugWindow.cpp index 7321e9102..5ccab2c92 100644 --- a/src/calamares/DebugWindow.cpp +++ b/src/calamares/DebugWindow.cpp @@ -33,14 +33,15 @@ #include #include +#include + /** * @brief crash makes Calamares crash immediately. */ static void crash() { - volatile int* a = nullptr; - *a = 1; + kill(getpid(), SIGTRAP); } /// @brief Print out the widget tree (names) in indented form.