From: "Moessbauer, Felix via lttng-dev" <lttng-dev@lists.lttng.org>
To: "Moessbauer, Felix via lttng-dev" <lttng-dev@lists.lttng.org>
Subject: Babeltrace 2.1: filter.lttng-utils.debug-info aborts unless event class IDs are 0…n-1
Date: Wed, 11 Nov 2026 11:29:27 +0000 [thread overview]
Message-ID: <3099987ad95e28e63dc6b0ddd6776fb967c887da.camel@siemens.com> (raw)
Hi,
I just stumbled upon the following bug in the Babeltrace 2.1
filter.lttng-utils.debug-info plugin:
When passing a trace (e.g. an already pre-filtered one) with event
classes with non sequential event ids, the plugin crashes with the
following assertion:
plugins/lttng-utils/debug-info/trace-ir-mapping.hpp:246:
borrow_metadata_maps_from_input_event_class(): Assertion
`in_event_class' failed.
LTTng's own traces work, because LTTng numbers event classes 0...n in
each stream class.
The cause is in src/plugins/lttng-utils/debug-info/trace-ir-metadata-
copy.cpp, copy_stream_class_content() (around lines 442–447 on stable-
2.1), the loop over a stream class's event classes looks them up by ID
using the loop index:
ec_number = bt_stream_class_get_event_class_count(in_stream_class);
for (ec_idx = 0; ec_idx < ec_number; ec_idx++) {
const bt_event_class *in_event_class =
bt_stream_class_borrow_event_class_by_id_const(in_stream_class,
ec_idx);
out_event_class =
trace_ir_mapping_borrow_mapped_event_class(ir_maps, in_event_class);
...
A simple fix is to lookup the event class up by index:
const bt_event_class *in_event_class =
bt_stream_class_borrow_event_class_by_index_const(in_stream_class,
ec_idx);
Best regards,
Felix Moessbauer
--
Siemens AG
Linux Expert Center
Friedrich-Ludwig-Bauer-Str. 3
85748 Garching, Germany
reply other threads:[~2026-11-11 11:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3099987ad95e28e63dc6b0ddd6776fb967c887da.camel@siemens.com \
--to=lttng-dev@lists.lttng.org \
--cc=felix.moessbauer@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox