]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR debug: fix !USE_THREAD_DUMP in ha_thread_dump_fill()
authorWilly Tarreau <w@1wt.eu>
Thu, 17 Apr 2025 08:28:37 +0000 (10:28 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 17 Apr 2025 14:25:47 +0000 (16:25 +0200)
commit0b56839455c7f45ae58954e1eb3873a3725899dc
tree400f11727638285416d8c8af50b453c7a09510c8
parent337017e2f96deea8e762d968820e575a1c2181b6
BUG/MINOR debug: fix !USE_THREAD_DUMP in ha_thread_dump_fill()

The function must make sure to return NULL for foreign threads and
the local buffer for the current thread in this case, otherwise panics
(and sometimes even warnings) will segfault when USE_THREAD_DUMP is
disabled. Let's slightly re-arrange the function to reduce the #if/else
since we have to specifically handle the case of !USE_THREAD_DUMP anyway.

This needs to be backported wherever b8adef065d ("MEDIUM: debug: on
panic, make the target thread automatically allocate its buf") was
backported (at least 2.8).
src/debug.c