Blame SOURCES/0001-main-Dump-stack-on-segfaults-by-default.patch

0999a2
From f54c3f9f66001c210e10fda6aa17b9218fb67dc1 Mon Sep 17 00:00:00 2001
0999a2
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
0999a2
Date: Thu, 29 Oct 2020 18:21:06 +0100
0999a2
Subject: [PATCH] main: Dump stack on segfaults by default
0999a2
0999a2
---
0999a2
 src/main.c | 8 ++++++--
0999a2
 1 file changed, 6 insertions(+), 2 deletions(-)
0999a2
0999a2
diff --git a/src/main.c b/src/main.c
0999a2
index 5d07a4301..ed0b78dcc 100644
0999a2
--- a/src/main.c
0999a2
+++ b/src/main.c
0999a2
@@ -38,6 +38,7 @@ static int caught_signal = 0;
0999a2
 #define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1
0999a2
 #define DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER 4
0999a2
 
0999a2
+#define DEFAULT_SHELL_DEBUG SHELL_DEBUG_BACKTRACE_SEGFAULTS
0999a2
 enum {
0999a2
   SHELL_DEBUG_BACKTRACE_WARNINGS = 1,
0999a2
   SHELL_DEBUG_BACKTRACE_SEGFAULTS = 2,
0999a2
@@ -279,8 +280,11 @@ shell_init_debug (const char *debug_env)
0999a2
     { "backtrace-segfaults", SHELL_DEBUG_BACKTRACE_SEGFAULTS },
0999a2
   };
0999a2
 
0999a2
-  _shell_debug = g_parse_debug_string (debug_env, keys,
0999a2
-                                       G_N_ELEMENTS (keys));
0999a2
+  if (debug_env)
0999a2
+    _shell_debug = g_parse_debug_string (debug_env, keys,
0999a2
+                                         G_N_ELEMENTS (keys));
0999a2
+  else
0999a2
+    _shell_debug = DEFAULT_SHELL_DEBUG;
0999a2
 }
0999a2
 
0999a2
 static void
0999a2
-- 
0999a2
2.31.1
0999a2