BUG/MEDIUM: debug/lua: Don't dump the lua stack if not dumpable
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 19 Mar 2021 14:41:08 +0000 (15:41 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 23 Mar 2021 08:24:50 +0000 (09:24 +0100)
commit0f1d06d2b4e5586f4e21b25f5daf9100eb674e92
tree862665886103c9d5db4301ebceb0b88e51583a39
parent08aec89f712409b032c490165b9f0fb0e9572164
BUG/MEDIUM: debug/lua: Don't dump the lua stack if not dumpable

When we try to dump the stack of a lua context, if it is not dumpable,
nothing is performed and a message is emitted instead. This happens when a
lua execution was interrupted inside a non-reentrant part.

This patch depends on following commit :

 * MEDIUM: lua: Use a per-thread counter to track some non-reentrant parts of lua

Thanks to this patch, we avoid a possible deadllock if the lua is
interrupted by the watchdog in the lua memory allocator, because realloc()
is not async-signal-safe.

Both patches must be backported as far as 2.0.

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