mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-29 06:40:59 +01:00
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.
This commit is contained in:
parent
5cf64dd1bd
commit
20db9115dc
10
src/debug.c
10
src/debug.c
@ -84,9 +84,15 @@ void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (TASK_IS_TASKLET(task))
|
||||||
chunk_appendf(buf,
|
chunk_appendf(buf,
|
||||||
"%p (%s) calls=%u last=%llu%s\n",
|
"%p (tasklet) calls=%u\n",
|
||||||
task, TASK_IS_TASKLET(task) ? "tasklet" : "task",
|
task,
|
||||||
|
task->calls);
|
||||||
|
else
|
||||||
|
chunk_appendf(buf,
|
||||||
|
"%p (task) calls=%u last=%llu%s\n",
|
||||||
|
task,
|
||||||
task->calls,
|
task->calls,
|
||||||
task->call_date ? (unsigned long long)(now_mono_time() - task->call_date) : 0,
|
task->call_date ? (unsigned long long)(now_mono_time() - task->call_date) : 0,
|
||||||
task->call_date ? " ns ago" : "");
|
task->call_date ? " ns ago" : "");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user