delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/10/27/05:53:15

X-Recipient: archive-cygwin AT delorie DOT 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:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=aGBFSb3VSKgDfMqvLtEyK2ziPIqgyPKxQPwGCHciH3IoPGNHpml3q
UaHSjEmPpVAtOvy3aemyKuVJVc0Wbcp8Q7qZZ9o9QTpCAxK+BUZ3E0lYEcoyKVio
9XEh7OCAiey6JouX3F7ZNC8kp5Zs5Du4VZxyZ0Rm3z4Adh6/j8SmwE=
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:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=uKmJ5GupQ78OSZYTkmf8hqHE2n0=; b=tkyj0t/4t5mxV0/9tpFHmam4J0BR
JKNIX4BCrlVp74wM3X1cfFdcDB4BRA+dfGdxZ+Lm8GjKqY8IY3+PBdJT1iwQIdn8
lLT0/P08Nv7FAIjPcoRZSk4ayP/BV/tand8RQ4t9+2LPmoZYLed+a3UYpTmema23
XBKmrsLEIHVxDso=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL,BAYES_20,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-HELO: calimero.vinschen.de
Date: Tue, 27 Oct 2015 10:52:43 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: gawk: Bad File Descriptor error with concurrent readonly access to a network file
Message-ID: <20151027095243.GQ5319@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <AB495CE313664A489959F8DEF45069A90188AA0710 AT EXSRV01 DOT avt-imst DOT local>
MIME-Version: 1.0
In-Reply-To: <AB495CE313664A489959F8DEF45069A90188AA0710@EXSRV01.avt-imst.local>
User-Agent: Mutt/1.5.23 (2014-03-12)

--C6GqtNjDdnDsBy9k
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.
>=20
> 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

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--C6GqtNjDdnDsBy9k
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWL0lrAAoJEPU2Bp2uRE+gHssQAKP50j/H+0jdsuJdkOZK5V/r
wAc+CcSGZcdeZuZQ6AJl32C1zJ0D0WZOfvNKNX6EB91h82aJz4WDmM3WEWsk0M59
tT5aUJNZkr1RnDU839pR62MIM03f0xIQTS3bRPzlsSUkGICZjq/GgJwkogyn3AMm
lAYaMQhz5GBHjviPKWLLtqKTcsI63msUAOnAY2zHiqH9Y/2kgOsHwUYGhVAl/iHn
C74xH20lpG/T/Dm54l5IbLIfbrU1EkSZ3gNpsFQk0FfLhUR8aHQKjwBFnaoQW1LC
g3K2TEye68GDu2DsopzbfwXaROVBEsy0VVlckHIinQwvl1ip1tgdmYyXAqenBvd6
STaz96WIj/Ne96r3oVrBsCAq0yUXTkSAVfZ2vAjZOjivbNbHpzmUcq/EyIqLkmki
t1hp1eUytE9fyiA8akzR6XH4rEXeY3OHCaDlws93O0An+gEXq+qIr/Q4jHQAokHO
R1RoKOo7Q/sirwksYo95QHVo9w5lAyqepwxyR/h/Wkb8B/pYOX/kI2cBTfmnwG2p
/DZxMConcdvi/3bJyxU7CpE7ExSv5fXk5Pv3E9wCqPUB5E64lWZ3xcAiwh/LOrkf
+oLbcV8MJ7kvlboOCSVDyD5JGexweQ392+hCPcCZXJ42q4UeMSdW9rIwCGNHC3T/
8LWjsqaIOLqCAsfpO97w
=2Kys
-----END PGP SIGNATURE-----

--C6GqtNjDdnDsBy9k--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019