opendir/readdir hangs on futex

281 Views Asked by At

I have a program that has been running fine for months, and 2 days before being shown to the brass, it just hangs at the beginning, while exploring a file structure. Here's a backtrace:

#0  futex_wait (private=0, expected=2, futex_word=0x55555556c204) at ../sysdeps/nptl/futex-internal.h:146
#1  __GI___lll_lock_wait_private (futex=futex@entry=0x55555556c204) at lowlevellock.c:35
#2  0x00007ffff7e30a03 in __GI___readdir64 (dirp=0x55555556c200) at ../sysdeps/unix/sysv/linux/readdir64.c:37
#3  0x000055555555be55 in N2_GetRunNumbers (RootDirName=0x7fffffffca10 "LiveData", Direct=1, RunNoList=0x7fffffffc938)
at N2readData.c:471

And here's the corresponding code (line 471 is the readdir call):

struct dirent *dir;
DIR *d = opendir(RootDirName);
if (d) 
    while ((dir = readdir(d)) != NULL) { ...}

Reading the documentation on readdir, nowhere does it state that it can be blocking.

Now the hitch is that the directory I'm reading is mounted via sshfs, but I have full R/W access. So what could be the reason ?

0

There are 0 best solutions below