Subject: lib/20139: pthread_cond_timedwait() problem
To: None <gnats-bugs@gnats.netbsd.org>
From: None <explorer@flame.org>
List: netbsd-bugs
Date: 01/31/2003 23:58:43
>Number: 20139
>Category: lib
>Synopsis: pthread_cond_timedwait() uses 100% CPU
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: lib-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jan 31 15:59:02 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Michael Graff
>Release: NetBSD 1.6M
>Organization:
flame.org: yes, we do know everything
>Environment:
System: NetBSD speedy.flame.org 1.6M NetBSD 1.6M (GENERIC.MP) #2: Fri Jan 31 12:22:55 PST 2003 explorer@speedy.flame.org:/sys/arch/i386/compile/GENERIC.MP i386
Architecture: i386
Machine: i386
>Description:
When building glib on my dual AMD box, conftest locks up with 100% of
cpu:
checking whether pthread_getspecific is posix like... yes
checking whether pthread_mutex_trylock is posix like... yes
checking whether pthread_cond_timedwait is posix like... ^Cspeedy#
>How-To-Repeat:
Put this in a file:
#include <pthread.h>
int main () {
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
struct timeval tval;
struct timespec tspec;
gettimeofday (&tval, NULL);
tspec.tv_sec = tval.tv_sec;
tspec.tv_nsec = 0;
return pthread_cond_timedwait (&cond,&mutex,&tspec) != -1;
}
then
cc -O2 -o conftest conftest.c -lpthread
and
./conftest
>Fix:
Unknown.
>Release-Note:
>Audit-Trail:
>Unformatted: