Currently --track-fds=yes or --track-fds=all report both bad usage and never closed file descriptors. Sometimes users are only interested in bad file descriptor usage errors, but don't care about never close file descriptors. Instead of making them create suppressions for the never closed file descriptors we could have an --track-fds=bad mod that only reports errors on bad usage. This might also make an interesting mode that we might want to enable by default.
So the only difference between yes/all and bad would be the printing of the still open file descriptors in VG_(show_open_fds). Note that gdbserver can also call show_open_fds. That should probably still show the list. So you should check the when argument (Which is "" when called from gdbserver).
Created attachment 182411 [details] patch Add "bad" option for --track-fds. When --track-fds=bad is specified, do not warn about leaked file descriptors and only warn about file decriptors which was not opened or already closed. Add none/tests/track_bad test to test the new option. Adjust none/tests/cmdline1 and none/tests/cmdline2 expected output.
We discussed a bit on irc and we updated the docs and the usage string. You should also update none/tests/cmdline1.stdout.exp-non-linux and none/tests/cmdline2.stdout.exp-non-linux And none/tests/track_bad.stderr.exp is missing.
Created attachment 182607 [details] patch
Created attachment 182619 [details] cmdline2 non-linux expected All OK apart from this expected.
Pushed: commit 2942c04c485076d84a2df8ee6bb901bb0f014c51 Author: Alexandra Hájková <ahajkova@redhat.com> Date: Fri Jun 20 03:21:41 2025 -0400 Add "bad" option for --track-fds. When --track-fds=bad is specified, do not warn about leaked file descriptors and only warn about file decriptors which was not opened or already closed. Update the documentation in docs/xml/manual-core.xml. Add none/tests/track_bad test to test the new option. Adjust none/tests/cmdline1 and none/tests/cmdline2 expected outputs. https://bugs.kde.org/show_bug.cgi?id=493434