Project

General

Profile

Bug #1346

Updated by Francis Deslauriers about 2 years ago

I witnessed this issue while working on the CTF2 support of the sink.ctf.fs component class. 

 <pre> 
  (╯°□°)╯︵ ┻━┻    translate-trace-ir-to-ctf-ir.cpp:283: create_relative_field_ref(): Assertion `bt_field_path_item_get_type(fp_item) == BT_FIELD_PATH_ITEM_TYPE_INDEX` failed. 
 </pre> 

 The problem is triggered when a length field class of a dynamic array field class is contained within an element of a static another array field class. Both dynamic array and its length are in the same element within the static array. 


 

 I attached the source of a Python plugin that reproduces this issue. 

 I can reproduce the issue with the following command: 
 <pre> 
 babeltrace2 --plugin-path=/home/frdeso/projets/babeltrace-fun-plugins/my-first-components/ -c source.reprod.MyFirstSource -c sink.ctf.fs -p path=\"ici\" 
 </pre> 

 Here is the full stack trace of the assertion failure: 
 <pre> 
 #3    0x00007ffff6534c11 in bt_common_assert_failed (file=0x7ffff654c62c "translate-trace-ir-to-ctf-ir.cpp", line=283, func=0x7ffff654cf00 "create_relative_field_ref", assertion=0x7ffff654cf3a "bt_field_path_item_get_type(fp_item) == BT_FIELD_PATH_ITEM_TYPE_INDEX") at assert.c:40 
 #4    0x00007ffff6505624 in create_relative_field_ref (ctx=0x7fffffffe0f8, tgt_ir_field_path=0x5555555980a0, tgt_field_ref=0x555555599900, user_tgt_fc=0x0) at translate-trace-ir-to-ctf-ir.cpp:283 
 #5    0x00007ffff650529b in resolve_field_class (ctx=0x7fffffffe0f8, tgt_ir_field_path=0x5555555980a0, tgt_field_ref=0x555555599900, create_before=0x55555559b420, user_tgt_fc=0x0) at translate-trace-ir-to-ctf-ir.cpp:510 
 #6    0x00007ffff6503ccb in translate_dynamic_array_field_class (ctx=0x7fffffffe0f8) at translate-trace-ir-to-ctf-ir.cpp:1087 
 #7    0x00007ffff65035b7 in translate_field_class (ctx=0x7fffffffe0f8) at translate-trace-ir-to-ctf-ir.cpp:1191 
 #8    0x00007ffff6502e5a in translate_structure_field_class_members (ctx=0x7fffffffe0f8, struct_fc=0x55555559b2f0, ir_fc=0x5555556fed80) at translate-trace-ir-to-ctf-ir.cpp:615 
 #9    0x00007ffff650398a in translate_structure_field_class (ctx=0x7fffffffe0f8) at translate-trace-ir-to-ctf-ir.cpp:638 
 #10 0x00007ffff6503570 in translate_field_class (ctx=0x7fffffffe0f8) at translate-trace-ir-to-ctf-ir.cpp:1187 
 #11 0x00007ffff6503b18 in translate_static_array_field_class (ctx=0x7fffffffe0f8) at translate-trace-ir-to-ctf-ir.cpp:1061 
 #12 0x00007ffff650358f in translate_field_class (ctx=0x7fffffffe0f8) at translate-trace-ir-to-ctf-ir.cpp:1189 
 #13 0x00007ffff6502e5a in translate_structure_field_class_members (ctx=0x7fffffffe0f8, struct_fc=0x55555559b120, ir_fc=0x5555557500d0) at translate-trace-ir-to-ctf-ir.cpp:615 
 #14 0x00007ffff6502819 in translate_scope_field_class (ctx=0x7fffffffe0f8, scope=BT_FIELD_PATH_SCOPE_EVENT_PAYLOAD, fc=0x55555559b028, ir_fc=0x5555557500d0) at translate-trace-ir-to-ctf-ir.cpp:1446 
 #15 0x00007ffff6501ab9 in translate_event_class (fs_sink=0x555555598510, sc=0x55555559ae80, ir_ec=0x5555557166e0, out_ec=0x7fffffffe1e8) at translate-trace-ir-to-ctf-ir.cpp:1503 
 #16 0x00007ffff6501955 in try_translate_event_class_trace_ir_to_ctf_ir (fs_sink=0x555555598510, sc=0x55555559ae80, ir_ec=0x5555557166e0, out_ec=0x7fffffffe1e8) at translate-trace-ir-to-ctf-ir.cpp:1532 
 #17 0x00007ffff64fe4a4 in handle_event_msg (fs_sink=0x555555598510, msg=0x55555559a530) at fs-sink.cpp:266 
 #18 0x00007ffff64fe082 in ctf_fs_sink_consume (self_comp=0x555555598480) at fs-sink.cpp:957 
 </pre> 



Back