Fix: lib: use appropriate format specifier to print message iterator class
Running
babeltrace2 --debug /some/trace
... results in the following crash:
==31705==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f5b9c25ae22 bp 0x7ffc64114490 sp 0x7ffc64113ba8 T0)
==31705==The signal is caused by a READ memory access.
==31705==Hint: address points to the zero page.
#0 0x7f5b9c25ae21 (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xfce21)
#1 0x7f5b9c1d231f (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x7431f)
#2 0x7f5b9c1fef4d in __interceptor_vsnprintf (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xa0f4d)
#3 0x7f5b9c1ff286 in snprintf (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xa1286)
#4 0x7f5b9bdf61c3 in format_component_class /home/smarchi/src/babeltrace/src/lib/lib-logging.c:1061
#5 0x7f5b9bdfad46 in handle_conversion_specifier_bt /home/smarchi/src/babeltrace/src/lib/lib-logging.c:1451
#6 0x7f5b9bead260 in bt_common_custom_vsnprintf /home/smarchi/src/babeltrace/src/common/common.c:1727
#7 0x7f5b9bdfb10b in bt_lib_log /home/smarchi/src/babeltrace/src/lib/lib-logging.c:1496
#8 0x7f5b9be32965 in bt_message_iterator_class_set_seek_beginning_methods /home/smarchi/src/babeltrace/src/lib/graph/message-iterator-class.c:138
...
This is due to an object being printed with the wrong format specifier.
`C` is for component class objects, use `I` instead, since we are
printing a message iterator object.
Change-Id: Ie3985d8b7c4e02ac7d09aee84bfe46ea4bab87e9
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3450
Reviewed-by: Geneviève Bastien <gbastien@versatic.net>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.025494 seconds and 4 git commands to generate.