delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/10/24/07:06: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:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type; q=dns; s=default; b=iQ7fi2
THCvT775KI1nkaqCj8m4cUfXtTd9VpvNyk1AYlVo6rNfI2Y9Nqsf9aw5p7+Wmo55
mI0zNtZhLA34OgDR4JZ91x3w+bQlg9a14PSwtrpgbjMuxe99eeQp+G2tFLXlAvTK
ca8EGfOh/Y6z0anhCEgj+E1RxQPILFLChj+po=
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:subject
:references:in-reply-to:content-type; s=default; bh=qkzF3OdaLKX3
RXplefPSixIPWmk=; b=ODERJ6p/uQvWmgpb/y3OvJzODthaP5lvkC/md0AygiVt
iEXo+arpadGeuTReDDTTt5SCdf393Xv/YuwGaGdMfvMaD0YR05PXDRIcUgLBS5XT
pEihMSVd6kFJY+kJUX8zZ041kodqqoFCYfH+IqUL2qY4yklh9p1m9Xq3yEwH/4E=
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=-1.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2
X-HELO: out1-smtp.messagingengine.com
Message-ID: <544A327E.9090006@dronecode.org.uk>
Date: Fri, 24 Oct 2014 12:05:34 +0100
From: Jon TURNEY <jon DOT turney AT dronecode DOT org DOT uk>
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Threads
References: <54450835 DOT 3050602 AT cornell DOT edu> <5448E6F9 DOT 8040005 AT dronecode DOT org DOT uk> <5448EEBF DOT 3020706 AT cornell DOT edu> <20141023153730 DOT GC20607 AT calimero DOT vinschen DOT de>
In-Reply-To: <20141023153730.GC20607@calimero.vinschen.de>

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

On 23/10/2014 16:37, Corinna Vinschen wrote:
> On Oct 23 08:04, Ken Brown wrote:
>> On 10/23/2014 7:31 AM, Jon TURNEY wrote:
>>> On 20/10/2014 14:03, Ken Brown wrote:
>>>> Or is there some other plausible explanation for "impossible" crashes?
>>>> This can't just be a result of a gdb bug, because in at least one case
>>>> the assertion can be shown to be valid by using printf instead of gdb.
>>>>
>>>> [*] By "impossible" I mean that examination of the relevant variables in
>>>> gdb shows that the assertions are in fact true.  Two ongoing examples are
>>>>
>>>>     http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18438
>>>>     http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18769
>>>
>>> As a suggestion, you might want to also take a careful look at how signal
>>> delivery is implemented in cygwin on x86_64
>>>
>>> I had a vague idea that there was, at some time in the past, a fix made for
>>> register corruption on x86_64 after a signal was handled, but I can't find it
>>> now, so maybe I imagined it.
>>
>> Is this what you're thinking of?
>>
>>    https://cygwin.com/ml/cygwin-cvs/2014-q1/msg00020.html
>>
>>> But if for e.g. the flags register was getting
>>> corrupted when a signal interrupts the main thread, that could perhaps also
>>> explain what is being seen.
>>
>> Yes, flags register corruption is exactly what Eli suggested in the other
>> bug report I cited.
>
> The aforementioned patch was supposed to fix this problem and it is
> definitely in the current 1.7.32 release...

I didn't mean to suggest otherwise, just that perhaps a similar problem 
exists now.

So I made the attached test case to explore that.  Maybe I've made an 
obvious mistake with it, but on the face of it, it seems to demonstrate 
something...

jon AT tambora /
$ gcc signal-stress.c  -Wall -O0 -g

jon AT tambora /
$ ./a
failed: 2144210386 isn't equal to 2144210386, apparently

Note there is some odd load dependency. For me, it works fine when it's 
the only thing running, but when I start up something CPU intensive, it 
often fails...

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

CiNpbmNsdWRlIDxhc3NlcnQuaD4KI2luY2x1ZGUgPHN5cy90aW1lLmg+CiNp
bmNsdWRlIDxzaWduYWwuaD4KI2luY2x1ZGUgPHN0ZGlvLmg+Cgpsb25nIFNt
YXJ0U2NoZWR1bGVJbnRlcnZhbCA9IDE7IC8qIG1zICovCmxvbmcgU21hcnRT
Y2hlZHVsZVRpbWUgPSAwOwoKc3RhdGljIHZvaWQKU21hcnRTY2hlZHVsZVRp
bWVyKGludCBzaWcpCnsKICAgIGlmIChzaWcgIT0gMCkKICAgICAgIFNtYXJ0
U2NoZWR1bGVUaW1lICs9IFNtYXJ0U2NoZWR1bGVJbnRlcnZhbDsKfQoKdm9p
ZApTbWFydFNjaGVkdWxlU3RhcnRUaW1lcih2b2lkKQp7CiAgICBzdHJ1Y3Qg
aXRpbWVydmFsIHRpbWVyOwogICAgdGltZXIuaXRfaW50ZXJ2YWwudHZfc2Vj
ID0gMDsKICAgIHRpbWVyLml0X2ludGVydmFsLnR2X3VzZWMgPSBTbWFydFNj
aGVkdWxlSW50ZXJ2YWwgKiAxMDAwOwogICAgdGltZXIuaXRfdmFsdWUudHZf
c2VjID0gMDsKICAgIHRpbWVyLml0X3ZhbHVlLnR2X3VzZWMgPSBTbWFydFNj
aGVkdWxlSW50ZXJ2YWwgKiAxMDAwOwogICAgc2V0aXRpbWVyKElUSU1FUl9S
RUFMLCAmdGltZXIsIDApOwp9CgppbnQgbWFpbigpCnsKICAgIC8qIFNldCB1
cCB0aGUgdGltZXIgc2lnbmFsIGZ1bmN0aW9uICovCiAgICBzdHJ1Y3Qgc2ln
YWN0aW9uIGFjdDsKICAgIGFjdC5zYV9oYW5kbGVyID0gU21hcnRTY2hlZHVs
ZVRpbWVyOwogICAgc2lnZW1wdHlzZXQoJmFjdC5zYV9tYXNrKTsKICAgIHNp
Z2FkZHNldCgmYWN0LnNhX21hc2ssIFNJR0FMUk0pOwogICAgaWYgKHNpZ2Fj
dGlvbihTSUdBTFJNLCAmYWN0LCAwKSA8IDApIHsKICAgICAgICBwZXJyb3Io
InNpZ2FjdGlvbiBmYWlsZWQiKTsKCXJldHVybiAtMTsKICAgIH0KCiAgIC8q
IHN0YXJ0IHRpbWVyICovCiAgIFNtYXJ0U2NoZWR1bGVTdGFydFRpbWVyKCk7
CgogICAvKiBMb29wIGZvcmV2ZXIsIGRvaW5nIHRlc3RzIHdoaWNoIHNob3Vs
ZCBhbHdheXMgc3VjY2VlZCwgd2l0aCBsb3RzIG9mIHNpZ25hbHMgKi8KICAg
aW50IHggPSAwOwogICBpbnQgaSA9IDA7CiAgIHdoaWxlICgxKSB7CiAgICAg
eCA9IGk7CiAgICAgaW50IGogPSB4OwogICAgIGlmIChqICE9IGkpCiAgICAg
ICB7CiAgICAgICAgICBwcmludGYoImZhaWxlZDogJWQgaXNuJ3QgZXF1YWwg
dG8gJWQsIGFwcGFyZW50bHlcbiIsIGksIGopOwogICAgICAgICAgYnJlYWs7
CiAgICAgICB9CiAgICAgaSsrOwogIH0KICByZXR1cm4gMDsKfQo=


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

- Raw text -


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