Expect goes crazy... spinning cpu in kill_pgrp

Dave Korn dave.korn.cygwin@googlemail.com
Wed Oct 21 20:29:00 GMT 2009

Dave Korn wrote:

>   No, not quite of course: there's still a trival TOCTOU race in, e.g.:

>   Argh.  We could move those data members into the redir stub so it won't
> crash if it touches them.  But there are still likely to be race conditions
> anyway, e.g. if we decide in that if() condition to kill the pid, then it
> might still go to state PID_EXECED between the if() and when kill() gets to do
> its stuff anyway.  Hmm.

  So looking closer, it seems that PID_EXECED is only (if ever) set once at
the start of execution and stays with the process from then on.  That suggests
to me that the problem has to actually be with a half-initialised pinfo being
visible to other processes during creation, which leads me to wonder if
something like /this/ is the solution; I'll try it later on tonight.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: pinfo-init.diff
Type: text/x-c
Size: 2789 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20091021/1da410b3/attachment.bin>

More information about the Cygwin-developers mailing list