]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: debug: switch to SIGURG for thread dumps
authorWilly Tarreau <w@1wt.eu>
Wed, 22 May 2019 04:28:54 +0000 (06:28 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 May 2019 09:50:48 +0000 (11:50 +0200)
The current choice of SIGPWR has the adverse effect of stopping gdb each
time it is triggered using "show threads" or example, which is not really
convenient. Let's switch to SIGURG instead, which we don't use either.

src/debug.c

index ba668781e9b5bfa9c4d57040756577e7aa233b24..f26f53dd763b3286a40a2f12b2848ab65b695933 100644 (file)
@@ -388,8 +388,11 @@ void ha_thread_dump_all_to_trash()
 
 #else /* below USE_THREAD_DUMP is set */
 
-/* The signal to trigger a debug dump on a thread is SIGPWR */
-#define DEBUGSIG SIGPWR
+/* The signal to trigger a debug dump on a thread is SIGURG. It has the benefit
+ * of not stopping gdb by default, so that issuing "show threads" in a process
+ * being debugged has no adverse effect.
+ */
+#define DEBUGSIG SIGURG
 
 /* mask of threads still having to dump, used to respect ordering */
 static volatile unsigned long threads_to_dump;