diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-04-18 09:06:43 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-04-18 09:06:43 +0000 |
commit | 6d9bdc23bf3894424feb504809f2235ec1ee4aae (patch) | |
tree | 1448495df52c2154f1b24bb82b4aa70f9cc0f892 | |
parent | d613d05bd4473195e6c4e909a1803ede02af42dd (diff) |
If a proc has P_WEXIT set do not stop it, let it exit since it is already
mostly dead.
This is more like belts and suspenders since a proc in exit1() will not
receive signals anymore and so proc_stop() should not be reachable. This
is even the case when sigexit() is called and a coredump() is happening.
OK mpi@
-rw-r--r-- | sys/kern/kern_sig.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 60d7941ece2..2280bc7abd7 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.324 2024/04/10 10:05:26 claudio Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.325 2024/04/18 09:06:42 claudio Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -1443,6 +1443,9 @@ proc_stop(struct proc *p, int sw) #ifdef MULTIPROCESSOR SCHED_ASSERT_LOCKED(); #endif + /* do not stop exiting procs */ + if (ISSET(p->p_flag, P_WEXIT)) + return; p->p_stat = SSTOP; atomic_clearbits_int(&pr->ps_flags, PS_WAITED); |