]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
syswrap-generic: Emit pp_ExeContext after the file descriptor backtrace
authorAlexandra Hájková <ahajkova@redhat.com>
Mon, 3 Mar 2025 11:14:08 +0000 (06:14 -0500)
committerMark Wielaard <mark@klomp.org>
Wed, 5 Mar 2025 15:09:23 +0000 (16:09 +0100)
Adjust use_after_close test for the change.

coregrind/m_syswrap/syswrap-generic.c
none/tests/use_after_close.stderr.exp

index 175c94b4d7a07337e56e1ff30478b0ee80cad78f..dea656aab2701ba5254680d30b6129943f504b86 100644 (file)
@@ -1185,6 +1185,7 @@ void fd_pp_Error (const Error *err)
       }
       VG_(emit)("%sFile descriptor %d %s%s\n", whatpre, nce->fd,
           error_string, whatpost);
+      VG_(pp_ExeContext)(where);
       /* If the file descriptor was never created we won't have
          where_closed and where_opened. Only print them in a
          use after close case.  */
@@ -1196,7 +1197,6 @@ void fd_pp_Error (const Error *err)
         VG_(emit)("%sOriginally opened%s\n", auxpre, auxpost);
         VG_(pp_ExeContext)(nce->where_opened);
       }
-      VG_(pp_ExeContext)(where);
    } else {
       vg_assert2 (False, "Unknown error kind: %d",
                   VG_(get_error_kind)(err));
index 1ef31c6551eb50436a2010defecc55e41bd79cd1..75a8d6672949d6aec88fd5d3167aad6fb5a405ce 100644 (file)
@@ -1,13 +1,13 @@
 bad
 File descriptor 3 was closed already
+   at 0x........: write (in /...libc...)
+   by 0x........: main
  Previously closed
    at 0x........: close (in /...libc...)
    by 0x........: main
  Originally opened
    at 0x........: dup (in /...libc...)
    by 0x........: main
-   at 0x........: write (in /...libc...)
-   by 0x........: main
 File descriptor 7 was never created
    at 0x........: write (in /...libc...)
    by 0x........: main