Fix: nestable pthread cancelstate
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 9 Sep 2021 16:49:26 +0000 (12:49 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 9 Dec 2021 17:34:31 +0000 (12:34 -0500)
commitd0cd72be0eacd90e56470e9cb954fa129997037e
treed5d4bebadba1d751c87482458b052f34ccf892ba
parent4d03f5699ca5129319b8ceb7baef85bbf05f3f3e
Fix: nestable pthread cancelstate

The pthread cancelstate disable performed to ensure threads are not
cancelled while holding mutexes which are used in library destructors
does not currently support that those mutexes may be nested. It
generates error messages when using the fork and fd helpers when running
with LTTNG_UST_DEBUG=1. The effect of this is that the pthread
cancelstate can be re-enabled too soon when the first unlock is
performed (in a nested lock scenario), thus allowing the thread to be
cancelled while still holding a lock, and causing a deadlock on
application exit.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ife8b1fee04c7d7c480e59bdfc158abdee771994c
include/Makefile.am
include/lttng/ust-cancelstate.h [new file with mode: 0644]
src/lib/lttng-ust-common/Makefile.am
src/lib/lttng-ust-common/fd-tracker.c
src/lib/lttng-ust-common/ust-cancelstate.c [new file with mode: 0644]
src/lib/lttng-ust/lttng-context-perf-counters.c
src/lib/lttng-ust/lttng-ust-comm.c
This page took 0.02571 seconds and 4 git commands to generate.