From: Willy Tarreau Date: Fri, 17 May 2019 08:39:47 +0000 (+0200) Subject: BUG/MINOR: debug: make ha_task_dump() always check the task before dumping it X-Git-Tag: v2.0-dev4~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=231ec395c104d07939a3da143498357533c3e43e;p=thirdparty%2Fhaproxy.git BUG/MINOR: debug: make ha_task_dump() always check the task before dumping it For now it cannot happen since we're calling it from a task but it will break with signals. No backport is needed. --- diff --git a/src/debug.c b/src/debug.c index 54f91d6238..47bf6e53bb 100644 --- a/src/debug.c +++ b/src/debug.c @@ -75,6 +75,11 @@ void ha_thread_dump(int thr) */ void ha_task_dump(const struct task *task, const char *pfx) { + if (!curr_task) { + chunk_appendf(&trash, "0\n"); + return; + } + chunk_appendf(&trash, "%p (%s) calls=%u last=%llu%s\n", curr_task, TASK_IS_TASKLET(curr_task) ? "tasklet" : "task",