stat nr_link incorrect for /proc/self/task
therealkenc opened this issue · 5 comments
therealkenc commented
Filing this just so there's a well formed test case on the books and something to point to as duplicates are reported. Here's hoping there's a five min fix. Exists in the wild here. It's (academically) the current fatal on the body of software in question because #546 was squashed.
Nothing to see in an strace
b/c the syscalls all succeed.
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
int main(int argc, const char *argv[]) {
int proc_fd = open("/proc", O_RDONLY|O_DIRECTORY);
struct stat task_stat;
fstatat(proc_fd, "self/task/", &task_stat, 0);
if (task_stat.st_nlink < 3) {
// should never get here -- all /proc/self/task directories
// should have at least ourselves plus . and ..
fprintf(stderr, "unexpected task_stat.st_nlink < 3\n");
}
return 0;
}
stehufntdev commented
Thanks for reporting the issue and providing the sample code. Adding the bug tag.
JasonLinMS commented
We'll have correct link counts for directories in /proc and /sys. Thanks!
therealkenc commented
You guys are on fire this week.
JasonLinMS commented
Sprinting towards Creators Update!
therealkenc commented
@JasonLinMS this is fixed in 15042 -15048 as well. This one is part of what lit up out-of-the-box chrome so thanks.