G++ guru's please comment - Re: FW: pthread_create problem in Cygwin 1.1.8-2]

Christopher Faylor cgf@redhat.com
Sun Apr 8 18:53:00 GMT 2001


On Mon, Apr 09, 2001 at 11:31:57AM +1000, Robert Collins wrote:
>> -----Original Message-----
>> From: Robert Collins 
>> Sent: Monday, April 09, 2001 11:14 AM
>> To: cygwin@cygwin.com
>> Subject: RE: G++ guru's please comment - Re: FW: 
>> pthread_create problem
>> in Cygwin 1.1.8-2]
>> 
>> 
>> 
>> I will, once I have a good binary to compare with. I don't know what
>> return 0; in a try{} should look like.
>> 
>> Just for fun I removed the printf, and the crash went away. It also
>> never appears with only one thread running.
>> 
>> I've had a quick read of the asembly and will report back.
>> 
>
>
>I haven't got time for an exhaustive session on this during the workday.
>I'll look at it more at home tonight.
>
>It's definately not printf() trashing ecx - I have a slightly more
>trivial test case below. I'd really appreciate a non-stripped working
>binary of the test case below so I can track this down a little more
>quickly. BTW Chris - esp looks fine to me, it's just ecx that's getting
>trashed. 

I wouldn't expect the stack pointer to be screwed up.  I'd expect that
the *stack* is screwed up.  I don't believe that the ecx register should
be preserved across function calls so I don't know why this would mater.

>If someone tries to build this, you will need a snapshot to have the
>sched_yield() function. The bug isn't in the pthread code AFAICT - Joost
>is on 1.1.8, and I'm on my new code, and we both have the same symptoms.
>
>>From what I can see so far the exception is related to the thread
>exiting within the try {} block after the thread function has lost the
>processor to another instance of the same function. sched_yield() simply
>forces that to occur.
>
>(going out on a limb) This may be something solvable by building gcc
>with pthread exception handling as Mumit suggested. 

Yep.  Probably.  Somebody should try that.

cgf

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list