This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gawk: Bad File Descriptor error with concurrent readonly access to a network file

I haven't had an opportunity to look into it but I've also encountered errors when performing a parallel make build (make -j) on a large C++ project which has multiple interdependencies across a network share with too many threads.

The reported "Bad File Descriptor" is the same error that I get.

Matt D.

On 10/27/2015 5:52 AM, Corinna Vinschen wrote:
On Sep 25 16:31, Vermessung AVT - Wolfgang Rieger wrote:
1) Concurrent read access to the setup files was possible and worked
fine with local files (24 hrs testing with millions of file accesses
in 4 parallel jobs).
2) However, when the file to be read (datafile.txt) is stored on a
network share on a file server - which is the case in our working
environment - the error could be reproduced. The number of Bad file
descriptor errors seems to be related to the work load at the server
where the file resides.
3) The MS copy command shows no such error, even with network files.
So we can substitute the cat's by copy's. For gawk, however, there is
no shell alternative.

It looks like there is a small time frame in opening files when the
server file is non-accessible to other processes. If a parallel job
happens to access the same file within that short time period while
another process is opening it, the "Bad File Descriptor" error is

Cygwin uses full sharing for all files it opens, unless the file is
opened in very specific circumstances (e.g, creating a symlink, deleting
a file).  "Bad file descriptor" doesn't point to a sharing problem.
It seems the handle is unusable or something.

I tried your testcase and I can't reproduce the problem in my
environment.  Have you tried catching a trace of the problem via
strace?  It would be helpful to see where the EBADF occurs.


Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]