NetBSD Problem Report #39537

From tho@openrobots.net  Sun Sep 14 00:01:16 2008
Return-Path: <tho@openrobots.net>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 6B0EE63B11D
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 14 Sep 2008 00:01:16 +0000 (UTC)
Message-Id: <20080914000112.BC8705E3C6@ficus.home>
Date: Sun, 14 Sep 2008 02:01:12 +0200 (CEST)
From: anthony.mallet@useless-ficus.net
Reply-To: anthony.mallet@useless-ficus.net
To: gnats-bugs@gnats.NetBSD.org
Subject: programs compiled with -pthread and -pg segfault
X-Send-Pr-Version: 3.95

>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
>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:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.