Improve the fdleak filter and adjust the track_new expected output.

This commit is contained in:
Alexandra Hájková
2025-04-14 16:26:08 +02:00
parent dfa98b51e8
commit 61a3254795
3 changed files with 15 additions and 8 deletions

View File

@@ -34,6 +34,14 @@ perl -p -e "s/: open \(/: creat (/" |
# arm64 write resolved to file:line with debuginfo
perl -p -e "s/write\.c:[1-9][0-9]*/in \/...libc.../" |
# Remove "internal" _functions
sed '/by 0x........: _/d' |
sed -E 's/ ([a-zA-Z0-9_]+)@@?[A-Z0-9._]+/ \1/' |
perl -p -e "s/\(dprintf.c:[0-9]*\)/(in \/...libc...)/" |
perl -p -e "s/\(open.c:[0-9]*\)/(in \/...libc...)/" |
perl -p -e "s/\(lseek(?:64)?.c:[0-9]*\)/(in \/...libc...)/" |
# FreeBSD specific fdleak filters
perl -p -e 's/ _close / close /;s/ _openat / creat /;s/ _write/ write/;s/internet/AF_INET socket 4: 127.0.0.1:... <-> 127.0.0.1:.../' |
sed '/by 0x........: close (in \/...libc...)/d' |

View File

@@ -1,12 +1,10 @@
File descriptor 1020 was closed already
File descriptor was closed already
at 0x........: write (in /...libc...)
by 0x........: __printf_buffer_flush_dprintf (in /...libc...)
by 0x........: __vdprintf_internal (in /...libc...)
by 0x........: dprintf (in /...libc...)
by 0x........: main (track_new.c:15)
by 0x........: dprintf
by 0x........: main
Previously closed
at 0x........: close (in /...libc...)
by 0x........: main (track_new.c:10)
by 0x........: main
Originally opened
at 0x........: open (in /...libc...)
by 0x........: main (track_new.c:8)
at 0x........: creat (in /...libc...)
by 0x........: main

View File

@@ -1,3 +1,4 @@
prog: track_new
prereq: test -x track_new
vgopts: -q --track-fds=yes --modify-fds=high
stderr_filter: filter_fdleak