Fix: liblttng-ust-libc-wrapper recursive use of calloc
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 15 Mar 2014 00:31:13 +0000 (20:31 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 15 Mar 2014 00:53:56 +0000 (20:53 -0400)
commit8be1a6b6e3e21063db43fdceef1465d5c75d77ca
tree6a2456c32616920b5b22f24327996581e6e0e20a
parent08a60a012674b9a5a136d96bed1b115c765b6236
Fix: liblttng-ust-libc-wrapper recursive use of calloc

When built with URCU with --disable-compiler-tls, URCU tls-compat.h uses
calloc in its TLS compat layer. This is used by RCU read-side, which is
used by tracepoint. So using a tracepoint in calloc triggers an infinite
recursion, since its first use of the TLS (with TLS compat) calls
calloc.

Fix this issue by keeping a per-thread nesting counter, and as soon as
we are allocating memory from a context nested within the memory
allocator, don't trace.

Don't trace from the static allocator: keep it as simple as possible,
since this is our fallback.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust-libc-wrapper/lttng-ust-malloc.c
This page took 0.024575 seconds and 4 git commands to generate.