From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21502 invoked by alias); 27 Oct 2015 09:30:28 -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 21448 invoked by uid 89); 27 Oct 2015 09:30:27 -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; Tue, 27 Oct 2015 09:30:24 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 6F262A803FA; Tue, 27 Oct 2015 10:30:22 +0100 (CET) Date: Tue, 27 Oct 2015 11:15:00 -0000 From: Corinna Vinschen To: John Carey Cc: cygwin@cygwin.com Subject: Re: pthread_kill: signals remain pending after target thread exits Message-ID: <20151027093022.GP5319@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: John Carey , cygwin@cygwin.com References: <28F5B565B6F6424C87E4AC0DCC84316575D71070@S1P5DAG5C.EXCHPROD.USA.NET> <20151021114810.GQ5319@calimero.vinschen.de> <28F5B565B6F6424C87E4AC0DCC84316575D73A86@S1P5DAG5C.EXCHPROD.USA.NET> <20151023125540.GI5319@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mr6Y9adkPWMVljTv" Content-Disposition: inline In-Reply-To: <20151023125540.GI5319@calimero.vinschen.de> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-10/txt/msg00480.txt.bz2 --mr6Y9adkPWMVljTv Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2762 John? Ping? On Oct 23 14:55, Corinna Vinschen wrote: > 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= exits > > ... > > > > 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 tar= get > > > > 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.) >=20 > 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. >=20 > 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. >=20 > > > > - 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 t= wo > > > > different threads, then sleep for a bit in each target thread, and > > > > finally have each thread receive its signal with sigwait()--neith= er > > > > 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. >=20 > I added that to my neverending TODO list. Maybe I get around to it at > one point. >=20 >=20 > Thanks, > Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --mr6Y9adkPWMVljTv Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWL0QuAAoJEPU2Bp2uRE+gBwsP/18jIdnA6WfAzLxJnHQpextG buIFn+UZROjyX497gLWvNvMrrkDpTy/mBg+pYp88VKGCu4gKPUDR//KPVccl6iZw VRGJYOHr/U+ERfFH4zlrhgLeAN7+c5ZP3VRwwJUG0qNE2XvouXllQI4ugMhV8anC qc5CI9fy5DHwROqJ1jY0NTaPOVdIHi/CrPCTQtgYCw/WoTT5/FOxvSli53SkX/AF JW4q9fyTxoEovR4klPP1KovxxGpB6dZv7c4AHnO5VVovypwd7s35gQCacKFSOgfs yWGAgpNsDaJnmpSq5Rw7UmE6BRDWBnkTipN74VVcKg9cMlUS9duEjQDxYmBWeYNP yxyxq0t+j3Jba//TQRChJGyxrwsY56cXN+bQ835RyW03NZ6MrIRZJ7Kvw0H0J/d3 xGpKJYrc4ULpPfSGJ4jWmz0zZuELoztsOgDO0xor1/uOYi1swf2/4rDACc6hEbjL Nfk1HbvR/+5NTgUFsaZkerxEfTZX5vLPF8fVX+jXZY4jqTvrIu9R9d6amYNZu4J+ uP8Oc5b7Bog5fyPaRcRYqNBBzbfrlhb8joJ7a5l17LyD28d2kSbNt/1AjrrwNMmx /QdTS8ls7GKFttMNqJnP3pcLRheDgKYzavYCzSZpx/mUuTcPW9FvberD1x6Td54e XRdNej8DfvBkyghErLZ2 =qFxq -----END PGP SIGNATURE----- --mr6Y9adkPWMVljTv--