Subject: pthread bug on NetBSD/vax-current?
To: None <port-vax@netbsd.org>
From: Tom Ivar Helbekkmo <tih@eunetnorge.no>
List: port-vax
Date: 03/07/2005 14:18:00
I'm running 2.99.16 on a 4000-500, and I'd been installing a few
packages from source code, using pkgsrc, when I suddenly observed
configure's conftest dumping core.  As it turns out, it's testing
pthread support, and the program that fails is short and sweet:

#include <pthread.h>
#include <stddef.h>

void *thread_routine(void *data) {
    return data;
}

int main() {
    pthread_t thd;
    pthread_mutexattr_t mattr;
    pthread_once_t once_init = PTHREAD_ONCE_INIT;
    int data = 1;
    pthread_mutexattr_init(&mattr);
    return pthread_create(&thd, NULL, thread_routine, &data);
}

If I compile it with "cc -pthread -g -o thread thread.c", and run it
under gdb, I get:

(gdb) run
Starting program: /u/tih/thread 
thread_resume_suspend_cb: td_thr_suspend(0x1d1f80): generic error.
[Switching to LWP 1]
Stopped due to shared library event
(gdb) where
#0  0x7f7e3238 in _rtld_debug_state () from /usr/libexec/ld.elf_so
#1  0x7f7e2d62 in _rtld (2147478644, 2138963968) from /usr/libexec/ld.elf_so
(gdb) 

Doing the same thing using 2.99.15 on i386, it runs without crashing.

-tih
-- 
Don't ascribe to stupidity what can be adequately explained by ignorance.