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=BWWeA9bPP9scy7Q4j3FAkZ7KoeyjC38zy0Fdbcmkau2R45Fo8V7ON uu73rN7EeI3yryLjx9W1FThOXJ2CGHshF/IZgWjgdK3pP6TxWhMsj+ynsyeSzRIm qSEz2vIs0nFwcyk7+KTsA07klXC2lL1aQByz3lnQblh7LLzQO2FArg= 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=mVwc8elVHSaymTX9a+4PyPtHQ3k=; b=fSoZLh4pyTlUYDNX3NUfApPhG6RU stEXk2qaq85Nj4MQXZE6kAcASwyxztiQ+P8LzmPRqWHz4cOy4CieW/rJznIkR+9M sD1Zr8eTCU5FGZmVFnp4+rCV+S1slzIHP0uavKz17pqSNC8SxdZ3fXa//HXH/3aH /msYHYzBWcyEzpI= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: calimero.vinschen.de Date: Tue, 27 Oct 2015 14:28:33 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: gawk: Bad File Descriptor error with concurrent readonly access to a network file Message-ID: <20151027132833.GT5319@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20151027095243 DOT GQ5319 AT calimero DOT vinschen DOT de> <562F566D DOT 3020406 AT codespunk DOT com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TWU5dZlpCh7alCLz" Content-Disposition: inline In-Reply-To: <562F566D.3020406@codespunk.com> User-Agent: Mutt/1.5.23 (2014-03-12) --TWU5dZlpCh7alCLz Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Oct 27 06:48, Matt D. wrote: > 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. >=20 > The reported "Bad File Descriptor" is the same error that I get. That's fine and all, but it doesn't add any new info to the case. >=20 > Matt D. >=20 > 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. I'm running the testscript for a few hours now, with a server under heavy load, but I still can't reproduce it. Is this a bad interaction with some virus scanner, perhaps? Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --TWU5dZlpCh7alCLz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWL3wBAAoJEPU2Bp2uRE+g89IP/26V7kDXB1gn1MwQAaz1gsO7 Ab7VY5rQpCz92iBO2IlAKC4hKv0VV8KAGoUlK9xTpxvpxVynWKR8KfwsRGUB8Jt4 hYic023O6WCzk5pwqZSKErTTgjGKYa7DkWgj33CSLnYePTKG2NugAusYx/FHQ++Y jEtSFzLF82AUzkUgstNJVDVCFG1PJ6DCekPerhduYLEX2ge8x+wtXn5xBKTv3Md0 ySr0zyr5y/4uaf2bQSVlnfzHjVeaVIBNlEMdNiDKOXgJahWS6JBbeLkfZucUJpxx GvM0mt/2rexJ4OdYbBnvn9vFzXbo4hD5NF+jitgVPTkMaJPAD6Sum75Unwj7upZA BNPEIwn89vs9PaRg9XvlXMJGPtT4+nM94sHwrwLieXB6ahMYd4lXzDlOP76uawVs qnUNydN3Xl9FxdFi24a2afCZdPVwGCbHVbdXDfmwdKXIA4eAlXAbrP2J4F4oCz3n 0+om66O0EpRRSb6Qm+FB0+uF14f3obYAUIpbxaWYRzoqRJmZiJ8+jwpujATLojwV IW3CZSHECS+qKHAVoUr5Tu+zDxLnJaJLWvH6yaDlnQTBZKh8k03BNy/hPfu/AH8A HlHPbZSgOYcRE+7krlpFJRskFYJuO56fCWCnDHWcrsW5Kbos4jsyt/ckFg+dSD+X z/HWlMLdL8RA2rBYcdyG =mLqP -----END PGP SIGNATURE----- --TWU5dZlpCh7alCLz--