Subject: pkg/8981:
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dogcow@redback.com>
List: netbsd-bugs
Date: 12/10/1999 21:30:41
>Number:         8981
>Category:       pkg
>Synopsis:       
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager (NetBSD software packages system bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 10 21:30:00 1999
>Last-Modified:
>Originator:     
>Organization:
	
Redback Networks
>Release:        <NetBSD-current source date>1.4.1
>Environment:
	
System: NetBSD quest.redbacknetworks.com 1.4.1 NetBSD 1.4.1 (GENERIC) #1: Tue Aug 10 00:03:09 MEST 1999 fvdl@struis:/usr/src/sys/arch/i386/compile/GENERIC i386


>Description:
The pthread libs coredump as soon as a call from system() finishes.
	
>How-To-Repeat:
cat >z.c<<EOF
#include <stdlib.h>
int main() {
  system("ls");
}
EOF
gcc -D_REENTRANT -g -I/usr/pkg/pthreads/include -L/usr/pkg/pthreads/lib z.c -o z -lpthread
./z

watch ls get executed, and then ./z core. the gcc backtrace:
(gdb) bt
#0  0x4009aadb in kill ()
#1  0x4009a859 in abort ()
#2  0x400319d2 in context_switch_done ()
#3  0x40031f2b in pthread_resched_resume ()
#4  0x400302ce in waitpid ()
#5  0x40048423 in system ()
#6  0x17e6 in main () at z.c:3
(gdb) 

I'm using the stock gcc with 1.4.1, and the stock pkgsrc mit-pthreads
(15 Nov 1999 Makefile date).
	
>Fix:
	
Got me.
>Audit-Trail:
>Unformatted:
pthreads causes coredumps
serious