delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/06/16/09:12:33

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:message-id:date:from:mime-version:to:cc
:subject:references:in-reply-to:content-type; q=dns; s=default; b=
Wx8RwKxRcLHBpwpCmUgL4sZKHotnUsDqAL3l/KGWvgIKFa9I9yw0s0SqLgTQQy8F
lK6GKY7RsGHs0VAy/s6BmCgraZyiZg1Y/VMCCIQQ63pt+ikCLZE9yYbQ+jfIpEH6
nBXm6rTCky4OVvNYf0JesZHrz70rzeQrzw1NMr0hgsw=
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:message-id:date:from:mime-version:to:cc
:subject:references:in-reply-to:content-type; s=default; bh=5L6U
7yuQO3sLn9Y6rSQUqMvZg2M=; b=l4NDurKF+O3TOvLdUszo+iiNCG64ytMoXMAW
1Eg2ocl6zGAqcqouXxndcRYaLNIyrcE9nTfD341rQxia4OChSAbnJGfecuPzMH8b
fyo0LaeEQ888DgwOy9hqm6JRRYoIjHmdrIa7l8Pt3v7Q/jApqfpE2Otdl4t4LJg/
eZdjmfY=
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
X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_50,KHOP_THREADED,RCVD_IN_DNSWL_MED,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD,SPF_PASS,TW_CG autolearn=ham version=3.3.1
X-CornellRouted: This message has been Routed already.
Message-ID: <51BDB979.3040508@cornell.edu>
Date: Sun, 16 Jun 2013 09:11:21 -0400
From: Ken Brown <kbrown AT cornell DOT edu>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
MIME-Version: 1.0
To: Angelo Graziosi <angelo DOT graziosi AT alice DOT it>
CC: cygwin AT cygwin DOT com, 14569 AT debbugs DOT gnu DOT org, Paul Eggert <eggert AT cs DOT ucla DOT edu>
Subject: Re: bug#14569: 24.3.50; bootstrap fails on Cygwin
References: <51BC720D DOT 7080504 AT alice DOT it>
In-Reply-To: <51BC720D.7080504@alice.it>
X-Virus-Found: No

--------------060004040501040900040907
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

[Adding the bug address back to the CC so that this gets archived.]

On 6/15/2013 9:54 AM, Angelo Graziosi wrote:
> Christopher Faylor wrote
>>> On 06/14/2013 11:03 AM, Christopher Faylor wrote:
>>>> You pointed to an archived mail messages which implies that was fixed
>>>> more than a year ago.  What makes you think it is still a problem?
>>>
>>> The message I pointed to
>>> <http://cygwin.com/ml/cygwin/2012-05/msg00472.html> says this:
>>>
>>>> Testcase signal/kill: Signals may or may not reach the correct thread
>>>> with 1.7.12-1 and newer.
>>>
>>> Confirmed.  I think the reason is that we only have a single event to
>>> signal that a POSIX signal arrived instead of a per-thread event, but
>>> I'm not sure.  This is cgf's domain so I leave it at that for now.
>>>
>>> I interpreted this to mean "the existence of the bug is confirmed,
>>> here's why the bug occurs, and I'll let cgf deal with it".  I didn't
>>> see any followup message where cgf (is that you?) dealt with it.  My
>>> apologies if I misinterpreted the email.
>>
>> Oops.  I didn't read Corinna's message as thoroughly as I should have.
>> Sorry.
>>
>> That particular issue was supposed to have been fixed in Cygwin 1.7.17,
>> released in October 2012.
>
> Out of curiosity, I tried the test cases I found in that thread, more
> precisely here:
>
>    http://cygwin.com/ml/cygwin/2012-05/msg00434.html
>
>
> and the results are:
>
> $ gcc otto_test1.c -o otto_test1
> $ ./otto_test1
> Testing deferred pthread_cancel()
>
> Thread 0 starting (0x200102c0)
> Thread 1 starting (0x20010360)
> Thread 2 starting (0x20010400)
>
> Cancelling thread 2 (0x20010400)
> Thread 2 exiting (0x20010400)
> Cancelling thread 1 (0x20010360)
> Thread 1 exiting (0x20010360)
> Cancelling thread 0 (0x200102c0)
> Thread 0 exiting (0x200102c0)
>
> Thread 0 is gone (0x200102c0)
> Thread 1 is gone (0x20010360)
> Thread 2 is gone (0x20010400)
>
> $ gcc otto_test2.c -o otto_test2
> $ ./otto_test2
> Testing asynchronous pthread_cancel()
>
> Thread 0 starting (0x200102c0)
> Changing canceltype from 0 to 1
> Thread 1 starting (0x20010360)
> Changing canceltype from 0 to 1
> Thread 2 starting (0x20010400)
> Changing canceltype from 0 to 1
>
> Cancelling thread 2 (0x20010400)
> Thread 2 exiting (0x20010400)
> Cancelling thread 1 (0x20010360)
> Thread 1 exiting (0x20010360)
> Cancelling thread 0 (0x200102c0)
> Thread 0 exiting (0x200102c0)
>
> Thread 0 is gone (0x200102c0)
> Thread 1 is gone (0x20010360)
> Thread 2 is gone (0x20010400)
>
> $ gcc otto_test3.c -o otto_test3
> $ ./otto_test3
> Testing pthread_kill()
>
> Thread 0 starting (0x200102c0)
> Thread 1 starting (0x20010360)
> Thread 2 starting (0x20010400)
>
> Sending SIGUSR1 to thread 2 (0x20010400)
> Thread 2 executes signal handler (0x20010400)
> Thread 2 encountered an error: Interrupted system call (0x20010400)
> Sending SIGUSR1 to thread 1 (0x20010360)
> Thread 1 executes signal handler (0x20010360)
> Thread 1 encountered an error: Interrupted system call (0x20010360)
> Sending SIGUSR1 to thread 0 (0x200102c0)
> Thread 0 executes signal handler (0x200102c0)
> Thread 0 encountered an error: Interrupted system call (0x200102c0)
>
> Are the errors in the last test case to be expected under the 20130612
> snapshot (CYGWIN_NT-5.1, 1.7.21s 20130612 21:06:59, i686 Cygwin)?

I can replicate this on my system, consistently.  There's clearly a 
problem, but it's not the same as in the original Cygwin bug report.  In 
the present case, the signal is received by the right thread, but 
something goes wrong afterwards.

I'm attaching the test case for ease of reference.

Ken

--------------060004040501040900040907
Content-Type: text/plain; charset=windows-1252;
 name="otto_test3.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="otto_test3.c"

LyogaHR0cDovL2N5Z3dpbi5jb20vbWwvY3lnd2luLzIwMTItMDUvbXNnMDA0
MzQuaHRtbCAqLwoKI2luY2x1ZGUgPGVycm5vLmg+CiNpbmNsdWRlIDxwdGhy
ZWFkLmg+CiNpbmNsdWRlIDxzZW1hcGhvcmUuaD4KI2luY2x1ZGUgPHNpZ25h
bC5oPgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPHN0ZGxpYi5oPgoj
aW5jbHVkZSA8c3RyaW5nLmg+CiNpbmNsdWRlIDx1bmlzdGQuaD4KCnB0aHJl
YWRfdCB0aWRzWzNdOwpzZW1fdCBzZW1hcGhvcmU7CgpzdGF0aWMgdm9pZCBj
bGVhbnVwX2hhbmRsZXIodm9pZCAqYXJnKSB7CiAgaW50ICppbnRwdHIgPSAo
aW50Kilhcmc7CiAgcHRocmVhZF90IHNlbGYgPSBwdGhyZWFkX3NlbGYoKTsK
ICBmcHJpbnRmKHN0ZGVyciwgIlRocmVhZCAlaSBleGl0aW5nICglcClcbiIs
ICppbnRwdHIsIHNlbGYpOwp9CgpzdGF0aWMgdm9pZCogc2ltcGxldGhyZWFk
KHZvaWQgKmFyZykgewogIGludCAqaW50cHRyID0gKGludCopYXJnOwogIHB0
aHJlYWRfdCBzZWxmID0gcHRocmVhZF9zZWxmKCk7CiAgZnByaW50ZihzdGRl
cnIsICJUaHJlYWQgJWkgc3RhcnRpbmcgKCVwKVxuIiwgKmludHB0ciwgc2Vs
Zik7CgogIHB0aHJlYWRfY2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NsZWFudXBfaGFuZGxlciwgJm1haW5pbnQpOwoKICBmb3IgKGk9Mjsg
aT49MDsgaS0tKSB7CiAgICBmcHJpbnRmKHN0ZGVyciwgIlNlbmRpbmcgU0lH
VVNSMSB0byB0aHJlYWQgJWkgKCVwKVxuIiwgaSwgdGlkc1tpXSk7CiAgICBy
ZXN1bHQgPSBwdGhyZWFkX2tpbGwodGlkc1tpXSwgU0lHVVNSMSk7CiAgICBp
ZiAocmVzdWx0ICE9IDApIHsKICAgICAgZnByaW50ZihzdGRlcnIsICJFcnJv
ciBkdXJpbmcgcHRocmVhZF9raWxsOiAlc1xuIiwgc3RyZXJyb3IocmVzdWx0
KSk7CiAgICB9CiAgICBzbGVlcCgxKTsKICB9CgogIHB0aHJlYWRfY2xlYW51
cF9wb3AoMCk7CiAgcmV0dXJuIDA7Cn0K


--------------060004040501040900040907
Content-Type: text/plain; charset=us-ascii

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
--------------060004040501040900040907--

- Raw text -


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