Babeltrace 2.1: filter.lttng-utils.debug-info aborts unless event class IDs are 0…n-1
Moessbauer, Felix
felix.moessbauer at siemens.com
Wed Nov 11 06:29:27 EST 2026
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
More information about the lttng-dev
mailing list