X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=VqAYnDgoyBEMdfcw743hE3nhuxnVKowu5/BGQLM70e5ODKflA3nnj bx9XVWxnV+0v9utbZd6teaQ4MxGZaWnJg+CUZ2z+uQRF70eILPGGK5IvGuUOKAqr NiBWgNhaxL2o73/hHQ62oHHSysTPilp7YhKtIwN2usaWRs5n1vbHqE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=KprlnEf/skerXUjtEA7FTuC3/O4=; b=T+KQIU7UZBMvK3NoyAXVyxtg2Ach TiVg/yTM8vnMcrL9F64GT34xVWXohCYEMrwieY35z9y17vYrwzbQuAxLS43zKK+d aVJ+RwZMjmLqHRSU+h9fJdnnsK5CEQX0iQuJPxuwchKh9558OqXqDnfwysPSa2cW 2V2+0t87RRsjaBQ= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 Date: Tue, 27 Oct 2015 10:30:22 +0100 From: Corinna Vinschen To: John Carey Cc: cygwin AT cygwin DOT com Subject: Re: pthread_kill: signals remain pending after target thread exits Message-ID: <20151027093022.GP5319@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: John Carey , cygwin AT cygwin DOT com References: <28F5B565B6F6424C87E4AC0DCC84316575D71070 AT S1P5DAG5C DOT EXCHPROD DOT USA DOT NET> <20151021114810 DOT GQ5319 AT calimero DOT vinschen DOT de> <28F5B565B6F6424C87E4AC0DCC84316575D73A86 AT S1P5DAG5C DOT EXCHPROD DOT USA DOT NET> <20151023125540 DOT GI5319 AT calimero DOT vinschen DOT 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) --mr6Y9adkPWMVljTv Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable John? Ping? On Oct 23 14:55, Corinna Vinschen wrote: > On Oct 22 02:08, John Carey wrote: > > > From: Corinna Vinschen [corinna-cygwin AT cygwin DOT 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 -----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--