Fix: prevent calling adding the same trace recursively
authorJulien Desfossez <jdesfossez@efficios.com>
Thu, 23 Nov 2017 23:43:52 +0000 (18:43 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 31 Jan 2018 19:46:03 +0000 (14:46 -0500)
commit1e8e8e2fb8ef9e36cbc2c5a692e9fa1d11cbb52a
tree69add0846817335508e87881656e1325c3d57bd4
parent4a6f6ed3aeb9845dec4b8ec9ca8573ed1c064187
Fix: prevent calling adding the same trace recursively

add_one_trace may need to fetch new streams, which may lead to adding
new traces to the ctf_traces hashtable and recursively calling
add_one_trace. This is problematic because we cannot modify a hashtable
we are iterating on, and we cannot perform twice the add_one_trace for
the same trace.

This fix, ensures this situation cannot happen, by checking if the
number of traces changed during the iteration and by making sure a trace
is considered in_use as soon as we enter the add_one_trace function.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Acked-by: Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
Tested-by: Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/lttng-live/lttng-live-comm.c
This page took 0.024232 seconds and 4 git commands to generate.