From owner-freebsd-threads@FreeBSD.ORG Fri Nov 22 15:21:06 2013 Return-Path: Delivered-To: threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9E8EFD1; Fri, 22 Nov 2013 15:21:06 +0000 (UTC) Received: from mail-la0-x232.google.com (mail-la0-x232.google.com [IPv6:2a00:1450:4010:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D39602AEE; Fri, 22 Nov 2013 15:21:05 +0000 (UTC) Received: by mail-la0-f50.google.com with SMTP id el20so1078928lab.9 for ; Fri, 22 Nov 2013 07:21:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=xy+5XmsAdvZzZrW1Wqwxo9XR1IpG1jW73LOi83n/Ges=; b=cMTB7LLUIrYQIu0u69NufN+d4Spfy5iRxyMyMmBRWfVJdBb0S5c7s/QDRteiO5YlUF P992K7n6ghyRU2Zr0BhSq56MmgpvWRbM95FLzsSKAsDByx8K5q8zAna77mgbYei1C7Ao qdzTR8oYIV4C05px9refgM/o7RzzLuIUE7YWetdfrD2+Pm/elqM6toVCsdkZNJ0H2HHd rtSR7FGHZUSvTBPiqw1DMW2TO9nIfCvYShzzfLnpslM77ikjEDB8/x4bMeEVd9Ki5UG5 CvOiwqC51xuKz6WMmcYdI5pl+Ke5egDF1+6D3z+lUZFtAtVHr7l0QivaQyOq28fjJa9v R4Cg== X-Received: by 10.152.115.230 with SMTP id jr6mr1318172lab.45.1385133663854; Fri, 22 Nov 2013 07:21:03 -0800 (PST) Received: from [172.16.0.2] (tx97.net. [85.198.160.156]) by mx.google.com with ESMTPSA id k3sm27320892lbs.0.2013.11.22.07.21.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Nov 2013 07:21:02 -0800 (PST) Message-ID: <528F765A.8040306@gmail.com> Date: Fri, 22 Nov 2013 17:20:58 +0200 From: Vitaly Magerya User-Agent: Thunderbird MIME-Version: 1.0 To: Jilles Tjoelker , Konstantin Belousov Subject: Re: Problem with signal 0 being delivered to SIGUSR1 handler References: <528DFEE6.6020504@gmail.com> <20131121211546.GQ59496@kib.kiev.ua> <20131122133553.GA28457@stack.nl> In-Reply-To: <20131122133553.GA28457@stack.nl> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, davidxu@freebsd.org, threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Nov 2013 15:21:06 -0000 On 11/22/2013 15:35, Jilles Tjoelker wrote: > This patch fixes the problem for me on stable/9 and head. > > Index: lib/libthr/thread/thr_sig.c > =================================================================== > --- lib/libthr/thread/thr_sig.c (revision 258178) > +++ lib/libthr/thread/thr_sig.c (working copy) > @@ -326,12 +326,12 @@ check_deferred_signal(struct pthread *curthread) > uc_len = __getcontextx_size(); > uc = alloca(uc_len); > getcontext(uc); > - if (curthread->deferred_siginfo.si_signo == 0) > - return; > __fillcontextx2((char *)uc); > act = curthread->deferred_sigact; > uc->uc_sigmask = curthread->deferred_sigmask; > memcpy(&info, &curthread->deferred_siginfo, sizeof(siginfo_t)); > + if (curthread->deferred_siginfo.si_signo == 0) > + return; > /* remove signal */ > curthread->deferred_siginfo.si_signo = 0; > handle_signal(&act, info.si_signo, &info, uc); > I can confirm that this also solves the problems I'm seeing.