]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Filter away "main" differences in filter_fdleak
authorMark Wielaard <mark@klomp.org>
Tue, 23 Apr 2024 12:14:33 +0000 (14:14 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 23 Apr 2024 12:14:33 +0000 (14:14 +0200)
Stack traces showing where fds were created show some differences in
the "main" function, different line numbers, or (in binary) or (below
main). Since the precise location of the original call in the main
function isn't the goal of these tests just filer them all out and
replace them with a simple "main".

none/tests/fdleak_ipv4.stderr.exp
none/tests/file_dclose.stderr.exp
none/tests/filter_fdleak
none/tests/socket_close.stderr.exp

index c7493fab92d47208efc403c2bd53d89e64d0164f..9612ef72ac9a897474e5e2aa5db4e12735a9c7cd 100644 (file)
@@ -2,15 +2,15 @@
 File descriptor 4: AF_INET socket 4: 127.0.0.1:... <-> 127.0.0.1:... is already closed
    at 0x........: close (in /...libc...)
    by 0x........: client (fdleak_ipv4.c:70)
-   by 0x........: main (fdleak_ipv4.c:90)
+   by 0x........: main
  Previously closed
    at 0x........: close (in /...libc...)
    by 0x........: client (fdleak_ipv4.c:69)
-   by 0x........: main (fdleak_ipv4.c:90)
+   by 0x........: main
  Originally opened
    at 0x........: dup (in /...libc...)
    by 0x........: client (fdleak_ipv4.c:68)
-   by 0x........: main (fdleak_ipv4.c:90)
+   by 0x........: main
 
 FILE DESCRIPTORS: 5 open (3 std) at exit.
 Open AF_INET socket 4: 127.0.0.1:... <-> 127.0.0.1:...
index fa14b56b3f5cd4152426e36e0590b5ee39bce390..26721e6f56c83b44afe342abeaf56663d9088f38 100644 (file)
@@ -3,11 +3,11 @@ time passes and we close 3 again
 File descriptor 3: file_dclose.tmp is already closed
    at 0x........: close (in /...libc...)
    by 0x........: closefile (file_dclose.c:17)
-   by 0x........: main (file_dclose.c:35)
+   by 0x........: main
  Previously closed
    at 0x........: close (in /...libc...)
-   by 0x........: main (file_dclose.c:31)
+   by 0x........: main
  Originally opened
    at 0x........: creat (in /...libc...)
    by 0x........: openfile (file_dclose.c:11)
-   by 0x........: main (file_dclose.c:28)
+   by 0x........: main
index d1fbfe043225703d8b4902a180acfc7fc7020c0c..a558021dc227caf3ddfa19048018e13d4bb9d609 100755 (executable)
@@ -37,6 +37,9 @@ awk '/ at .* _syscall6 /{getline; getline; sub(/ by /, " at "); print; next}{pri
 # painfully minor variations between them.
 perl -p -0 -e 's/(Open[^\n]*\n)(   (at|by)[^\n]*\n)+/$1   ...\n/gs' |
 
+sed "s/by 0x........: (below main)/by 0x........: main/" |
+sed "s/by 0x........: main (.*)/by 0x........: main/" |
+
 # With glibc debuginfo installed we might see syscall-template.S, close.c or creat64.c
 perl -p -e "s/\(syscall-template.S:[0-9]*\)/(in \/...libc...)/" |
 perl -p -e "s/\(close.c:[0-9]*\)/(in \/...libc...)/" |
index 8846620461af74e1c36c4c0af8de22d138b65383..5352390dd97911a9670b1ae9127f908e5fe52da6 100644 (file)
@@ -3,11 +3,11 @@ close socket_fd 3
 and close the socket again 3
 File descriptor 3: AF_UNIX socket 3: /tmp/vgtest-foofrob is already closed
    at 0x........: close (in /...libc...)
-   by 0x........: main (socket_close.c:40)
+   by 0x........: main
  Previously closed
    at 0x........: close (in /...libc...)
-   by 0x........: main (socket_close.c:36)
+   by 0x........: main
  Originally opened
    at 0x........: socket (in /...libc...)
    by 0x........: open_socket (socket_close.c:17)
-   by 0x........: main (socket_close.c:31)
+   by 0x........: main