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>
Tue, 30 Jan 2018 22:02:55 +0000 (17:02 -0500)
commitb9e6498df8b3e7c2ad312dccddf9f1a5e181648e
tree051227e26d7814183c1657518b54a951d96c17d9
parent8817e4924b6a74512413556b808373683934ea82
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.023971 seconds and 4 git commands to generate.