Fix: lib: strengthen clock expectation check for no Unix epoch / no UUID case
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 27 Nov 2023 21:23:10 +0000 (16:23 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 8 Feb 2024 17:03:14 +0000 (12:03 -0500)
commit29e191fceb6167bc486c8a492ec7652670de8355
tree67e7b0eaea0b163c0da34a47a391a3aab8d144c9
parent8a7eaa48c56f779205e094520553f99780b9aeb4
Fix: lib: strengthen clock expectation check for no Unix epoch / no UUID case

When an iterator sees a clock class with an origin that is not the Unix
and has no UUID, it sets its clock expectation to
CLOCK_EXPECTATION_ORIGIN_OTHER_NO_UUID.  In this mode, when validating
subsequent clock classes, it validates that the clock class' origin is
not the Unix epoch and that it has no UUID.  This is too loose: an
iterator could send messages with two distinct clocks with unknown
origins and no UUID, and it would pass validation.  However, these two
clock classes are not correletable.

Fix that by making the iterator remember which specific clock class
instance it saw first.  Each subsequent message must have exactly that
clock class instance.

To be sure that a clock class an iterator has saved doesn't get freed,
and then a new one reallocated at the same address, the iterator takes a
strong reference to the clock class.  This ensures that the saved clock
class at least outlives the iterator.

TODO: I would like to write a test for this

Change-Id: I339936b730fe2f4e64dbc58d56557ffcd23cce16
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11448
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/lib/graph/iterator.c
src/lib/graph/iterator.h
This page took 0.026185 seconds and 4 git commands to generate.