Problem with pthreads and signaling, behavior broken...

Arash Partow arashp@hotmail.com
Tue Dec 9 07:24:00 GMT 2003


Hi Chris,

The ThreadTest was used to demonstrate a deficiency in cygwin's pthreads
implementation, and in doing so was successful in finding 4 serious
problems that ranged from memory leaks, application crashes to improper
handling of context switches in the thread pools. So continue to be
mystified as much as you like. :) But if you really want to know, all it
tests, are simple cases of thread creation and thread cleanup, and also
mutexes and also expanding thread stack size and also calling of methods
outside of threads, all the while looking for memory leaks, threads not
being cleaned up properly and non-defined pthreads behavior.


Now some more on the ThreadTest. The ThreadTest as is with no changes
to the source code works "FINE" with cygwin1.dll (snapshot) from 19th Nov
and I think even a couple prior to that. The ThreadTest works fine as is
with no changes on BSDs(Open and Free), RHL, and Solaris 9. The source
code affecting functionality in the ThreadTest itself should not need to
be changed. (btw IMO adding debug strings is ok)


I basically tried to run the modified version of ThreadTestPrototype.cpp,
and new makefile it worked fine, I began removing the delays and
subsequently recompiling, it worked fine, then I started modifying the
for-loop signatures to get them back to the way they were before you
had modified them in order to see what actual modification(s) was
making the ThreadTest now work.

In conclusion I was able to replicate the problem "again" by simply
removing the check for the keepRunning variable in the for-loop signature
on line 205. (I've attached the source code)

In a way the problem still remains, if you like send me the dll that "you"
use during your runs and I'll see if I can get it working on my systems.
It would be really nice if we could get this small bug out of the way.



Regards


Arash Partow




__________________________________________________
Be one who knows what they don't know,
Instead of being one who knows not what they don't know,
Thinking they know everything about all things.
http://www.partow.net






>>I must admit that I'm mystified as to what this test is trying to 
>>accomplish
>>but I've modified it so that it will terminate more quickly when a
>>signal is delivered, rather than continuing to create threads after
>>CTRL-C is pressed and added some more debugging output.
>>
>>I've attached the modified source to this message.  I also modified the
>>Makefile so that it created ThreadTest.exe by default.
>>
>>cgf

_________________________________________________________________
E-mail just got a whole lot better. New ninemsn Premium. Click here  
http://ninemsn.com.au/premium/landing.asp


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



More information about the Cygwin mailing list