From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13295 invoked by alias); 23 Oct 2015 12:55:45 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 13286 invoked by uid 89); 23 Oct 2015 12:55:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Oct 2015 12:55:43 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id D57C0A803D6; Fri, 23 Oct 2015 14:55:40 +0200 (CEST) Date: Fri, 23 Oct 2015 14:30:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: pthread_kill: signals remain pending after target thread exits Message-ID: <20151023125540.GI5319@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <28F5B565B6F6424C87E4AC0DCC84316575D71070@S1P5DAG5C.EXCHPROD.USA.NET> <20151021114810.GQ5319@calimero.vinschen.de> <28F5B565B6F6424C87E4AC0DCC84316575D73A86@S1P5DAG5C.EXCHPROD.USA.NET> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="B2XwZuBUJ8PPSpsy" Content-Disposition: inline In-Reply-To: <28F5B565B6F6424C87E4AC0DCC84316575D73A86@S1P5DAG5C.EXCHPROD.USA.NET> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-10/txt/msg00404.txt.bz2 --B2XwZuBUJ8PPSpsy Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2574 On Oct 22 02:08, John Carey wrote: > > From: Corinna Vinschen [corinna-cygwin@cygwin.com] > > Sent: Wednesday, October 21, 2015 4:48 AM > > Subject: Re: pthread_kill: signals remain pending after target thread e= xits > ... > > > On Sep 11 18:11, John Carey wrote: > > > There seems to be a problem with pthread_kill: a pending signal > > > targeting a particular thread prevents other threads from receiving > > > signals sharing the same signal number--even after the original target > > > thread exits and is joined. > ... > > The important thing here is to get rid of the pending signal. >=20 > Yes, I agree that is the most important thing. >=20 > > > In my view it would be desirable if: > > > > > > - Pending signals targeting a particular thread would not outlast > > > that thread. > >=20 > > Since you looked into the code anyway, do you have an idea how to > > implement that? For a start, do you have a simple testcase, only > > the bare code needed to reproduce the issue? >=20 > I've attached a test case that I *think* gets into the right spot, at > least for 64-bit Cygwin 2.0.4. That is, it hangs trying to receive > the signal, instead of terminating. (This test passes (terminates) in > 32-bit Cygwin 1.7.9 and 64-bit Ubuntu 14.04.3 LTS.) Thanks for the testcase. I applied a patch which hopefully works as desired, at least to fix the immediate problem of the remaining pending signal when a thread exits. I uploaded a new developer snapshot to https://cygwin.com/snapshots. Please give it a try. Note that the today's snapshot does *NOT* contain the changes concerning the new ACL handling, so people testing that stuff should skip this snapshot. > > > - Multiple pending signals targeting different threads could > > > coexist, even if they shared the same signal number. This happens > > > on Linux (Ubuntu 14.04.3), where I can generate two signals for two > > > different threads, then sleep for a bit in each target thread, and > > > finally have each thread receive its signal with sigwait()--neither > > > signal is lost during the sleeping period. > >=20 > > That requires to extend the handling for pending signals. That's > > a rather bigger task... >=20 > Yeah. It's nice if threads don't interfere with each other, but this > part would indeed be harder to change. I added that to my neverending TODO list. Maybe I get around to it at one point. Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --B2XwZuBUJ8PPSpsy Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWKi5MAAoJEPU2Bp2uRE+gn7IQAIy1p9CKILxRBHRE7L467aF8 DTqcBE9WC0vT5xJ3T87F4vpLw+plkRtdUIeYAfmIVFi9R4aPG99CvrrEcE4HvNKL CSe2Xe7kRKjDJxhE1ojNHxPcHPhBBoIZfwRuH9NxFGZYMXAi8ra6vNfmlV4ENunB 7iraJB7UsSP7GXsZVDq0U6LyIUTles4z4aYNVi8Nm/rv3U+zQaNUCrk+KR4Js72a T4wrCfx6q6kCSWSwc2AEX+ZIxQGUUIMTX4PxRttLYVfv8kDDTTUK9hi3Vp1u/lun MfE+vpiQ8LjyCIPH6onJB/CGrP6zUgrf7RRi+v5q6dvwuOeST+6Njyy3Z3KMTPXp CGhZw2H0n0M5r7RlWDSuKcTSLtL2/I4njaEwspKW2PGAZ3FE44T/9BbrQ3ZPIoEF g/mgu8d5iC5yeFJ3oYvj4RaJfn8pO6pFiHnIv4QAMIzy1lxoZtEx/xajbzdcTLCW 8CuVSDBN1egtZpmJdm3S9RgkVlZVxETguC3xfrheoZlEzIhOkFpS1obhZ24ZsS4m KkhTrB42ba2kUxkSN9bBwfI8JHFi5JlGIol2IizENpy+919E4Cm2oWkyFI/f9+KV hLOcubsp5gBo53Yd59BDmFTv2QJZSRBMI8BRkaduGM6AK62zBIhU832ewYQN5HUF NjHKwwAr4KU6x5ec3KUY =bUQv -----END PGP SIGNATURE----- --B2XwZuBUJ8PPSpsy--