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=TOHZnECVXKoKuCYEtbsqHuG4ZO7mmt3h2+uAACwU+rQdixdiGxPcP bS8UqAIEVTJM+TqWdgvmEBjYQZ2HhKHkDHuBdixdB2WpJUxaTNkGzT2UPaIan5Uw OxXotiKe/8/n2nsx3Lx1wETUMNVvWElg6nVtTvCzBXudGNruBD8M78= 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=DJaC2PYymwI+FQaiSM6eR8frhZA=; b=DzymfYcak4KCivcuBVC1WOGjMKy5 iMoDNcme7lUWg6TJp7I11r2A7xI0KiJNLrIlcddcpuhE9DnPCPrkEYtZkRF7B5oi Pk3g8c3l2BTEKt1PKSeb8YDf255YgbWz2lA69lO/0XaneqG9uj05g+K+cIdtixpB y401tgp/s0KYp4Y= 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=-4.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: calimero.vinschen.de Date: Wed, 28 Oct 2015 10:10:23 +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: <20151028091023.GX5319@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5KObZtj3Gjpm0OUY" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) --5KObZtj3Gjpm0OUY Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Oct 27 23:30, Vermessung AVT - Wolfgang Rieger wrote: > From: Corinna Vinschen [mailto:corinna-cygwin AT cygwin DOT com] > Sent: Tuesday, October 27, 2015 10:53 > To: cygwin AT cygwin DOT com > Subject: Re: gawk: Bad File Descriptor error with concurrent readonly acc= ess to a network file > (Snip) > > Cygwin uses full sharing for all files it opens, unless the file is ope= ned in very specific circumstances (e.g, creating a symlink, > > deleting a file). "Bad file descriptor" doesn't point to a sharing pro= blem. > > It seems the handle is unusable or something. > > > > I tried your testcase and I can't reproduce the problem in my environme= nt. > > Have you tried catching a trace of the problem via strace? > > It would be helpful to see where the EBADF occurs. >=20 > Here is the portion of strace output where IMHO the error occurs. The beh= aviour is quite different when running with strace, so I hope it is the sam= e error situation, but at least the message given is "Bad file descriptor". > I changed the paths to ???. This is strace --mask=3Dsyscall. If you need = further info I would appreciate to send it directly to you since there is a= lot of info in strace I do not want to put into the www: >=20 > 197 70416 [main] gawk 3844 open: 3 =3D open(???\datafile.txt, 0x8000) > 327 70743 [main] gawk 3844 fcntl64: 0 =3D fcntl(3, 1, 0x0) > 265 71008 [main] gawk 3844 fcntl64: 0 =3D fcntl(3, 2, 0x1) > 3298 74306 [main] gawk 3844 fhandler_base::fstat_helper: 0 =3D fstat (= \??\???\datafile.txt, 0x8004AEF8) st_size=3D135, st_mode=3D0100644, st_ino= =3D281474976912276st_atim=3D551A9D6D.BD48F54 st_ctim=3D5603C3F5.26F49798 st= _mtim=3D54E1ECAE.B2A66C8 st_birthtim=3D551A9D6D.BD48F54 > 206 74512 [main] gawk 3844 fstat64: 0 =3D fstat(3, 0x8004AEF8) > 216 74728 [main] gawk 3844 isatty: 0 =3D isatty(3) > 1887 76615 [main] gawk 3844 fhandler_base::fstat_helper: 0 =3D fstat (= \??\???\datafile.txt, 0x8004AEF8) st_size=3D135, st_mode=3D0100644, st_ino= =3D281474976912276st_atim=3D551A9D6D.BD48F54 st_ctim=3D5603C3F5.26F49798 st= _mtim=3D54E1ECAE.B2A66C8 st_birthtim=3D551A9D6D.BD48F54 > 241 76856 [main] gawk 3844 fstat64: 0 =3D fstat(3, 0x8004AEF8) > 304 77160 [main] gawk 3844 read: read(3, 0x8004AF90, 135) blocking > 1722 78882 [main] gawk 3844 seterrno_from_nt_status: /home/corinna/src= /cygwin/cygwin-1.7.33/cygwin-1.7.33-1.i686/src/src/winsup/cygwin/fhandler.c= c:276 status 0xC0000128 -> windows error 6 0xC0000128 is STATUS_FILE_CLOSED. "Something" closed the handle. This is only the result, unfortunately. It doesn't tell us anything in terms of the cause. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --5KObZtj3Gjpm0OUY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWMJD/AAoJEPU2Bp2uRE+glk8P/1Xp/baOoWcQesUSvoRQZ68T s1dhePPoSIiTFomI0qGF1ZyDPW2W95KIaVi0IkXUbdBc2r03qBC4UrkEntG2nz0I /BDEk+9kkA1KvK6i0/xUj2D5Egb2BQjz174NrZTVAF+khcJ5CIS2dxF9hsxhtFcG n9Cg//hflqKTlQdy0+hnE/biX3pfX+1Tu+vHYOV8Zqh6CPnyPAef2Z0hvy5rsT9e czfeylXKmrsMGGOHwRq0qzWfpXsQbbZEyHlOwV9DIMt9llTNiQm2HPQqZ+jPICiC buBCalsLyf4gojOdRhN0czQjD040R07XEKPKDAYU89pron3SfXYwgYofJ6bEhDWE +v1yoc0MEf1T1l4sPPX8GuOKLCVFOIyOVmB5KPxcIf6DUh8qBwHdwV/cWWKIi7tG cGYabKEGwduCDfLmLzERxTudmBPywv2z/JBxhBh/K4TNUiow3eOwsA/Ved4dpPht AyEaWxFgM1qj6Te0x/jR4pYz0hwdVMRWMToY5vAm9c0sJD5m6OzX1YlERc+BKsHP 3zpDP79EYBk0tEPl+Ji58BJYf2AT/xdf43J1vGawW3EEWyIiakzZnM+uSx3Xv/he h8EBnER4ZpLNssBs8zPour84uVKbsoTbypKAU7/8T9ij1p2FF/JNA2+WmaqTsHBL qaQqYNk0dExKEkW7VJx+ =sXlV -----END PGP SIGNATURE----- --5KObZtj3Gjpm0OUY--