X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=TiCP1Vzf9rhL6cQU
	zxllj9Fwdd6c+yliW8ZT/kW1Vec2coDVDTWOvhZmPn9XvE0kB/W09YhKN3mUxVGX
	WlQW+IPq8c4Z2RnN8ClIXF4QnXILjPdVsvGX8vX2FRy4Gh7gjO4Ip5J0OaPulLAV
	a23rOdrc86vTJmRYkibSQ2nKLYg=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=GemiI5Gh6H93VLla6O9K1G
	B+9Gg=; b=IqLHh60ARgU3uj6nv7Trr+QB6qJyWvUxnRqmNAOHS/hYlxp8CWG19r
	E01XFin+H+QypGBCI5ud7/hT6fHGoDw+60UbVyZJOv01Xkrn0mdRQkkXSKXe3WNE
	lGbVZs8rVWLIZ772G6zWseBZcx1/FpB4rrgN2HKeEViiVL9bvlMKA=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-pa0-f49.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20130820;        h=subject:to:references:from:message-id:date:user-agent:mime-version         :in-reply-to:content-type:content-transfer-encoding;        bh=TD7yd+Nnc87bAVwyUzuQhmhYj9SGbFuIcXXDR2q2mpw=;        b=hoRG8egoILg6i9azhjQUkQ7z+UbZxAawdxxisD9m744kli3ah5bSdp9z+fB8uOgkY/         TMO/pnTSCjeBoi9kciWyQs6sJzGGsnoMqSlVaOX0e9CdwNdVE+Smbwc49D0QqhO4VP1/         yWEMSkpVml+va0UErlWerRN/TQtJQlHH47x8c7N9wtmBPhix3Gsv+e6WIfvnLCws5NFQ         LCHDjivvD/Pr11t2BCsXBNYqDTIVX6d76gWfsW96fES6HALsVJzcOm62CrQsfpzcs9rg         HZ6KxhROd4ukEccVF0epWwmstfoE13y0tNdBUFDpYWv+adQ7O6NOSgAwULfWX3ZjOMnJ         uEcA==
X-Received: by 10.68.131.161 with SMTP id on1mr27519805pbb.144.1445942956635;        Tue, 27 Oct 2015 03:49:16 -0700 (PDT)
Subject: Re: gawk: Bad File Descriptor error with concurrent readonly access to a network file
To: cygwin@cygwin.com
References: <AB495CE313664A489959F8DEF45069A90188AA0710@EXSRV01.avt-imst.local> <20151027095243.GQ5319@calimero.vinschen.de>
From: "Matt D." <matt@codespunk.com>
Message-ID: <562F566D.3020406@codespunk.com>
Date: Tue, 27 Oct 2015 06:48:13 -0400
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <20151027095243.GQ5319@calimero.vinschen.de>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

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
>> thrown.
>
> 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.
>
>
> Corinna
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

