MINOR: debug: protect ha_dump_backtrace() against risks of re-entrance
authorWilly Tarreau <w@1wt.eu>
Fri, 4 Apr 2025 16:11:23 +0000 (18:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 17 Apr 2025 15:04:35 +0000 (17:04 +0200)
commitdadad3265e04c13fca71a7a210dbb4bc804fa765
tree7abd73298c2f313da25b31fb0fde7ad679f657e3
parented4d970d851955ac65a7152d4147f7d07981bdf1
MINOR: debug: protect ha_dump_backtrace() against risks of re-entrance

If a thread is dumping itself (warning, show thread etc) and another one
wants to dump the state of all threads (e.g. panic), it may interrupt the
first one during backtrace() and re-enter it from the signal handler,
possibly triggering a deadlock in the underlying libc. Let's postpone
the debug signal delivery at this point until the call ends in order to
avoid this.

(cherry picked from commit d20e9cad6733d9a525ccfad63ef482d6ea63a676)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/debug.c