BUG/MEDIUM: stream: don't use localtime in dumps from a signal handler
authorWilly Tarreau <w@1wt.eu>
Mon, 24 Feb 2025 10:43:15 +0000 (11:43 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Mar 2025 10:38:00 +0000 (11:38 +0100)
commit861ac05475c76403432bb30ae0e2914cfd155f60
tree84eff8b23402bc00e6bc2bf7162a26d2296e9d1b
parent52d8b01acdc1e21aeda985c87a9ad1229149d3f2
BUG/MEDIUM: stream: don't use localtime in dumps from a signal handler

In issue #2861, Jarosaw Rzeszótko reported another issue with
"show threads", this time in relation with the conversion of a stream's
accept date to local time. Indeed, if the libc was interrupted in this
same function, it could have been interrupted with a lock held, then
it's no longer possible to dump the date, and we face a deadlock.
This is easy to reproduce with logging enabled.

Let's detect we come from a signal handler and do not try to resolve
the time to localtime in this case.

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