]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Check whether file descriptor is inherited before printing where_opened users/mark/try-doubleclose0
authorMark Wielaard <mark@klomp.org>
Sun, 18 May 2025 13:31:36 +0000 (15:31 +0200)
committerMark Wielaard <mark@klomp.org>
Sun, 18 May 2025 13:31:36 +0000 (15:31 +0200)
commit8187386962598d1393eaf6cf4e032996f5edabb3
treee6f1d0358492519a72e7c9c10968ae0aebbc05d3
parent2045aefbb0261bd5844b693e5d390affcffb8749
Check whether file descriptor is inherited before printing where_opened

Inherited file descriptors don't have an ExeContext where they were
opened (by the program). So don't try to print the NULL where_opened
when reporting double close errors for such file descriptors.

Add a testcase none/tests/fdleak_doubleclose0 that crashes valgrind
before this fix.

https://bugs.kde.org/show_bug.cgi?id=504466
coregrind/m_syswrap/syswrap-generic.c
none/tests/Makefile.am
none/tests/fdleak_doubleclose0.c [new file with mode: 0644]
none/tests/fdleak_doubleclose0.stderr.exp [new file with mode: 0644]
none/tests/fdleak_doubleclose0.vgtest [new file with mode: 0644]