Index: kern_lwp.c =================================================================== RCS file: /cvsroot/src/sys/kern/kern_lwp.c,v retrieving revision 1.198 diff -u -r1.198 kern_lwp.c --- kern_lwp.c 1 May 2019 21:57:34 -0000 1.198 +++ kern_lwp.c 2 May 2019 21:46:41 -0000 @@ -1079,7 +1079,7 @@ */ mutex_enter(proc_lock); - if ((p->p_slflag & (PSL_TRACED|PSL_TRACELWP_EXIT|PSL_SYSCALL)) == + if ((p->p_slflag & (PSL_TRACED|PSL_TRACELWP_EXIT)) == (PSL_TRACED|PSL_TRACELWP_EXIT)) { mutex_enter(p->p_lock); p->p_lwp_exited = l->l_lid; Index: kern_sig.c =================================================================== RCS file: /cvsroot/src/sys/kern/kern_sig.c,v retrieving revision 1.355 diff -u -r1.355 kern_sig.c --- kern_sig.c 1 May 2019 21:52:35 -0000 1.355 +++ kern_sig.c 2 May 2019 21:46:42 -0000 @@ -913,8 +913,14 @@ mutex_enter(p->p_lock); if (ISSET(p->p_slflag, PSL_TRACED) && - !(p->p_pptr == p->p_opptr && ISSET(p->p_lflag, PL_PPWAIT))) { - eventswitch(signo, ksi->ksi_code); + !(p->p_pptr == p->p_opptr && ISSET(p->p_lflag, PL_PPWAIT)) && + p->p_xsig != SIGKILL && + !sigismember(&p->p_sigpend.sp_set, SIGKILL)) { + p->p_xsig = signo; + p->p_sigctx.ps_faked = true; + p->p_sigctx.ps_lwp = ksi->ksi_lid; + p->p_sigctx.ps_info = ksi->ksi_info; + sigswitch(0, signo, false); // XXX ktrpoint(KTR_PSIG) mutex_exit(p->p_lock); return; @@ -1556,6 +1562,8 @@ p->p_xsig = signo; p->p_sigctx.ps_faked = true; + p->p_sigctx.ps_lwp = l->l_lid; + memset(&p->p_sigctx.ps_info, 0, sizeof(p->p_sigctx.ps_info)); p->p_sigctx.ps_info._signo = signo; p->p_sigctx.ps_info._code = code; Index: sys_lwp.c =================================================================== RCS file: /cvsroot/src/sys/kern/sys_lwp.c,v retrieving revision 1.65 diff -u -r1.65 sys_lwp.c --- sys_lwp.c 1 May 2019 22:55:55 -0000 1.65 +++ sys_lwp.c 2 May 2019 21:46:42 -0000 @@ -78,12 +78,12 @@ (p->p_emul->e_startlwp)(arg); /* If the process is traced, report lwp creation to a debugger */ - if ((p->p_slflag & (PSL_TRACED|PSL_TRACELWP_CREATE|PSL_SYSCALL)) == + if ((p->p_slflag & (PSL_TRACED|PSL_TRACELWP_CREATE)) == (PSL_TRACED|PSL_TRACELWP_CREATE)) { /* Paranoid check */ mutex_enter(proc_lock); - if ((p->p_slflag & (PSL_TRACED|PSL_TRACELWP_CREATE|PSL_SYSCALL)) != - (PSL_TRACED|PSL_TRACELWP_CREATE)) { + if ((p->p_slflag & (PSL_TRACED|PSL_TRACELWP_CREATE)) != + (PSL_TRACED|PSL_TRACELWP_CREATE)) { mutex_exit(proc_lock); return; }