From: Julien Desfossez Date: Thu, 23 Nov 2017 23:43:52 +0000 (-0500) Subject: Fix: prevent calling adding the same trace recursively X-Git-Tag: v1.4.4~3 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=1e8e8e2fb8ef9e36cbc2c5a692e9fa1d11cbb52a;hp=1e8e8e2fb8ef9e36cbc2c5a692e9fa1d11cbb52a 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 Acked-by: Jonathan Rajotte-Julien Tested-by: Jonathan Rajotte-Julien Signed-off-by: Jérémie Galarneau ---