delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/10/23/08:56:07

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:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=jDHwZLxWNHqMDN7no+apIHnGxZwLgn6xFkDlvhyDUxRSWBHJeqodj
QdIVw4B7BC1dvXB95sHCkwHqEx63CQ5y2uvu0x+8SB5/8lUfHQk4ttLYjljwwTEQ
mg1RzR5FLBdgNOleCiW9iRRcQ0OR7SHt+XkzkYRizcO5y0VfdFnii8=
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:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=eALnvCaVOZPHvx4G62edVzqjAQs=; b=GKTKE+aDS0TLQvncWZoV9Mnihd5E
vVdt9N/Ej5okkOgE1jZ7K91JpN6v1lspFUHox4UMuFc6LVXBC28XzL0yy0IperK6
uOfKe1EA/s6HMQlkfeERWYQ9rEooC6zjbGAPunzV3HRY/WDDzLMHD+B3PC2oP+eq
hB00D0MNhe3jcww=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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: Fri, 23 Oct 2015 14:55:40 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: pthread_kill: signals remain pending after target thread exits
Message-ID: <20151023125540.GI5319@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: 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>
MIME-Version: 1.0
In-Reply-To: <28F5B565B6F6424C87E4AC0DCC84316575D73A86@S1P5DAG5C.EXCHPROD.USA.NET>
User-Agent: Mutt/1.5.23 (2014-03-12)

--B2XwZuBUJ8PPSpsy
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 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

-----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--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019