]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: debug: only dump the trace once in __BUG_ON_ONCE()
authorWilly Tarreau <w@1wt.eu>
Fri, 7 Aug 2026 13:06:53 +0000 (15:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 7 Aug 2026 13:06:53 +0000 (15:06 +0200)
commit7a78d6c600a3ab4bd3847fee90f204d976cd360a
treee97c923c2a7484de32306f82825125eab00fb5c5
parent23cf528c76cfbea9dbdf89cd9b885e0398884934
BUG/MINOR: debug: only dump the trace once in __BUG_ON_ONCE()

Amaury found that CHECK_IF() was dumping the stack trace on each call,
which was not the intent. The reason is that complain() performs the
check on the counter, but the decision to dump the stack later is based
on the choice between aborting and dumping. Let's break out of this when
the count is > 1. Under high concurrency it can cause a trace never to
be emitted but this is a detail. The whole thing needs to be redone
more cleanly anyway.

This should be backported to 2.6.
include/haproxy/bug.h