This is the mail archive of the cygwin-developers 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]

Re: 1.5.19: fork: resource temporarily unavailable


On Fri, 20 Jan 2006, Igor Peshansky wrote:

> First reported in <http://cygwin.com/ml/cygwin/2005-12/msg00817.html>.
> Here's a short summary: fork failes because pinfo doesn't initialize,
> pinfo reports a loop because PID_EXITED is set.  Still getting this with
> the latest CVS build.
> [snip]
> I would like to figure out what's causing this.  My main question is: am I
> on the right track here?  What else should I look for?

Am I on the right list here?  I am getting consistently plagued by this
after I run a particular script at work (that creates and sometimes kills
lots of short-lived processes).  Unfortunately, I'm not at liberty to post
the script itself, and it's possible that there's something peculiar to my
setup that's causing this issue.  But I'd like to get to the bottom of
this.

I've changed the code in pinfo.cc to print the procinfo structure in case
of these loops.  However, I'm not even sure of what to look for.  The data
looks somewhat legitimate:

41649247 [main] bash 9944 pinfo::init: procinfo = { pid=8692, process_state=80000000, exitcode=134217728, cygstarted=1, ppid=7128, dwProcessId=8152, progname='C:\cygwin\bin\sed.exe', uid=1019, gid=0, pgid=9208, sid=6508, ctty=1, has_pgid_children=0, start_time=1138327144, rusage_self={(1,81000),(1,151000),15352,0,0,0,0,23183,0,0,0,0,0,1,0,0}, rusage_children={(0,0),(0,0),0,0,0,0,0,0,0,0,0,0,0,0,0,0}, nice=10, stopsig=0 }
41695856 [main] bash 9944 pinfo::init: looping because pid 8692, procinfo->pid 8692, procinfo->dwProcessid 8152 has PID_EXITED set
      3 [main] sed 8692 pinfo::init: procinfo = { pid=8692, process_state=80000000, exitcode=134217728, cygstarted=1, ppid=7128, dwProcessId=8152, progname='C:\cygwin\bin\sed.exe', uid=1019, gid=0, pgid=9208, sid=6508, ctty=1, has_pgid_children=0, start_time=1138327144, rusage_self={(1,81000),(1,151000),15352,0,0,0,0,23183,0,0,0,0,0,1,0,0}, rusage_children={(0,0),(0,0),0,0,0,0,0,0,0,0,0,0,0,0,0,0}, nice=10, stopsig=0 }
 103974 [main] sed 8692 pinfo::init: looping because pid 8692, procinfo->pid 8692, procinfo->dwProcessid 8152 has PID_EXITED set
41740384 [main] bash 9944 fork: child 8692 - pinfo failed: 9, 17, errno 11


A couple of interesting observations: the *same* procinfo structure is
apparently printed from two processes -- the parent (bash) and the child
(in this case "sed").  The process being spawned, however, is *not* sed --
the name "sed" in the printout most likely comes from the "progname" field
of the invalid procinfo structure.  The double printing is not the effect
of the loop -- I'm only printing the procinfo structure on the first
iteration.

Is it possible that under certain circumstances the procinfo structures
don't get cleaned up properly?  Would it be possible to get a list of all
procinfo structures currently allocated in the shared region, and check
whether their number grows steadily?  Any advice on what else to try?
Thanks,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"


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