BUG/MEDIUM: task: Don't free a task that is about to be run.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 4 May 2018 13:46:16 +0000 (15:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 4 May 2018 18:11:04 +0000 (20:11 +0200)
commit9b36cb4a414c22e13d344afbbe70684e9f2f1d49
tree12b3377618ce324cde6c96aba7d8e1703256f8c3
parent336a11f75571ad46f74a7c6247c13ed44f95da93
BUG/MEDIUM: task: Don't free a task that is about to be run.

While running a task, we may try to delete and free a task that is about to
be run, because it's part of the local tasks list, or because rq_next points
to it.
So flag any task that is in the local tasks list to be deleted, instead of
run, by setting t->process to NULL, and re-make rq_next a global,
thread-local variable, that is modified if we attempt to delete that task.

Many thanks to PiBa-NL for reporting this and analysing the problem.

This should be backported to 1.8.
include/proto/task.h
src/task.c