This is the mail archive of the
pthreads-win32@sources.redhat.com
mailing list for the pthreas-win32 project.
Re: pthreads comments and suggestions [was: Re: Handle leak ?]
>If you look in _pthread_threadDestroy (in private.c), you'll see that
>there is already a guard against the case where threadH == 0.
>
>In fact this guard looks un-necessary:
Ah, but there is no such guard in pthread_setspecific, which is
where I gather it's crashing. (I'm going from memory, but I promise
you that guard had an effect in the distribution code from October.)
The best thing to do is try it: write a program that does nothing
but create and destroy threads. Let it run for hours. It will leak
handles. It will crash. I tested this empirically on three different
NT machines.
I got this same reaction when I notified this list about the bug
before: nobody believed there was a bug. TRY IT. (I posted
sample code to exhibit the bug a while back, but don't have
it handy now. It is trivial to rewrite, though. It is literally a ten
line program.)
This is indicative of a major problem in the DLL and with that
bug you cannot deploy a production application with the DLL.
You may or may not get random infrequent crashes -- not what
you want in production code...
I regret I did not have the time to find and fix the actual bug,
but I've at least gotten you a good start. :)
Dave