]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: tinfo: add a new thread flag to indicate a call from a sig handler
authorWilly Tarreau <w@1wt.eu>
Fri, 21 Feb 2025 15:26:24 +0000 (16:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 21 Feb 2025 16:41:38 +0000 (17:41 +0100)
commitddd173355c9c7452ff6ec317c8be6195d25dba2a
treeab0ce84a3c01be944ef7a6a95eaa8c085b3d15bb
parenta56dfbdcb4cb3eb9ffd3db641efb3e5605a6c3f0
MINOR: tinfo: add a new thread flag to indicate a call from a sig handler

Signal handlers must absolutely not change anything, but some long and
complex call chains may look innocuous at first glance, yet result in
some subtle write accesses (e.g. pools) that can conflict with a running
thread being interrupted.

Let's add a new thread flag TH_FL_IN_SIG_HANDLER that is only set when
entering a signal handler and cleared when leaving them. Note, we're
speaking about real signal handlers (synchronous ones), not deferred
ones. This will allow some sensitive call places to act differently
when detecting such a condition, and possibly even to place a few new
BUG_ON().
include/haproxy/tinfo-t.h
src/debug.c
src/signal.c
src/wdt.c