gawk: Bad File Descriptor error with concurrent readonly access to a network file

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Oct 28 12:34:00 GMT 2015


On Oct 27 23:30, Vermessung AVT - Wolfgang Rieger wrote:
> From: Corinna Vinschen [mailto:corinna-cygwin@cygwin.com]
> Sent: Tuesday, October 27, 2015 10:53
> To: cygwin@cygwin.com
> Subject: Re: gawk: Bad File Descriptor error with concurrent readonly access to a network file
>  (Snip)
> > 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.
> 
> Here is the portion of strace output where IMHO the error occurs. The behaviour is quite different when running with strace, so I hope it is the same error situation, but at least the message given is "Bad file descriptor".
> I changed the paths to ???. This is strace --mask=syscall. 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:
> 
>   197   70416 [main] gawk 3844 open: 3 = open(???\datafile.txt, 0x8000)
>   327   70743 [main] gawk 3844 fcntl64: 0 = fcntl(3, 1, 0x0)
>   265   71008 [main] gawk 3844 fcntl64: 0 = fcntl(3, 2, 0x1)
>  3298   74306 [main] gawk 3844 fhandler_base::fstat_helper: 0 = fstat (\??\???\datafile.txt, 0x8004AEF8) st_size=135, st_mode=0100644, st_ino=281474976912276st_atim=551A9D6D.BD48F54 st_ctim=5603C3F5.26F49798 st_mtim=54E1ECAE.B2A66C8 st_birthtim=551A9D6D.BD48F54
>   206   74512 [main] gawk 3844 fstat64: 0 = fstat(3, 0x8004AEF8)
>   216   74728 [main] gawk 3844 isatty: 0 = isatty(3)
>  1887   76615 [main] gawk 3844 fhandler_base::fstat_helper: 0 = fstat (\??\???\datafile.txt, 0x8004AEF8) st_size=135, st_mode=0100644, st_ino=281474976912276st_atim=551A9D6D.BD48F54 st_ctim=5603C3F5.26F49798 st_mtim=54E1ECAE.B2A66C8 st_birthtim=551A9D6D.BD48F54
>   241   76856 [main] gawk 3844 fstat64: 0 = 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.cc: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

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20151028/b352b965/attachment.sig>


More information about the Cygwin mailing list