Subject: thread problem bilding perl 5.8.6 on 2.0/sparc
To: None <>
From: Hubert Feyrer <>
List: tech-userlevel
Date: 03/05/2005 11:21:48
Building perl 5.8.6 on NetBSD 2.0/sparc from pkgsrc-current leads to 
miniperl dumping core. gdb says:

 	#0  0x1030c100 in pthread__lock_ras_end () from /usr/lib/

Is this a known problem, how does one work around it? Is it fixed on the 
netbsd-2 or maybe netbsd-2-0 branch, and if so, what component needs 
rebuilding - kernel, libpthread, ...?

More information is appended below, please let me and/or Martin Ebnoether 
(CC:d) know! (It`s his machine, an IPC)

What can we do to get perl going on sparc?

  - Hubert

Sparc IPX, 32MB RAM, 40MHz, 2GB HDD
Contact: Martin Ebnoether <>

Script started on Sat Mar  5 11:04:32 2005
# uname -a
NetBSD brick.nassacker 2.0 NetBSD 2.0 (GENERIC) #0: Thu Dec  2 01:57:30 UTC 2004  builds@build:/big/builds/ab/netbsd-2-0-RELEASE/sparc/200411300000Z-obj/big/builds/ab/netbsd-2-0-RELEASE/src/sys/arch/sparc/compile/GENERIC sparc
# pwd
# cat l2
LD_LIBRARY_PATH=/usr/pkgsrc/lang/perl58/work/perl-5.8.6 ./miniperl -w -Ilib -MExporter -e '<?>' 
# sh -v l2
LD_LIBRARY_PATH=/usr/pkgsrc/lang/perl58/work/perl-5.8.6 ./miniperl -w -Ilib -MExporter -e '<?>' 
[1]   Segmentation fault (core dumped) LD_LIBRARY_PATH=...
# ls -la miniperl.core miniperl
-rwxr-xr-x  1 root  wheel   256891 Mar  5 10:31 miniperl
-rw-------  1 root  wheel  2498560 Mar  5 11:04 miniperl.core
# gdb miniperl miniperl.core
GNU gdb 5.3nb1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc--netbsdelf"...
Core was generated by `miniperl'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/libexec/ld.elf_so...done.
Loaded symbols for /usr/libexec/ld.elf_so
Reading symbols from /usr/pkgsrc/lang/perl58/work/perl-5.8.6/
Loaded symbols for /usr/pkgsrc/lang/perl58/work/perl-5.8.6/
Reading symbols from /usr/lib/
Loaded symbols for /usr/lib/
Reading symbols from /usr/lib/
Loaded symbols for /usr/lib/
Reading symbols from /usr/lib/
Loaded symbols for /usr/lib/
Reading symbols from /usr/lib/
Loaded symbols for /usr/lib/
#0  0x1030c100 in pthread__lock_ras_end () from /usr/lib/
(gdb) bt
#0  0x1030c100 in pthread__lock_ras_end () from /usr/lib/
#1  0x1030b888 in pthread_mutex_lock () from /usr/lib/
#2  0x103d6d10 in malloc () from /usr/lib/
#3  0x1013efd0 in Perl_safesysmalloc (size=16) at util.c:73
#4  0x1015c128 in Perl_av_extend (my_perl=0x48000, av=0x49048, key=3)
     at av.c:158
#5  0x1015cf34 in Perl_av_store (my_perl=0x48000, av=0x49048, key=3,
     val=0x492a0) at av.c:322
#6  0x1015c7ac in Perl_av_fetch (my_perl=0x48000, av=0x49048, key=3, lval=1)
     at av.c:237
#7  0x10145a4c in Perl_my_popen (my_perl=0x48000,
     cmd=0x571c0 "/bin/csh -cf 'set nonomatch; glob ?' 2>/dev/null",
     mode=0xeffff4d0 "r") at util.c:1967
#8  0x1020382c in Perl_do_openn (my_perl=0x48000, gv=0x556a0,
     name=0x571c0 "/bin/csh -cf 'set nonomatch; glob ?' 2>/dev/null", len=48,
     as_raw=0, rawmode=0, rawperm=0, supplied_fp=0x0, svp=0x0, num_svs=0)
     at doio.c:498
#9  0x1020134c in Perl_do_open (my_perl=0x48000, gv=0x556a0,
     name=0x4f680 "/bin/csh -cf 'set nonomatch; glob ?' 2>/dev/null |", len=50,
     as_raw=0, rawmode=0, rawperm=0, supplied_fp=0x0) at doio.c:62
#10 0x1020c218 in Perl_start_glob (my_perl=0x48000, tmpglob=0x556f4,
     io=0x556b8) at doio.c:2371
#11 0x1016a25c in Perl_do_readline (my_perl=0x48000) at pp_hot.c:1536
#12 0x101dda4c in Perl_pp_glob (my_perl=0x48000) at pp_sys.c:420
#13 0x1013e4b8 in Perl_runops_debug (my_perl=0x48000) at dump.c:1449
#14 0x100af37c in S_run_body (my_perl=0x48000, oldscope=1) at perl.c:1934
#15 0x100aebc8 in perl_run (my_perl=0x48000) at perl.c:1853
#16 0x00013c94 in main (argc=6, argv=0xeffffa4c, env=0xeffffa68)
     at miniperlmain.c:98
#17 0x0001388c in ___start ()
(gdb) quit
# exit

Script done on Sat Mar  5 11:08:46 2005

NetBSD - Lean, Free AND Open!  (And of course secure, portable, yadda yadda)