Subject: lib/26370: pthread_create fails in -current
To: None <>
From: Martin Husemann <>
List: netbsd-bugs
Date: 07/19/2004 21:50:05
>Number:         26370
>Category:       lib
>Synopsis:       pthread_create fails in -current
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 19 19:52:00 UTC 2004
>Originator:     Martin Husemann
>Release:        NetBSD 2.0G
System: NetBSD 2.0G NetBSD 2.0G (REVEL) #16: Mon Jul 19 17:24:26 CEST 2004 i386
Architecture: i386
Machine: i386

Running the following test program (from pkgsrc/devel/glib2's configure) dumps
core on -current:

#include <pthread.h>

int check_me = 0;

void* func(void* data) {check_me = 42; return &check_me;}

int main()
 { pthread_t t;
   void *ret;
   pthread_create (&t, 0, func, 0);
   pthread_join (t, &ret);
   exit (check_me != 42 || ret != &check_me);

gdb shows the main thread in pthread_create and the new LWP in

Starting program: /tmp/conftest 

Program received signal SIGSEGV, Segmentation fault.
0x48067132 in pthread__sched_idle () from /usr/lib/
(gdb) bt
#0  0x48067132 in pthread__sched_idle () from /usr/lib/
#1  0x480692c3 in pthread_init () from /usr/lib/
#2  0x48069781 in pthread_create () from /usr/lib/
#3  0x08048852 in main () at conftest.c:10
#4  0x080485c2 in ___start ()


compile and run above program on -current.