>From 44989195cca32042a2c90f33db15219b4aedb290 Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Sat, 11 Sep 2010 13:44:55 +0000 Subject: [PATCH 6/8] Hurd signals: fix uninitialized value. * hurd/hurdsig.c (post_signal): Don't call resume() with ACT uninitialized, as it might result in the target thread being left suspended. --- hurd/hurdsig.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c index 16c01d0..6918fa4 100644 --- a/hurd/hurdsig.c +++ b/hurd/hurdsig.c @@ -531,62 +531,65 @@ post_signal (struct hurd_sigstate *ss, /* Fetch ports to all our threads and resume them. */ err = __task_threads (__mach_task_self (), &threads, &nthreads); assert_perror (err); for (i = 0; i < nthreads; ++i) { if (threads[i] != _hurd_msgport_thread && (act != handle || threads[i] != ss->thread)) { err = __thread_resume (threads[i]); assert_perror (err); } err = __mach_port_deallocate (__mach_task_self (), threads[i]); assert_perror (err); } __vm_deallocate (__mach_task_self (), (vm_address_t) threads, nthreads * sizeof *threads); _hurd_stopped = 0; if (act == handle) /* The thread that will run the handler is already suspended. */ ss_suspended = 1; } error_t err; sighandler_t handler; if (signo == 0) { if (untraced) - /* This is PTRACE_CONTINUE. */ - resume (); + { + /* This is PTRACE_CONTINUE. */ + act = ignore; + resume (); + } /* This call is just to check for pending signals. */ __spin_lock (&ss->lock); return 1; } thread_state.set = 0; /* We know nothing. */ __spin_lock (&ss->lock); /* Check for a preempted signal. Preempted signals can arrive during critical sections. */ { inline sighandler_t try_preemptor (struct hurd_signal_preemptor *pe) { /* PE cannot be null. */ do { if (HURD_PREEMPT_SIGNAL_P (pe, signo, detail->code)) { if (pe->preemptor) { sighandler_t handler = (*pe->preemptor) (pe, ss, &signo, detail); if (handler != SIG_ERR) return handler; } else return pe->handler; } pe = pe->next; -- 1.7.2.3