This is the mail archive of the
mailing list for the Cygwin project.
Re: gawk: Bad File Descriptor error with concurrent readonly access to a network file
- From: "Matt D." <matt at codespunk dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 27 Oct 2015 06:48:13 -0400
- Subject: Re: gawk: Bad File Descriptor error with concurrent readonly access to a network file
- Authentication-results: sourceware.org; auth=none
- References: <AB495CE313664A489959F8DEF45069A90188AA0710 at EXSRV01 dot avt-imst dot local> <20151027095243 dot GQ5319 at calimero dot vinschen dot de>
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.
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: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple