Closed paulfloyd closed 1 year ago
I tried the new fcntl F_KINFO and (according to someone on IRC) it only does a 'best effort' lookup of the cache. That 'best effort' is not good enough. In particular, all regtests do something like
valgrind test > stdout.err.out 2> stderr.err.out
So fd 1 is (always?) stdout.err.out
And fcntl F_KINFO just returns a blank string "" for these fd 1s. It doesn't return a failure error code either.
Don't get this on my desktop. Could be flakiness as described above that only happens in VBox.
The raw output, trimmed, is
But the expected is
The diff is
The testcase does a fork and a bunch of file/socket things in both parent and child. And it looks like it's the parent process that is wrong.
And it's probably
Bool VG_(resolve_filename) ( Int fd, const HChar** result )
that is failing.
Need to debug that.
However there is a new way to get the name
https://freebsdfoundation.org/blog/freebsd-foundation-q4-2021-status-update/
and
https://reviews.freebsd.org/D33277
That's in FreeBSD 13.1 14 but not 12.3 or 13 or earlier.
Might just be that this code is not fork-safe. Or a FreeBSD bug?
struct kinfo_file has changed a lot in FreeBSD but I don't think that it is incompatible.
OK debugged resolve_filename, it finds the fd but it contains an empty string.