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

Philippe Proulx via lttng-dev <[email protected]>
Newsgroups org.lttng.lists.lttng-dev
Message-ID <CAB4xu_3zXGL4a20TRK2m2OwfC7NPqVW6tJvM397er0w6dBwSLw@mail.gmail.com>
On Tue, Aug 4, 2026 at 11:28 AM MOESSBAUER, Felix via lttng-dev
<[email protected]> wrote:
>
> 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`.

See <https://review.lttng.org/c/babeltrace/+/18460>.

Let's continue the discussion on Gerrit if need be.

Thank you for the report and reproducer.

Philippe

>
> 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
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.