Debian Patches

Status for ltrace/0.7.91~git20230705.8eabf68-4

Patch Description Author Forwarded Bugs Origin Last update
fix-ftbfs-on-riscv64.patch Fix FTBFS on riscv64 Bo YU <tsu.yubo@gmail.com> yes 2024-11-01
fix-ftbfs-on-loong64.patch Fix FTBFS on loong64 wuruilong <wuruilong@loongson.cn> yes 2024-11-01
0003-Add-llong-ullong.-Tested-on-i386-amd64.patch Add llong/ullong. Tested on i386/amd64 =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2023-07-25
0004-ltrace.conf-openat-getopt_long-consistency-fseek-fte.patch ltrace.conf: openat*(), getopt_long*() consistency, fseek*(), ftell*(), reallocarray(), pread*(), pwrite*(), lseek*() with whence enum,
*readv*(), *writev*(), __cxa_finalize()

Of course, this assumes that symbols ending in 64 are the only ones
taking a 64-bit off_t, and thus the ones that don't take longs.
This holds on x86, but probably not any new arches which just don't have
the weird broken *64() symbols.
=?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2023-07-26
0005-Remove-extraneous-whitespace-around-and.patch Remove extraneous whitespace around [] and {}
Compare
pread64(3, "14044\n14045\n14046\n14047\n14048\n14"..., 65536, 73152) = 65536
memmove(0x5769c1a4, "6\n", 2) = 0x5769c1a4
memcpy(0x5769c1a0, "2496", 4) = 0x5769c1a0
writev(1, [ { "24966\n", 6 }, { "24965\n", 6 }, { "24964\n", 6 }, { "24963\n", 6 }... ], 1024) = 6144
writev(1, [ { "23942\n", 6 }, { "23941\n", 6 }, { "23940\n", 6 }, { "23939\n", 6 }... ], 1024) = 6144
writev(1, [ { "22918\n", 6 }, { "22917\n", 6 }, { "22916\n", 6 }, { "22915\n", 6 }... ], 1024) = 6144
writev(1, [ { "21894\n", 6 }, { "21893\n", 6 }, { "21892\n", 6 }, { "21891\n", 6 }... ], 1024) = 6144
writev(1, [ { "20870\n", 6 }, { "20869\n", 6 }, { "20868\n", 6 }, { "20867\n", 6 }... ], 1024) = 6144
writev(1, [ { "19846\n", 6 }, { "19845\n", 6 }, { "19844\n", 6 }, { "19843\n", 6 }... ], 1024) = 6144
writev(1, [ { "18822\n", 6 }, { "18821\n", 6 }, { "18820\n", 6 }, { "18819\n", 6 }... ], 1024) = 6144
writev(1, [ { "17798\n", 6 }, { "17797\n", 6 }, { "17796\n", 6 }, { "17795\n", 6 }... ], 1024) = 6144
writev(1, [ { "16774\n", 6 }, { "16773\n", 6 }, { "16772\n", 6 }, { "16771\n", 6 }... ], 1024) = 6144
writev(1, [ { "15750\n", 6 }, { "15749\n", 6 }, { "15748\n", 6 }, { "15747\n", 6 }... ], 1024) = 6144
writev(1, [ { "14726\n", 6 }, { "14725\n", 6 }, { "14724\n", 6 }, { "14723\n", 6 }... ], 682) = 4092
memcpy(0x5769c1a0, "14044\n", 6) = 0x5769c1a0
pread64(3, "5\n1746\n1747\n1748\n1749\n1750\n1751\n"..., 65536, 7616) = 65536
writev(1, [ { "14044\n", 6 }, { "14043\n", 6 }, { "14042\n", 6 }, { "14041\n", 6 }... ], 1024) = 6144
writev(1, [ { "13020\n", 6 }, { "13019\n", 6 }, { "13018\n", 6 }, { "13017\n", 6 }... ], 1024) = 6144
writev(1, [ { "11996\n", 6 }, { "11995\n", 6 }, { "11994\n", 6 }, { "11993\n", 6 }... ], 1024) = 6144
writev(1, [ { "10972\n", 6 }, { "10971\n", 6 }, { "10970\n", 6 }, { "10969\n", 6 }... ], 1024) = 6093
writev(1, [ { "9948\n", 5 }, { "9947\n", 5 }, { "9946\n", 5 }, { "9945\n", 5 }... ], 1024) = 5120
writev(1, [ { "8924\n", 5 }, { "8923\n", 5 }, { "8922\n", 5 }, { "8921\n", 5 }... ], 1024) = 5120
writev(1, [ { "7900\n", 5 }, { "7899\n", 5 }, { "7898\n", 5 }, { "7897\n", 5 }... ], 1024) = 5120
writev(1, [ { "6876\n", 5 }, { "6875\n", 5 }, { "6874\n", 5 }, { "6873\n", 5 }... ], 1024) = 5120
writev(1, [ { "5852\n", 5 }, { "5851\n", 5 }, { "5850\n", 5 }, { "5849\n", 5 }... ], 1024) = 5120
writev(1, [ { "4828\n", 5 }, { "4827\n", 5 }, { "4826\n", 5 }, { "4825\n", 5 }... ], 1024) = 5120
writev(1, [ { "3804\n", 5 }, { "3803\n", 5 }, { "3802\n", 5 }, { "3801\n", 5 }... ], 1024) = 5120
writev(1, [ { "2780\n", 5 }, { "2779\n", 5 }, { "2778\n", 5 }, { "2777\n", 5 }... ], 1024) = 5120
writev(1, [ { "1756\n", 5 }, { "1755\n", 5 }, { "1754\n", 5 }, { "1753\n", 5 }... ], 11) = 55
memcpy(0x5769c1a0, "5\n", 2) = 0x5769c1a0
pread64(3, "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14"..., 7616, 0) = 7616
memmove(0x5769c1a3, "5\n", 2) = 0x5769c1a3
memcpy(0x5769c1a0, "174", 3) = 0x5769c1a0
writev(1, [ { "1745\n", 5 }, { "1744\n", 5 }, { "1743\n", 5 }, { "1742\n", 5 }... ], 1024) = 4842
writev(1, [ { "721\n", 4 }, { "720\n", 4 }, { "719\n", 4 }, { "718\n", 4 }... ], 720) = 2774
memcpy(0x5769c1a0, "1\n", 2) = 0x5769c1a0
writev(1, [ { "1\n", 2 } ], 1) = 2
close(3) = 0

To
pread64(3, "14044\n14045\n14046\n14047\n14048\n14"..., 65536, 73152) = 65536
memmove(0x574c41a4, "6\n", 2) = 0x574c41a4
memcpy(0x574c41a0, "2496", 4) = 0x574c41a0
writev(1, [{"24966\n", 6}, {"24965\n", 6}, {"24964\n", 6}, {"24963\n", 6}...], 1024) = 6144
writev(1, [{"23942\n", 6}, {"23941\n", 6}, {"23940\n", 6}, {"23939\n", 6}...], 1024) = 6144
writev(1, [{"22918\n", 6}, {"22917\n", 6}, {"22916\n", 6}, {"22915\n", 6}...], 1024) = 6144
writev(1, [{"21894\n", 6}, {"21893\n", 6}, {"21892\n", 6}, {"21891\n", 6}...], 1024) = 6144
writev(1, [{"20870\n", 6}, {"20869\n", 6}, {"20868\n", 6}, {"20867\n", 6}...], 1024) = 6144
writev(1, [{"19846\n", 6}, {"19845\n", 6}, {"19844\n", 6}, {"19843\n", 6}...], 1024) = 6144
writev(1, [{"18822\n", 6}, {"18821\n", 6}, {"18820\n", 6}, {"18819\n", 6}...], 1024) = 6144
writev(1, [{"17798\n", 6}, {"17797\n", 6}, {"17796\n", 6}, {"17795\n", 6}...], 1024) = 6144
writev(1, [{"16774\n", 6}, {"16773\n", 6}, {"16772\n", 6}, {"16771\n", 6}...], 1024) = 6144
writev(1, [{"15750\n", 6}, {"15749\n", 6}, {"15748\n", 6}, {"15747\n", 6}...], 1024) = 6144
writev(1, [{"14726\n", 6}, {"14725\n", 6}, {"14724\n", 6}, {"14723\n", 6}...], 682) = 4092
memcpy(0x574c41a0, "14044\n", 6) = 0x574c41a0
pread64(3, "5\n1746\n1747\n1748\n1749\n1750\n1751\n"..., 65536, 7616) = 65536
writev(1, [{"14044\n", 6}, {"14043\n", 6}, {"14042\n", 6}, {"14041\n", 6}...], 1024) = 6144
writev(1, [{"13020\n", 6}, {"13019\n", 6}, {"13018\n", 6}, {"13017\n", 6}...], 1024) = 6144
writev(1, [{"11996\n", 6}, {"11995\n", 6}, {"11994\n", 6}, {"11993\n", 6}...], 1024) = 6144
writev(1, [{"10972\n", 6}, {"10971\n", 6}, {"10970\n", 6}, {"10969\n", 6}...], 1024) = 6093
writev(1, [{"9948\n", 5}, {"9947\n", 5}, {"9946\n", 5}, {"9945\n", 5}...], 1024) = 5120
writev(1, [{"8924\n", 5}, {"8923\n", 5}, {"8922\n", 5}, {"8921\n", 5}...], 1024) = 5120
writev(1, [{"7900\n", 5}, {"7899\n", 5}, {"7898\n", 5}, {"7897\n", 5}...], 1024) = 5120
writev(1, [{"6876\n", 5}, {"6875\n", 5}, {"6874\n", 5}, {"6873\n", 5}...], 1024) = 5120
writev(1, [{"5852\n", 5}, {"5851\n", 5}, {"5850\n", 5}, {"5849\n", 5}...], 1024) = 5120
writev(1, [{"4828\n", 5}, {"4827\n", 5}, {"4826\n", 5}, {"4825\n", 5}...], 1024) = 5120
writev(1, [{"3804\n", 5}, {"3803\n", 5}, {"3802\n", 5}, {"3801\n", 5}...], 1024) = 5120
writev(1, [{"2780\n", 5}, {"2779\n", 5}, {"2778\n", 5}, {"2777\n", 5}...], 1024) = 5120
writev(1, [{"1756\n", 5}, {"1755\n", 5}, {"1754\n", 5}, {"1753\n", 5}...], 11) = 55
memcpy(0x574c41a0, "5\n", 2) = 0x574c41a0
pread64(3, "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14"..., 7616, 0) = 7616
memmove(0x574c41a3, "5\n", 2) = 0x574c41a3
memcpy(0x574c41a0, "174", 3) = 0x574c41a0
writev(1, [{"1745\n", 5}, {"1744\n", 5}, {"1743\n", 5}, {"1742\n", 5}...], 1024) = 4842
writev(1, [{"721\n", 4}, {"720\n", 4}, {"719\n", 4}, {"718\n", 4}...], 720) = 2774
memcpy(0x574c41a0, "1\n", 2) = 0x574c41a0
writev(1, [{"1\n", 2}], 1) = 2
close(3) = 0
=?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2023-07-26
0006-Read-larger-than-word-buffers-with-process_vm_readv..patch Read larger-than-word buffers with process_vm_readv. Pre-buffer arrays of primitives

The first optimisation is obvious: at one point, without it,
ltrace does ptrace(PTRACE_PEEKDATA) /79959 consecutive times/
(thus reading 640kB; imagine how much slower it'd be on
i686 with double the syscall count and slower syscalls).

The second is necessary because arrays are reified
by reifying each element separately.
Thus, a 64kB string will cause ltrace to PTRACE_PEEKDATA 65`536 times.)

Instead, cooperatively notify the reification module before formatting
an array, and read (up to a megabyte) into a static buffer.
This means that the no-flag and -s9999999999 runs complete without ever
PTRACE_PEEKDATAing a singular character.

The zero() lens would (needlessly) check more than the required
mapping size, which is limited by -A and -s: restrict it to never
try more than the maximum of those + 1, which allows us to speculatively
pre-map the entire prospective NUL-terminated string too.

Evaluation:
The program consists almost exclusively of pread64(64kB)
of seven-byte-lines and writev(1024)s (where each iov is one line)
of the whole read buffer. The input file is 6.6M, of seq 1000000.

$ time out/cmd/tail -r /tmp/1000000 > /dev/null

real 0m0.030s
user 0m0.017s
sys 0m0.013s

165kB of output:
$ time ltrace -o /dev/null -F /etc/ltrace.conf out/cmd/tail -r /tmp/1000000 > /dev/null

real 0m8.508s
user 0m2.081s
sys 0m6.389s
$ time ~/backports/ltrace/ltrace -o /dev/null -F /etc/ltrace.conf out/cmd/tail -r /tmp/1000000 > /dev/null

real 0m0.464s
user 0m0.173s
sys 0m0.282s

7.7MB of output:
$ time ltrace -o /dev/null -F /etc/ltrace.conf -s9999999999 out/cmd/tail -r /tmp/1000000 > /dev/null

real 0m17.820s
user 0m5.384s
sys 0m12.395s
$ time ~/backports/ltrace/ltrace -o /dev/null -F /etc/ltrace.conf -s9999999999 out/cmd/tail -r /tmp/1000000 > /dev/null

real 0m2.678s
user 0m2.377s
sys 0m0.265s

24M of output (especially torturous for the reasons mentioned above):
$ time ltrace -o /dev/null -F /etc/ltrace.conf -{A,s}9999999999 out/cmd/tail -r /tmp/1000000 > /dev/null

real 0m37.834s
user 0m12.685s
sys 0m25.027s
$ time ~/backports/ltrace/ltrace -o /dev/null -F /etc/ltrace.conf -{A,s}9999999999 out/cmd/tail -r /tmp/1000000 > /dev/null

real 0m19.512s
user 0m8.392s
sys 0m10.997s
=?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2023-07-26
0007-Handle-format-b.-Add-bin-lens.patch Handle format %b. Add bin() lens =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2023-07-27
0008-Add-w-f-WIDTH-x-glibc-2.38-C2x.patch Add %w[f]{WIDTH}x (glibc 2.38, C2x)
This even lets you trace programs that your libc doesn't have support
for! (By accident.)

$ cat qwe.c
int main() {
printf("%#b\n", 69);
printf("%w64x %s\n", "gameing", (char *)0);
write(1, "zupa\n", 5);

}
$ ./ltrace -F ./ltrace.conf ./qwe | tail
printf("%#b\n", 0b1000101) = 10
printf("%w64x %s\n", 0x563ab86eb013, nil) = 14
write(1, "zupa\n", 0b101) = 5
+++ exited (status 0) +++
zupa
0b1000101
%w64x gameing
=?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2023-07-27
0009-Add-splice-copy_file_range-sendfile-64.patch Add splice()/copy_file_range()/sendfile[64]()
Before:
splice(3, 0x7ffd4b66f348, 1, 0) = -1
copy_file_range(3, 0x7ffd772bbf28, 1, 0) = -1
sendfile64(1, 3, 0x7ffd772bbf28, 0x400000) = -1
pread64(3 <no return ...>
, "", 65536, -65536) = -1

After:
splice(3, -65536, 1, nil, 4194304, 0b101) = -1
copy_file_range(3, -65536, 1, nil, 4194304, 0) = -1
sendfile64(1, 3, -65536, 4194304) = -1
pread64(3 <no return ...>
, "", 65536, -65536) = -1
=?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2023-08-01
0010-__errno_location-returns-an-int-not-addr.patch __errno_location() returns an int*, not addr
This means that before:
__errno_location() = 0x7f2707f256c0
__errno_location() = 0x7f2707f256c0
__errno_location() = 0x7f2707f256c0

After:
__errno_location() = 0
__errno_location() = 22
__errno_location() = 22

And thus __errno_location() is made useful
=?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2023-08-01
0011-pipe-2-with-fds-sysconf-m-un-map-64-operator-new-del.patch pipe[2]() with fds; sysconf(); m[un]map[64](); operator new/delete; regex.h suite

$ grep pipe ll
pipe2(0x7ffcd6d7baf0, 0x80000, 0x7ffcd6d7bb70, 0x7ffcd6d7bb70) = 0
$ grep pipe ll
pipe2([3, 4], 0x80000) = 0

nabijaczleweli@tarta:~/backports/ltrace$ grep -e mmap -e sysconf ll
sysconf(30, 0, 1, 0x393c) = 4096
mmap64(0, 0x3d3c, 1, 2) = 0x7fe67b29c000
nabijaczleweli@tarta:~/backports/ltrace$ grep -e mmap -e sysconf ll
sysconf(_SC_PAGE_SIZE) = 4096
mmap64(0, 15676, 0b1, 0x2, 0, 4096) = 0x7fa1b27ff000

regcomp(0x7fff5ee83120, ";", 0b100) = REG_OK

regexec(0x7fff5ee83040, "\nint SYS_access(string,octal);"..., 1, [{0, 31}], 0b111) = REG_NOMATCH
regexec(0x7fff5ee83040, ";\nint SYS_access(string,octal)"..., 1, [{0, 32}], 0b111) = REG_OK

regcomp(0x7ffece59ee70, "\\(", 0b100) = REG_EPAREN
regerror(REG_EPAREN, 0x7ffece59ee70, nil, 0) = 18
malloc(18) = 0x5604c35c2140
regerror(REG_EPAREN, 0x7ffece59ee70, "Unmatched ( or \\(", 18) = 18
=?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2023-08-03
0012-Turn-opt_p-into-an-array.patch Turn opt_p into an array =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2024-11-29
0013-Open-o-we-instead-of-w-then-setting-O_CLOEXEC-manual.patch Open -o "we" instead of "w" then setting O_CLOEXEC manually =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2024-11-29
0014-Boolify-pass-for-prototype-read_config_file.patch Boolify pass for prototype/read_config_file =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2023-08-03
0015-Remove-unused-list_of_functions.patch Remove unused list_of_functions =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2024-11-29
0016-Full-stat-suite-bare-names-appear-in-my-C-program-at.patch Full stat/statfs suite, bare names (appear in my C++ program at least); strto*ll(); *locale();
vfork(); time.h functions and struct tm; wgetch, tgetstr, MEVENT, getmouse;
linkat, renameat{,2}, mkdirat; {,d,dc}gettext, nl_langinfo;
ungetc, freopen, fmemopen, open_{,w}memstream, {v,}asprintf, getline,
{,__}getdelim, __xpg_basename, strnlen, strverscmp, memcmp, bcmp, strtok_r,
strpbrk, stat64, realpath, getsubopt, mbtowc; qsort_r(); boolify isw*();
sync() family; canonicalize_file_name(); strncasecmp()
=?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2023-08-08
22.patch [PATCH 1/2] sysdeps: loongarch: update syscall lists [PATCH 2/2] Mention support of loongarch in README and NEWS

Generated syscallent.h with mksyscallent according to
Linux 6.10 uapi header file asm-generic/unistd.h. And
modified format and details manually to be consistent
with the kernel.

loongarch architecture has been supported since commit 5cffc0d.
So we should add it to README and NEWS.
Hui Li <lihui@loongson.cn> yes 2024-07-16
0018-Fix-printf-parser-treating-field-width-as-array-leng.patch Fix printf() parser treating field width as array length for strings (Closes: #804494)

Given:
#include <stdio.h>
int main() {
printf("'%8.4s' '%8s' '%.4s'\n", "1234567890", "1234567890", "1234567890");
printf("'%*.*s' '%*s' '%.*s'\n", 8, 4, "1234567890", 8, "1234567890", 4, "1234567890");
}

Compare:
$ ./ltrace.before -F etc ./q | cat
printf("'%8.4s' '%8s' '%.4s'\n", "1234567890", "12345678", "1234") = 31
printf("'%*.*s' '%*s' '%.*s'\n", 8, 4, "1234", 8, "12345678", 4, "1234") = 31
' 1234' '1234567890' '1234'
' 1234' '1234567890' '1234'
+++ exited (status 0) +++
$ ./ltrace.after -F etc ./q | cat
printf("'%8.4s' '%8s' '%.4s'\n", "1234", "1234567890", "1234") = 31
printf("'%*.*s' '%*s' '%.*s'\n", 8, 4, "1234", 8, "1234567890", 4, "1234") = 31
' 1234' '1234567890' '1234'
' 1234' '1234567890' '1234'
+++ exited (status 0) +++

Of course, printf("%2$s") is still hopeless. But!
=?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2024-11-29
0019-Allow-tracing-shebanged-programs-directly-Closes-614.patch Allow tracing shebanged #! programs directly (Closes: #614994) =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2024-11-29
19.patch [PATCH] Fix double free in get_enum
When result is destroyed it also runs the destructor on the lens it owns
and frees it.
Andreas Schwab <schwab@suse.de> yes 2023-09-11
21.patch RISC-V: Add support for c.ebreak, as 4-byte ebreak sometimes causes OOB Mateusz Bieganski <m.bieganski@samsung.com> yes 2024-01-02
0022-ltrace-crashes-when-trying-to-resolve-memory-mapped-.patch ltrace crashes when trying to resolve memory mapped shared libraries of an inferior under /proc/self/fd/* =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2024-12-08
0023-getcwd-returns-string-not-string2.patch getcwd() returns string, not string2 =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2024-12-09
0024-Add-hton-ls-ntoh-ls-.-More-unbuffered-stdio-__overfl.patch Add hton[ls]()/ntoh[ls](). More unbuffered stdio (__overflow, __fpending, fputs_unlocked). Checked printfs (__{v,}{f,s,as,}printf_chk,
__obstack_{v,}printf_chk). dirname(), memmem(), fe[gs]etround()
=?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> no 2025-01-29
0025-Fix-SIGABRT-if-ltelf_init-early-exited.patch Fix SIGABRT if ltelf_init() early-exited
Repro with:
#!/bin/sh -e
cat <<__END__ | gcc -shared -O -o liblib.so -Wall -Werror -fPIC -xc -
void DoNothing();
void DoNothing() {}
__END__

cat <<__END__ | gcc -L$PWD -Wl,-rpath=$PWD -Wall -Werror -O -o bin -xc - -llib
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

void DoNothing();

int main() {
while (1) {
sleep(1);
DoNothing();
}
return 0;
}
__END__

./bin &
sleep 0.1

mv liblib.so liblib.so.orig

echo "===> Running ltrace -p $! ..."
gdb --args ./ltrace -p $!

Yielding
> Can't open /tmp/tmp.oldWtch6po/liblib.so: No such file or directory
> Couldn't determine base address of /tmp/tmp.oldWtch6po/liblib.so
> ltrace: ltrace-elf.c:426: ltelf_destroy: Assertion `(&lte->plt_relocs)->elt_size == sizeof(GElf_Rela)' failed.

This corresponds to the last line in
void
ltelf_destroy(struct ltelf *lte)
{
debug(DEBUG_FUNCTION, "close_elf()");
elf_end(lte->elf);
close(lte->fd);
VECT_DESTROY(&lte->plt_relocs, GElf_Rela, NULL, NULL);
}
and removing it fixes it
===> Running ltrace -p 169396 ...
Can't open /home/nabijaczleweli/uwu/repro/ltrace/liblib.so: No such file or directory
Couldn't determine base address of /home/nabijaczleweli/uwu/repro/ltrace/liblib.so
Couldn't load ELF object /home/nabijaczleweli/uwu/repro/ltrace/liblib.so: Bad file descriptor
Can't open /home/nabijaczleweli/uwu/repro/ltrace/liblib.so: No such file or directory
Couldn't determine base address of /home/nabijaczleweli/uwu/repro/ltrace/liblib.so
Couldn't load ELF object /home/nabijaczleweli/uwu/repro/ltrace/liblib.so: Bad file descriptor
DoNothing(0, 0, 0, 0x545634c3) = 0
sleep(1, 0, 0, 0x545634c3) = 0
DoNothing(0, 0, 0, 0x545634c3) = 0
because it's never been initialised
(gdb) p lte->plt_relocs
$2 = {data = 0x0, size = 0, allocated = 0, elt_size = 0}

Initialsie the vect alongside initialising the lte, not just on success.
=?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz> yes 2025-03-26

All known versions for source package 'ltrace'

Links