BUG/MINOR: debug: don't check the call date on tasklets
tasklets don't have a call date, so when a tasklet is cast into a task
and is present at the end of a page we run a risk of dereferencing
unmapped memory when dumping them in ha_task_dump(). This commit
simplifies the test and uses to distinct calls for tasklets and tasks.
No backport is needed.
diff --git a/src/debug.c b/src/debug.c
index a7c3b3a..2829851 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -84,12 +84,18 @@
return;
}
- chunk_appendf(buf,
- "%p (%s) calls=%u last=%llu%s\n",
- task, TASK_IS_TASKLET(task) ? "tasklet" : "task",
- task->calls,
- task->call_date ? (unsigned long long)(now_mono_time() - task->call_date) : 0,
- task->call_date ? " ns ago" : "");
+ if (TASK_IS_TASKLET(task))
+ chunk_appendf(buf,
+ "%p (tasklet) calls=%u\n",
+ task,
+ task->calls);
+ else
+ chunk_appendf(buf,
+ "%p (task) calls=%u last=%llu%s\n",
+ task,
+ task->calls,
+ task->call_date ? (unsigned long long)(now_mono_time() - task->call_date) : 0,
+ task->call_date ? " ns ago" : "");
chunk_appendf(buf, "%s"
" fct=%p (%s) ctx=%p\n",