in kpsignal2(), do not try to wake up a cached LWP for SA processes

in the case where we're sending SIGKILL but all LWPs are not signalable.
some LWP will wake up soon enough to process the signal, and there may
not be any LWPs in the cache to wake up anyway.  fixes PR 28886 and PR 26771.
also, add a missing "break" pointed out by yamt.
This commit is contained in:
chs 2005-11-12 02:27:48 +00:00
parent 772f8208fc
commit 0221acd545
1 changed files with 3 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sig.c,v 1.210 2005/10/23 00:09:14 cube Exp $ */
/* $NetBSD: kern_sig.c,v 1.211 2005/11/12 02:27:48 chs Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.210 2005/10/23 00:09:14 cube Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.211 2005/11/12 02:27:48 chs Exp $");
#include "opt_ktrace.h"
#include "opt_compat_sunos.h"
@ -1174,11 +1174,10 @@ kpsignal2(struct proc *p, const ksiginfo_t *ksi, int dolock)
if (l->l_stat == LSSLEEP &&
l->l_flag & L_SINTR) {
/* ok to signal vp lwp */
break;
} else
l = NULL;
}
if (l == NULL)
allsusp = 1;
} else if (p->p_stat == SSTOP) {
SLIST_FOREACH(vp, &p->p_sa->sa_vps, savp_next) {
l = vp->savp_lwp;
@ -1268,16 +1267,6 @@ kpsignal2(struct proc *p, const ksiginfo_t *ksi, int dolock)
* them.
*/
if (allsusp && (signum == SIGKILL)) {
if (p->p_flag & P_SA) {
/*
* get a suspended lwp from
* the cache to send KILL
* signal
* XXXcl add signal checks at resume points
*/
suspended = sa_getcachelwp
(SLIST_FIRST(&p->p_sa->sa_vps));
}
lwp_continue(suspended);
}
goto done;