This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

eagain failures with open files and fork?


I was wondering if there is a known issue with fork not handling well when
the program has a significant number of open files.  I was working on some
code today, which would work perfectly under linux, but under cygwin it
would crash, usually after showing several 'Ressource temporarly
unavailable' (EAGAIN) errors in responce to accept calls.  The code being
exercised at that point wasnt related to what I had changed so I was
confused.  A very long close examination of my changes aided by reading an
strace, showed that I had forgotten to fclose in my new code, resulting in
140 files being open (as opposed to the usual 5).  The thing about the
EAGAIN errors I found odd, is that they were on sockets which had been
marked readable by select.  I pondered further, and I wondered if it was a
fork issue, since the code fork/execs an ident client to gain ident details,
before exec'ing, the child process closes all file descriptors.

I would try and reduce a testcase, but its 90thousand lines of code, so I
don't hold much hope.  I do have an strace (9meg) of the system during a
crash, not one which shows the resource temporarily unavailable messages
from accept, but its the same issue.

The issue has gone away for me now, since I wanted to fclose those files
anyway, but I thought I'd report it since it certainly seemed wrong.

Regards,
Gareth

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]