MINOR: tools: protect dladdr() against reentrant calls from the debug handler
authorWilly Tarreau <w@1wt.eu>
Fri, 4 Apr 2025 16:08:45 +0000 (18:08 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 17 Apr 2025 15:04:35 +0000 (17:04 +0200)
commited4d970d851955ac65a7152d4147f7d07981bdf1
tree020e09ad2c4ba4a1685dd9d09d95612b11c6e780
parent86d6b398d481d0d60bed9e509659e6722ce66b15
MINOR: tools: protect dladdr() against reentrant calls from the debug handler

If a thread is currently resolving a symbol while another thread triggers
a thread dump, the current thread may enter the debug handler and call
resolve_sym_addr() again, possibly deadlocking if the underlying libc
uses locking. Let's postpone the debug signal delivery in this area
during the call. This will slow the resolution a little bit but we don't
care, it's not supposed to happen often and it must remain rock-solid.

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