babeltrace 2.1.2: sink.ctf.fs does not deduplicate identical clocks

MOESSBAUER, Felix felix.moessbauer at siemens.com
Tue Aug 4 11:27:43 EDT 2026


Hi,

while porting the bt2-ftrace-to-ctf [1] plugin to babeltrace 2.1, I
noticed that the sink.ctf.fs creates invalid clock definitions if
multiple stream-classes share the same clock-class. In this case, the
clock definition is added multiple times to the CTF 2 metadata,
resulting in the following assertion on read-back:

ERROR:    [Babeltrace CLI] (babeltrace2.c:2705)
  Command-line error: retcode=1
CAUSED BY [Source auto-discovery] (autodisc/autodisc.c:493)
  babeltrace.support-info query failed.
CAUSED BY [libbabeltrace2] (lib/graph/query-executor.c:233)
  Component class's "query" method failed: query-exec-
addr=0x55cba00c12e0, cc-addr=0x55cba00b4100, cc-type=SOURCE, cc-
name="fs", cc-partial-descr="Read CTF traces from
  the file sy", cc-is-frozen=0, cc-so-handle-addr=0x55cba00b1930, cc-
so-handle-path="<...>/build/babeltrace-plugin-ctf.so",
  object="babeltrace.support-info", params-addr=0x55cba00cd470, params-
type=MAP, params-element-count=2, log-level=WARNING
CAUSED BY ['source.ctf.fs'] (plugins/ctf/common/src/metadata/json/ctf-
2-metadata-stream-parser.cpp:130)
  [1:1 @ 8512 bytes] Invalid fragment #12.
CAUSED BY ['source.ctf.fs'] (plugins/ctf/common/src/metadata/json/ctf-
2-metadata-stream-parser.cpp:367)
  [1:1 @ 17024 bytes] Duplicate clock class fragment with ID `local`.

When running with MIP=0, the CTF 1.8 data does not have this issue (or
the reader ignores the duplicated definitions).

[1] https://github.com/siemens/bt2-ftrace-to-ctf

Attached you will find an AI generated reproducer using just the
babeltrace2 Python bindings.

Best regards,
Felix Moessbauer

-- 
Siemens AG
Linux Expert Center
Friedrich-Ludwig-Bauer-Str. 3
85748 Garching, Germany

-------------- next part --------------
A non-text attachment was scrubbed...
Name: repro.py
Type: text/x-python3
Size: 4650 bytes
Desc: repro.py
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20260804/e196e5b2/attachment.bin>


More information about the lttng-dev mailing list