Fix: sink.ctf.fs: fix logic of make_unique_stream_file_name
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 2 Dec 2020 22:36:05 +0000 (17:36 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 9 Dec 2020 20:52:09 +0000 (15:52 -0500)
The logic in make_unique_stream_file_name is wrong.  It tries names as
long as the candidate exists _and_ is named "metadata".  The intent here
is that we keep trying names as long as the candidate name names an
already existing file _or_ is named "metadata".  So the && should be a
||.

The impact of this bug is that if two streams have the same name,
they'll write to the same file, with troubling consequences (see bug
1279 [1]).

Add a test where `sink.ctf.fs` writes a trace with two streams with the
same name, and one stream named "metadata".

[1] https://bugs.lttng.org/issues/1279

Change-Id: Ifaa30459574229aa5e607095f65033d2caae188f
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/4483
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/4492


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