ltrace crashes with type.c:102: type_struct_add: Assertion
field_info->type != ARGTYPE_VOID' failed`
Hello,
while playing with ltrace
on current Fedora Rawhide I noticed it crashes when tracing certain processes/binaries. I can reproduce the same behavior with the latest ltrace
git as well:
# git log -1
commit 4da87819752101fb9665120641454448ebc95526 (HEAD -> main, origin/main, origin/HEAD)
Author: DJ Delorie <dj@delorie.com>
Date: Wed Sep 17 17:08:18 2025 -0400
ppc64le: fix couldn't find DT_PPC64_GLINK on /lib64/ld64.so.2
The loader is static and doesn't have a PLT so not finding
this there is not an issue, but it shows up in the dynamic
loader chain, so ignore this "error".
# ./autogen.sh
# ./configure
# make
# ./ltrace bash
__sigsetjmp(ltrace: type.c:102: type_struct_add: Assertion `field_info->type != ARGTYPE_VOID' failed.
Aborted (core dumped) ./ltrace bash
# ./ltrace resolvectl query fedoraproject.org
main_prepare(ltrace: type.c:102: type_struct_add: Assertion `field_info->type != ARGTYPE_VOID' failed.
Aborted (core dumped) ./ltrace resolvectl query fedoraproject.org
Full ltrace backtrace from one of the crashes:
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `./ltrace resolvectl query fedoraproject.org'.
Program terminated with signal SIGABRT, Aborted.
Downloading 4.48 K source file /usr/src/debug/glibc-2.42.9000-5.fc44.x86_64/nptl/pthread_kill.c
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
44 return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
(gdb) bt full
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
tid = <optimized out>
ret = 0
pd = <optimized out>
old_mask = {__val = {4361127}}
ret = <optimized out>
#1 0x00007f06d05e5383 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:89
No locals.
#2 0x00007f06d058b18e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
ret = <optimized out>
#3 0x00007f06d05726d0 in __GI_abort () at abort.c:77
act = {__sigaction_handler = {sa_handler = 0x2c9be0f0, sa_sigaction = 0x2c9be0f0}, sa_mask = {__val = {748413168, 139667243907776, 91, 757627296, 0,
757627299, 757627302, 757613760, 11047019386128961280, 0, 748331024, 140722782340968, 11047019386128961280, 140722782340864, 139667242905183,
140722782341152}}, sa_flags = -808542208, sa_restorer = 0x7f06d0723205}
#4 0x00007f06d0572639 in __assert_fail_base (fmt=<optimized out>, assertion=<optimized out>, file=<optimized out>, line=<optimized out>,
function=<optimized out>) at assert.c:118
str = 0x2c9be0f0 "\276\311\002"
total = <optimized out>
#5 0x00007f06d05830ef in __assert_fail (assertion=<optimized out>, file=<optimized out>, line=<optimized out>, function=<optimized out>) at assert.c:127
No locals.
#6 0x0000000000403063 in type_struct_add (info=<optimized out>, field_info=field_info@entry=0x43c0c0 <t>, own=<optimized out>) at type.c:102
__PRETTY_FUNCTION__ = "type_struct_add"
field = {info = 0x7ffc937408f0, own_info = -1821112112}
#7 0x000000000041ef66 in get_structure (parent=0x7ffc937408d0, plib=0x2c5c1820, type_dieoffset_hash=0x7ffc93740d00) at dwarf_prototypes.c:622
type_die = {addr = 0x7f06ce053197, cu = 0x2cae5bf8, abbrev = 0x2cd50fb8, padding__ = 0}
res = <optimized out>
result = 0x2ca3c1a0
member_type = 0x43c0c0 <t>
newly_allocated_member_type = 0
die_offset = 174084
die = {addr = 0x7f06ce051ec7, cu = 0x2cae5bf8, abbrev = 0x2cd50d48, padding__ = 0}
__func__ = "get_structure"
#8 get_type (newly_allocated_result=newly_allocated_result@entry=0x7ffc93740a88, type_die=type_die@entry=0x7ffc93740a00, plib=plib@entry=0x2c5c1820,
type_dieoffset_hash=type_dieoffset_hash@entry=0x7ffc93740d00) at dwarf_prototypes.c:768
result = 0x0
pointee = 0x0
newly_allocated_pointee = 0
die_offset = 174084
found_type = <optimized out>
__func__ = "get_type"
type_name = <optimized out>
next_die = {addr = 0x7f06ce053197, cu = 0x2cae5bf8, abbrev = 0x2cd50fb8, padding__ = 0}
#9 0x000000000041e5d2 in get_type (newly_allocated_result=newly_allocated_result@entry=0x7ffc93740a88, type_die=type_die@entry=0x7ffc93740b00,
plib=plib@entry=0x2c5c1820, type_dieoffset_hash=type_dieoffset_hash@entry=0x7ffc93740d00) at dwarf_prototypes.c:781
result = 0x0
pointee = 0x0
newly_allocated_pointee = 0
die_offset = 174074
found_type = <optimized out>
__func__ = "get_type"
type_name = <optimized out>
next_die = {addr = 0x7f06ce051ebc, cu = 0x2cae5bf8, abbrev = 0x2d26f1e0, padding__ = 0}
#10 0x000000000041ed48 in get_type (newly_allocated_result=newly_allocated_result@entry=0x7ffc93740c20, type_die=type_die@entry=0x7ffc93740b90,
plib=plib@entry=0x2c5c1820, type_dieoffset_hash=type_dieoffset_hash@entry=0x7ffc93740d00) at dwarf_prototypes.c:753
result = 0x2ca3c160
pointee = 0x0
newly_allocated_pointee = 1
die_offset = 179415
found_type = <optimized out>
__func__ = "get_type"
type_name = <optimized out>
next_die = {addr = 0x7f06ce051eb2, cu = 0x2cae5bf8, abbrev = 0x2cd511f8, padding__ = 0}
#11 0x00000000004203af in get_prototype (result=0x7ffc93740bf0, subroutine=0x7ffc93740ce0, plib=0x2c5c1820, type_dieoffset_hash=0x7ffc93740d00)
at dwarf_prototypes.c:897
newly_allocated_return_type = 1
argument_type = 0x0
newly_allocated_argument_type = 0
return_type_die = {addr = 0x7f06ce05338f, cu = 0x2cae5bf8, abbrev = 0x2cd50fb8, padding__ = 0}
arg_die = {addr = 0x3, cu = 0x7ffc93740c70, abbrev = 0x7ffc93740c60, padding__ = 139667244086769}
__func__ = "get_prototype"
#12 import_subprogram_name (plib=plib@entry=0x2c5c1820, lib=lib@entry=0x2c5b5290, type_dieoffset_hash=type_dieoffset_hash@entry=0x7ffc93740d00,
die=die@entry=0x7ffc93740ce0, function_name=0x7f06cde05d25 "dns_query_free") at dwarf_prototypes.c:1014
__func__ = "import_subprogram_name"
proto_already_there = <optimized out>
proto = {params = {data = 0x0, size = 0, allocated = 0, elt_size = 64}, return_info = 0x0, own_return_info = false}
function_name_dup = <optimized out>
#13 0x00000000004209ca in import_subprogram_die (plib=<optimized out>, lib=<optimized out>, type_dieoffset_hash=0x7ffc93740d00, die=0x7ffc93740ce0)
at dwarf_prototypes.c:1051
function_name = <optimized out>
attr = {code = 4294960196, form = 4294960196, valp = 0x7f06ce0536fc "\021\307\030", cu = 0x2cae5bf8}
#14 process_die_compileunit (plib=<optimized out>, lib=<optimized out>, type_dieoffset_hash=0x7ffc93740d00, parent=0x2d26c950) at dwarf_prototypes.c:1072
res = <optimized out>
die = {addr = 0x7f06ce0536f0, cu = 0x2cae5bf8, abbrev = 0x2cd50ca0, padding__ = 0}
__func__ = "process_die_compileunit"
#15 import (plib=0x2c5c1820, lib=0x2c5b5290, dwfl_module=0x2c5b71c0) at dwarf_prototypes.c:1099
type_dieoffset_hash = {keys = {data = 0x2d289d60, size = 251, allocated = 256, elt_size = 8}, values = {data = 0x2d28a570, size = 251, allocated = 256,
elt_size = 8}, status = {data = 0x2d287b70, size = 251, allocated = 256, elt_size = 1}, size = 103, hash1 = 0x41e0f0 <dwarf_die_hash>,
eq = 0x41e100 <dwarf_die_eq>, hash2 = 0x0}
bias = 0
die = 0x2d26c950
__func__ = "import"
#16 import_DWARF_prototypes (lib=lib@entry=0x2c5b5290) at dwarf_prototypes.c:1130
plib = 0x2c5c1820
#17 0x0000000000415778 in library_get_prototype (lib=0x2c5b5290, name=0x2c5c0940 "main_prepare") at output.c:245
sz = <optimized out>
buf = "resolv"
result = <optimized out>
context = {lib = 0x0, result = 0x0}
#18 0x000000000041671d in lookup_symbol_prototype (proc=0x2c5b3ac0, libsym=libsym@entry=0x2c5c0b10) at output.c:299
data = {name = 0x2c5c0940 "main_prepare", ret = 0x0}
lib = <optimized out>
#19 0x0000000000416abf in lookup_symbol_prototype (proc=<optimized out>, libsym=0x2c5c0b10) at output.c:625
lib = <optimized out>
data = <optimized out>
#20 output_left (type=type@entry=LT_TOF_FUNCTION, proc=0x2c5b3ac0, libsym=0x2c5c0b10) at output.c:590
__PRETTY_FUNCTION__ = "output_left"
name = <optimized out>
func = <optimized out>
context = <optimized out>
arguments = <optimized out>
params_left = 744176320
need_delim = 22083
stel = <optimized out>
#21 0x0000000000415509 in handle_breakpoint (event=0x43bc60 <event>) at handle_event.c:756
i = <optimized out>
j = <optimized out>
sbp = <optimized out>
leader = 0x2c5b3ac0
brk_addr = <optimized out>
#22 handle_event (event=0x43bc60 <event>) at handle_event.c:200
__PRETTY_FUNCTION__ = "handle_event"
#23 0x0000000000403cc0 in ltrace_main () at libltrace.c:172
ev = 0x43bc60 <event>
#24 0x000000000040381e in main (argc=<optimized out>, argv=<optimized out>) at main.c:55
No locals.