* exceptions.cc (sigdelayed): Ensure that signal is cleared as the last

operation or suffer races.
* sigproc.cc (proc_subproc): Deal with zombie array overflow.
This commit is contained in:
Christopher Faylor 2001-06-10 16:00:23 +00:00
parent 463513f0e2
commit 161edfaa00
3 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,9 @@
Sun Jun 10 12:56:00 2001 Christopher Faylor <cgf@redhat.com>
* exceptions.cc (sigdelayed): Ensure that signal is cleared as
the last operation or suffer races.
* sigproc.cc (proc_subproc): Deal with zombie array overflow.
Sun Jun 10 11:56:00 2001 Corinna Vinschen <corinna@vinschen.de>
* cygwin.din: Add fchdir symbols.

View File

@ -1206,11 +1206,11 @@ _sigdelayed0:\n\
\n\
call _reset_signal_arrived@0\n\
pushl %5 # signal number\n\
pushl %8 # newmask\n\
movl $0,%0 # zero the signal number as a\n\
# flag to the signal handler thread\n\
# that it is ok to set up sigsave\n\
\n\
pushl %8\n\
call _set_process_mask@4\n\
popl %%eax\n\
jmp *%%eax\n\

View File

@ -46,6 +46,8 @@ details. */
#define no_signals_available() (!hwait_sig || !sig_loop_wait)
#define ZOMBIEMAX ((int) (sizeof (zombies) / sizeof (zombies[0])))
/*
* Global variables
*/
@ -100,7 +102,7 @@ Static HANDLE wait_sig_inited = NULL; // Control synchronization of
Static HANDLE events[PSIZE + 1] = {0}; // All my children's handles++
#define hchildren (events + 1) // Where the children handles begin
Static pinfo pchildren[PSIZE]; // All my children info
Static pinfo zombies[PSIZE]; // All my deceased children info
Static pinfo zombies[16384]; // All my deceased children info
Static int nchildren = 0; // Number of active children
Static int nzombies = 0; // Number of deceased children
@ -298,8 +300,13 @@ proc_subproc (DWORD what, DWORD val)
sigproc_printf ("pid %d[%d] terminated, handle %p, nchildren %d, nzombies %d",
pchildren[val]->pid, val, hchildren[val], nchildren, nzombies);
zombies[nzombies] = pchildren[val]; // Add to zombie array
zombies[nzombies++]->process_state = PID_ZOMBIE;// Walking dead
if (nzombies >= ZOMBIEMAX)
sigproc_printf ("Hit zombie maximum %d", nzombies);
else
{
zombies[nzombies] = pchildren[val]; // Add to zombie array
zombies[nzombies++]->process_state = PID_ZOMBIE;// Walking dead
}
sigproc_printf ("removing [%d], pid %d, handle %p, nchildren %d",
val, pchildren[val]->pid, hchildren[val], nchildren);
if ((int) val < --nchildren)