* cygtls.h (_threadinfo::stack): Increase stack size to accommodate nested
signal handlers. Reorganize to cause potential SEGV on stack overflow. * sigproc.cc (no_signals_available): Check sendsig value rather than relying on obsolete sig_loop_wait. (sigproc_terminate): Ditto. (proc_can_be_signalled): Check sendsig value even for myself. * tlsoffsets.h: Regenerate.
This commit is contained in:
parent
8ed5c9b629
commit
f7cb207b69
|
@ -1,3 +1,14 @@
|
|||
2003-12-29 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* cygtls.h (_threadinfo::stack): Increase stack size to accommodate
|
||||
nested signal handlers. Reorganize to cause potential SEGV on stack
|
||||
overflow.
|
||||
* sigproc.cc (no_signals_available): Check sendsig value rather than
|
||||
relying on obsolete sig_loop_wait.
|
||||
(sigproc_terminate): Ditto.
|
||||
(proc_can_be_signalled): Check sendsig value even for myself.
|
||||
* tlsoffsets.h: Regenerate.
|
||||
|
||||
2003-12-29 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
Move open_fhs from fhandler.h to cygheap.h for easier tracking.
|
||||
|
@ -651,7 +662,8 @@
|
|||
* exceptions.cc (_threadinfo::interupt_now): Use _threadinfo HANDLE
|
||||
operator to derive thread handle.
|
||||
(setup_handler): Ditto.
|
||||
* sigproc.cc: Reorganize includes.
|
||||
* sigproc.cc: Reorganize includes. Fix no_signals_available test to
|
||||
properly return true when !sig_wait_loop.
|
||||
|
||||
2003-11-28 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
|
|
|
@ -105,9 +105,9 @@ struct _threadinfo
|
|||
struct _reent local_clib;
|
||||
struct _local_storage locals;
|
||||
struct _threadinfo *prev, *next;
|
||||
__stack_t stack[8];
|
||||
int sig;
|
||||
__stack_t *stackptr;
|
||||
int sig;
|
||||
__stack_t stack[1024];
|
||||
|
||||
/*gentls_offsets*/
|
||||
static CRITICAL_SECTION protect_linked_list;
|
||||
|
|
|
@ -43,7 +43,7 @@ details. */
|
|||
|
||||
#define wake_wait_subproc() SetEvent (events[0])
|
||||
|
||||
#define no_signals_available() (!hwait_sig || !sig_loop_wait || exit_state)
|
||||
#define no_signals_available() (!hwait_sig || (myself->sendsig == INVALID_HANDLE_VALUE) || exit_state)
|
||||
|
||||
#define NZOMBIES 256
|
||||
|
||||
|
@ -129,7 +129,6 @@ HANDLE NO_COPY signal_arrived; // Event signaled when a signal has
|
|||
#define Static static NO_COPY
|
||||
|
||||
Static DWORD proc_loop_wait = 1000; // Wait for subprocesses to exit
|
||||
Static DWORD sig_loop_wait = INFINITE; // Wait for signals to arrive
|
||||
|
||||
Static HANDLE sigcomplete_main; // Event signaled when a signal has
|
||||
// finished processing for the main
|
||||
|
@ -248,18 +247,15 @@ get_proc_lock (DWORD what, DWORD val)
|
|||
static bool __stdcall
|
||||
proc_can_be_signalled (_pinfo *p)
|
||||
{
|
||||
if (p == myself_nowait || p == myself)
|
||||
{
|
||||
assert (!wait_sig_inited);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (p->sendsig == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
set_errno (EPERM);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (p == myself_nowait || p == myself)
|
||||
return hwait_sig;
|
||||
|
||||
if (ISSTATE (p, PID_INITIALIZING) ||
|
||||
(((p)->process_state & (PID_ACTIVE | PID_IN_USE)) ==
|
||||
(PID_ACTIVE | PID_IN_USE)))
|
||||
|
@ -657,12 +653,11 @@ sigproc_terminate (void)
|
|||
{
|
||||
hwait_sig = NULL;
|
||||
|
||||
if (!sig_loop_wait)
|
||||
if (myself->sendsig == INVALID_HANDLE_VALUE)
|
||||
sigproc_printf ("sigproc handling not active");
|
||||
else
|
||||
{
|
||||
sigproc_printf ("entering");
|
||||
sig_loop_wait = 0; // Tell wait_sig to exit when it is
|
||||
// finished with anything it is doing
|
||||
ForceCloseHandle (sigcomplete_main);
|
||||
HANDLE sendsig = myself->sendsig;
|
||||
|
@ -800,7 +795,6 @@ sig_send (_pinfo *p, int sig, void *tls)
|
|||
rc = 0; // Successful exit
|
||||
else
|
||||
{
|
||||
/* It's an error unless sig_loop_wait == 0 (the process is exiting). */
|
||||
if (!no_signals_available ())
|
||||
system_printf ("wait for sig_complete event failed, signal %d, rc %d, %E",
|
||||
sig, rc);
|
||||
|
|
|
@ -1,44 +1,44 @@
|
|||
//;# autogenerated: Do not edit.
|
||||
|
||||
//; $tls::func = -3084;
|
||||
//; $tls::saved_errno = -3080;
|
||||
//; $tls::sa_flags = -3076;
|
||||
//; $tls::oldmask = -3072;
|
||||
//; $tls::newmask = -3068;
|
||||
//; $tls::event = -3064;
|
||||
//; $tls::errno_addr = -3060;
|
||||
//; $tls::initialized = -3056;
|
||||
//; $tls::sigmask = -3052;
|
||||
//; $tls::sigwait_mask = -3048;
|
||||
//; $tls::sigwait_info = -3044;
|
||||
//; $tls::infodata = -3040;
|
||||
//; $tls::tid = -2516;
|
||||
//; $tls::local_clib = -2512;
|
||||
//; $tls::locals = -1584;
|
||||
//; $tls::prev = -48;
|
||||
//; $tls::next = -44;
|
||||
//; $tls::stack = -40;
|
||||
//; $tls::sig = -8;
|
||||
//; $tls::stackptr = -4;
|
||||
//; $tls::func = -7148;
|
||||
//; $tls::saved_errno = -7144;
|
||||
//; $tls::sa_flags = -7140;
|
||||
//; $tls::oldmask = -7136;
|
||||
//; $tls::newmask = -7132;
|
||||
//; $tls::event = -7128;
|
||||
//; $tls::errno_addr = -7124;
|
||||
//; $tls::initialized = -7120;
|
||||
//; $tls::sigmask = -7116;
|
||||
//; $tls::sigwait_mask = -7112;
|
||||
//; $tls::sigwait_info = -7108;
|
||||
//; $tls::infodata = -7104;
|
||||
//; $tls::tid = -6580;
|
||||
//; $tls::local_clib = -6576;
|
||||
//; $tls::locals = -5648;
|
||||
//; $tls::prev = -4112;
|
||||
//; $tls::next = -4108;
|
||||
//; $tls::stackptr = -4104;
|
||||
//; $tls::sig = -4100;
|
||||
//; $tls::stack = -4096;
|
||||
//; __DATA__
|
||||
|
||||
#define tls_func (-3084)
|
||||
#define tls_saved_errno (-3080)
|
||||
#define tls_sa_flags (-3076)
|
||||
#define tls_oldmask (-3072)
|
||||
#define tls_newmask (-3068)
|
||||
#define tls_event (-3064)
|
||||
#define tls_errno_addr (-3060)
|
||||
#define tls_initialized (-3056)
|
||||
#define tls_sigmask (-3052)
|
||||
#define tls_sigwait_mask (-3048)
|
||||
#define tls_sigwait_info (-3044)
|
||||
#define tls_infodata (-3040)
|
||||
#define tls_tid (-2516)
|
||||
#define tls_local_clib (-2512)
|
||||
#define tls_locals (-1584)
|
||||
#define tls_prev (-48)
|
||||
#define tls_next (-44)
|
||||
#define tls_stack (-40)
|
||||
#define tls_sig (-8)
|
||||
#define tls_stackptr (-4)
|
||||
#define tls_func (-7148)
|
||||
#define tls_saved_errno (-7144)
|
||||
#define tls_sa_flags (-7140)
|
||||
#define tls_oldmask (-7136)
|
||||
#define tls_newmask (-7132)
|
||||
#define tls_event (-7128)
|
||||
#define tls_errno_addr (-7124)
|
||||
#define tls_initialized (-7120)
|
||||
#define tls_sigmask (-7116)
|
||||
#define tls_sigwait_mask (-7112)
|
||||
#define tls_sigwait_info (-7108)
|
||||
#define tls_infodata (-7104)
|
||||
#define tls_tid (-6580)
|
||||
#define tls_local_clib (-6576)
|
||||
#define tls_locals (-5648)
|
||||
#define tls_prev (-4112)
|
||||
#define tls_next (-4108)
|
||||
#define tls_stackptr (-4104)
|
||||
#define tls_sig (-4100)
|
||||
#define tls_stack (-4096)
|
||||
|
|
Loading…
Reference in New Issue