svn commit: r318529 - stable/10/sys/kern

Konstantin Belousov kib at FreeBSD.org
Fri May 19 10:16:53 UTC 2017


Author: kib
Date: Fri May 19 10:16:51 2017
New Revision: 318529
URL: https://svnweb.freebsd.org/changeset/base/318529

Log:
  MFC r318243:
  Do not wake up sleeping thread in reschedule_signals() if the signal
  is blocked.  The spurious wakeup might result in spurious EINTR.
  
  PR:	219228

Modified:
  stable/10/sys/kern/kern_sig.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_sig.c
==============================================================================
--- stable/10/sys/kern/kern_sig.c	Fri May 19 09:04:18 2017	(r318528)
+++ stable/10/sys/kern/kern_sig.c	Fri May 19 10:16:51 2017	(r318529)
@@ -2637,7 +2637,9 @@ reschedule_signals(struct proc *p, sigse
 		signotify(td);
 		if (!(flags & SIGPROCMASK_PS_LOCKED))
 			mtx_lock(&ps->ps_mtx);
-		if (p->p_flag & P_TRACED || SIGISMEMBER(ps->ps_sigcatch, sig))
+		if (p->p_flag & P_TRACED ||
+		    (SIGISMEMBER(ps->ps_sigcatch, sig) &&
+		    !SIGISMEMBER(td->td_sigmask, sig)))
 			tdsigwakeup(td, sig, SIG_CATCH,
 			    (SIGISMEMBER(ps->ps_sigintr, sig) ? EINTR :
 			     ERESTART));


More information about the svn-src-all mailing list