Bug 514762 - Many "Bad file descriptor" messages when using --track-fds=yes and -d on systems without /proc
Summary: Many "Bad file descriptor" messages when using --track-fds=yes and -d on syst...
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: 3.27 GIT
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Paul Floyd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-17 20:21 UTC by Paul Floyd
Modified: 2026-01-17 20:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Floyd 2026-01-17 20:21:06 UTC
Loads of
--47513:1:VG_(fcnt fcntl error 9 Bad file descriptor
messages

This is due to

init_preopened_fds_without_proc_self_fd()

   for (i = 0; i < count; i++)
      if (VG_(fcntl)(i, VKI_F_GETFL, 0) != -1)
         ML_(record_fd_open_named)(-1, i);

The loop will result in one message per file that does not exist. On my RPi FreeBSD rlimit open files is 231219 and indeed I do see 231214 messages.

I'll turn off logging for that loop.
Comment 1 Paul Floyd 2026-01-17 20:33:01 UTC
On second thoughts, I'll just remove the VG_(debugLog) call. Pretty much all of the other libcfile.c functions do not log errors.