Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: Quick testfeedback... X-MimeOLE: Produced By Microsoft Exchange V6.0.4417.0 Date: Wed, 12 Sep 2001 11:43:31 +1000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Quick testfeedback... Thread-Index: AcE7Kp2UNBfHgpuISvukKJeY0+rkbAAAXgXQ From: "Robert Collins" To: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id VAA11298 This is broadcast.c: === /* broadcast.c: Testing cond_broadcast * * Copyright 2001 Robert Collins * * This file is part of pthreadtest. * * This software is a copyrighted work licensed under the terms of the * GNU GPL. Please consult the file "COPYING" for details. */ #include #include #include void *baby(); pthread_cond_t cond; pthread_mutex_t lock; pthread_attr_t attr; pthread_t tid; int main () { int i; if (i = pthread_cond_init(&cond, NULL)) { printf("error on cond_init %d:%s\n", i,strerror(i)); return 1; } if (pthread_attr_init(&attr)) { printf("error on attr_init %d\n", i); return 1; } if(pthread_mutex_init(&lock, NULL)) { printf("error on mutex_init %d\n", i); return 1; } pthread_mutex_lock(&lock); pthread_create(&tid, &attr, baby, NULL); for (i=0; i<10; i++) { sleep(1); #if DEBUG printf("before cond wait\n"); #endif pthread_cond_wait(&cond, &lock); #if DEBUG printf("after cond wait\n"); #endif } pthread_mutex_unlock(&lock); return 0; } void *baby() { while (1) { sleep(2); pthread_mutex_lock(&lock); #if DEBUG printf("before cond broadcast\n"); #endif pthread_cond_broadcast(&cond); #if DEBUG printf("after cond broadcast\n"); #endif pthread_mutex_unlock(&lock); } } === > -----Original Message----- > From: Christopher Faylor [mailto:cgf AT redhat DOT com] > Sent: Wednesday, September 12, 2001 11:44 AM > To: cygwin-developers AT cygwin DOT com > Cc: Robert Collins > Subject: Re: Quick testfeedback... > > > On Tue, Sep 11, 2001 at 09:15:23PM -0400, Jason Tishler wrote: > >On Tue, Sep 11, 2001 at 08:40:19PM -0400, Jason Tishler wrote: > >> On Wed, Sep 12, 2001 at 09:19:19AM +1000, Robert Collins wrote: > >> > If it was after the bugfix commit, I'd like to see if we > can track this > >> > asap... > >> > >> I can reproduce it frequently but not every time. I will > debug it first > >> thing tomorrow morning. FYI, it seems to occur right near > the end of > >> the test and the test still passes. > > > >Doh! My first shot running broadcast from gdb caused the SIGSEGV: > > Thanks. This shows me exactly what is going on. > > I assume that sleep() is being called from a thread, right? > > cgf >