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)
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>

No differences found
This page took 0.023898 seconds and 4 git commands to generate.