Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 May 2017 09:04:19 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r318528 - stable/11/sys/kern
Message-ID:  <201705190904.v4J94JZ1023470@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri May 19 09:04:18 2017
New Revision: 318528
URL: https://svnweb.freebsd.org/changeset/base/318528

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/11/sys/kern/kern_sig.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_sig.c
==============================================================================
--- stable/11/sys/kern/kern_sig.c	Fri May 19 08:38:03 2017	(r318527)
+++ stable/11/sys/kern/kern_sig.c	Fri May 19 09:04:18 2017	(r318528)
@@ -2664,7 +2664,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));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705190904.v4J94JZ1023470>