[valgrind] [Bug 311655] --log-file=FILE leads to apparent fd leak ("Open file descriptor 3: $LOGFILE")

2024-01-12 Thread Mark Wielaard
https://bugs.kde.org/show_bug.cgi?id=311655

Mark Wielaard  changed:

   What|Removed |Added

 CC||ahajk...@redhat.com,
   ||m...@klomp.org

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 311655] --log-file=FILE leads to apparent fd leak ("Open file descriptor 3: $LOGFILE")

2022-02-27 Thread eldipa
https://bugs.kde.org/show_bug.cgi?id=311655

eldipa  changed:

   What|Removed |Added

 CC||martinp.dipa...@gmail.com

--- Comment #1 from eldipa  ---
I can confirm the bug in the latest version of valgrind (commit 7f1127140).

There is one catch if you want to reproduce it with the test suite: to make the
output reproducible the tests close all the inherited file descriptors which
sadly, hides the bug.

To reproduce it, pick the test file "none/tests/fdleak_pipe.c" and comment out
the macro "CLOSE_INHERITED_FDS". and recompile with "make check".

Execute:
 ./vg-in-place --track-fds=yes --log-file=foo.log none/tests/fdleak_pipe 
 cat foo.log

This is the output that I've got:

==19349== Memcheck, a memory error detector
==19349== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==19349== Using Valgrind-3.19.0.GIT and LibVEX; rerun with -h for copyright
info
==19349== Command: none/tests/fdleak_pipe
==19349== Parent PID: 19347
==19349== 
==19349== 
==19349== FILE DESCRIPTORS: 6 open (3 std) at exit.
==19349== Open file descriptor 5:
==19349==at 0x4967C57: pipe (syscall-template.S:78)
==19349==by 0x10916F: main (fdleak_pipe.c:10)
==19349== 
==19349== Open file descriptor 4:
==19349==at 0x4967C57: pipe (syscall-template.S:78)
==19349==by 0x10916F: main (fdleak_pipe.c:10)
==19349== 
==19349== Open file descriptor 3: /home/user/forks/valgrind/foo.log
==19349==
==19349== 
==19349== 
==19349== HEAP SUMMARY:
==19349== in use at exit: 0 bytes in 0 blocks
==19349==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==19349== 
==19349== All heap blocks were freed -- no leaks are possible
==19349== 
==19349== For lists of detected and suppressed errors, rerun with: -s
==19349== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

-- 
You are receiving this mail because:
You are watching all bug changes.