[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: open - resource temporarily unavailable



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Jun 17, 2016 at 02:37:11PM +0000, Andrey wrote:
>  <tomas <at> tuxteam.de> writes:
> 
> > 
> > 
> > On Fri, Jun 17, 2016 at 01:12:00PM +0000, Andrey wrote:
> > 
> > [...]
> > 
> > But writing a minimal Tcl program and running it through strace might shake
> > out whether they do any fcntl behind the scenes...
> > 
> 
> o.k.
> serv:~$ cat >t.tcl 
> set f [open tst.tst w]
> puts $f test
> close $f
> serv:~$ strace tclsh t.tcl
> ...
> open("tst.tst", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 5
> fcntl(5, F_SETFD, FD_CLOEXEC)           = 0
> ioctl(5, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS,
> 0x7ffc5a3bb3e0) = -1 ENOTTY (Inappropriate ioctl for device)
> write(5, "test\n", 5)                   = 5
> close(5)                                = 0
> ...
> 
> as it was expected - nothing miraculous 

OK. So it seems there's another path open() --> EWOULDBLOCK in the kernel.
That would be a chance to read some kernel sources... I fear I must give
up here. $DAYJOB and that :-)

[...]

> > I see. So still EWOULDBLOCK is the likely "culprit".
> > 
> 
> I am afraid not, it has nothing to do with NONBLOCKED i/o,
> it's normal BLOCKED.

Sorry I wasn't clear: I was just talking about the errno -- we still
haven't an idea how it comes about. The manpage is but an approximation
to reality :-)

[...]

> >   - have a look at the Emacs sources
> >
> 
> there is nothing particular about emacs
> it my have been 'bash' or anything that uses libc

I wasnt implying that: any of the apps you've caught complaining about
"Resource temporarily unavailable" might do as a help in thinking about
what can be occurring. Can we really say open() returned error and
errno was EWOULDBLOCK after this? (the evidence you've collected seems
to point strongly at this; is there any other possibility?)

> >   - use the LD_PRELOAD trick [1] to install a little spy on open()
> >     and let the system running for a while like this (the last one
> >     depends on the ratio of how critical your system is and how
> >     corageous you are 

Note that this can be a pretty intrusive technique, depending on which
programs you "bug" this way. Tread carefully :-)

regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAldkWBcACgkQBcgs9XrR2kb8LACeJWTB4vfOfmVOFY894ssx/FSA
YG8An0xHRzRnAW+zM9di7VRiCdGd9SKd
=WxkA
-----END PGP SIGNATURE-----


Reply to: