MEDIUM: debug: now always print a backtrace on CRASH_NOW() and friends
authorWilly Tarreau <w@1wt.eu>
Fri, 22 Jan 2021 13:15:46 +0000 (14:15 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 22 Jan 2021 13:18:34 +0000 (14:18 +0100)
commit5baf4fe31ad2a5b1e0402c0a6d580dda203a2dab
tree9d660460b504a7c879c6a1e7ad7986689ee59818
parenta8459b28c32c95898916c073b5ffb616eb86862f
MEDIUM: debug: now always print a backtrace on CRASH_NOW() and friends

The purpose is to enable the dumping of a backtrace on BUG_ON(). While
it's very useful to know that a condition was met, very often some
caller context is missing to figure how the condition could happen.
From now on, on systems featuring backtrace, a backtrace of the calling
thread will also be dumped to stderr in addition to the unexpected
condition. This will help users of DEBUG_STRICT as they'll most often
find this backtrace in their logs even if they can't find their core
file.

A new "debug dev bug" expert-mode CLI command was added to test the
feature.
include/haproxy/bug.h
src/debug.c