]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: debug: report applet pointer and handler in crashes when known
authorWilly Tarreau <w@1wt.eu>
Fri, 2 Sep 2022 07:13:12 +0000 (09:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 2 Sep 2022 13:48:10 +0000 (15:48 +0200)
When an appctx is found looping over itself, we report a number of info
but not the pointers to the definition nor the handler, which can be quite
handy in some cases. Let's add them and try to decode the symbol.

src/stream.c

index 4208885f9d3237f0764211e366540c51b7bd4191..49844c7f2ff8f687c2fad0798c0b30a9bfc47714 100644 (file)
@@ -2829,6 +2829,18 @@ void stream_dump_and_crash(enum obj_type *obj, int rate)
        }
        chunk_appendf(&trash, "}");
 
+       if (ptr != s) { // that's an appctx
+               const struct appctx *appctx = ptr;
+
+               chunk_appendf(&trash, " applet=%p(", appctx->applet);
+               resolve_sym_name(&trash, NULL, appctx->applet);
+               chunk_appendf(&trash, ")");
+
+               chunk_appendf(&trash, " handler=%p(", appctx->applet->fct);
+               resolve_sym_name(&trash, NULL, appctx->applet->fct);
+               chunk_appendf(&trash, ")");
+       }
+
        memprintf(&msg,
                  "A bogus %s [%p] is spinning at %d calls per second and refuses to die, "
                  "aborting now! Please report this error to developers "