This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: fix cond_race... was RE: src/winsup/cygwin ChangeLog thread.cc thread.h ...


Rob,

On Sat, Sep 29, 2001 at 07:45:34PM +1000, Robert Collins wrote:
> ----- Original Message -----
> From: "Jason Tishler" <jason@tishler.net>
> > On Fri, Sep 28, 2001 at 05:48:16PM +1000, Robert Collins wrote:
> > > Well this patch should make evreything good -  fixing the critical
> > > section induced race.
> >
> > At the risk of appearing dense...  Should this patch fix the pthreads
> > hang trigger by Python's test_threadedtempfile regression test?
> 
> I've checked in my completed code. I -cannot- tickle this bug via my
> test suite at all now. (I found that one of my test scripts was slightly
> buggy in that it made an incorrect assumption - it was passing when this
> bug was tickled - correcting that let me hit this bug nearly every time
> :]).
> 
> So please, give it a go and see how it fares.

Unfortunately, Python's test_threadedtempfile regression test still
hangs (IIRC) in the same place.  See attached for details.

BTW, the code (i.e., pthread_cond::TimedWait) still has a FIXME in it.
Did your latest patches fix a different race condition?  And, if so,
is this yet another known race condition?

FWIW, I built from CVS on 10/5/2001 and I'm running under Win2K SP1.

Thanks,
Jason
(gdb) bt
#0  0x77f82152 in _libkernel32_a_iname ()
#1  0x77e830fe in _libkernel32_a_iname ()
#2  0x77e83126 in _libkernel32_a_iname ()
#3  0x61062b34 in pthread_cond::TimedWait (this=0xa0c81a8, 
    dwMilliseconds=4294967295) at ../../../../src/winsup/cygwin/thread.cc:538
#4  0x61064623 in __pthread_cond_dowait (cond=0xa0c1ac4, mutex=0xa0c1ac8, 
    waitlength=-1) at ../../../../src/winsup/cygwin/thread.cc:1769
#5  0x6106475c in pthread_cond_wait (cond=0xa0c1ac4, mutex=0xa0c1ac8)
    at ../../../../src/winsup/cygwin/thread.cc:1806
#6  0x61d928a5 in PyThread_acquire_lock (lock=0xa0c1ac0, waitflag=1)
    at Python/thread_pthread.h:313
..
(gdb) f 3
#3  0x61062b34 in pthread_cond::TimedWait (this=0xa0c81a8, 
    dwMilliseconds=4294967295) at ../../../../src/winsup/cygwin/thread.cc:538
538           rv = WaitForSingleObject (win32_obj_id, dwMilliseconds);
(gdb) list
533           rv = WaitForSingleObject (win32_obj_id, dwMilliseconds);
534         }
535       else
536         {
537           LeaveCriticalSection (&mutex->criticalsection);
538           rv = WaitForSingleObject (win32_obj_id, dwMilliseconds);
539     #if 0
540         /* we need to use native win32 mutex's here, because the cygwin ones now use
541          * critical sections, which are faster, but introduce a race _here_. Until then
542          * The NT variant of the code is redundant.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]