NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/39537: programs compiled with -pthread and -pg segfault



>Number:         39537
>Category:       lib
>Synopsis:       programs compiles with -pthread and -pg segfault
>Confidential:   no
>Severity:       critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 14 00:05:00 +0000 2008
>Originator:     anthony.mallet%useless-ficus.net@localhost
>Release:        NetBSD 4.99.72
>Organization:
>Environment:
        
        
System: NetBSD ficus 4.99.72 NetBSD 4.99.72 (FICUS) #11: Sat Sep 13 22:20:01 
CEST 2008 troot@ficus:/usr/obj/sys/arch/i386/compile/FICUS i386
Architecture: i386
Machine: i386
>Description:
Simple programs compiled with 'gcc -pthread -pg' dump core.
Same with 'gcc -lpthread -pg'.

The programs fail with the following error detected by libpthread: Invalid
mutex. Detected by file "/usr/src/lib/libpthread/pthread_mutex.c", line 210,
function "pthread__mutex_lock_slow".

#0  0x080554d0 in _lwp_exit ()
#1  0xbbbe5ca1 in pthread_create () from /usr/lib/libpthread.so.0
#2  0x080553f0 in makecontext ()

>How-To-Repeat:
Compile and run the following code with 'gcc -lpthread -pg':

ficus[~] cat test.c
#include <pthread.h>

void *test(void *data)
{
  return NULL;
}

int
main()
{
  pthread_t t;
  pthread_create(&t, NULL, test, NULL);
  pthread_join(t, NULL);
  return 0;
}
ficus[~] > gcc -lpthread -pg -o test test.c
/usr/lib/libc.so.12: warning: warning: this program uses xdr_domainname(),
which is deprecated and buggy.
/usr/lib/libc.so.12: warning: warning: this program uses xdr_mapname(), which
is deprecated and buggy.
/usr/lib/libc.so.12: warning: warning: this program uses xdr_peername(), which
is deprecated and buggy.
ficus[~] > ./test
pipo: Error detected by libpthread: Invalid mutex.
Detected by file "/usr/src/lib/libpthread/pthread_mutex.c", line 210, function
"pthread__mutex_lock_slow".
See pthread(3) for information.
Abort (core dumped)
>Fix:

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index