Path: utzoo!attcan!uunet!samsung!usc!apple!uokmax!d.cs.okstate.edu!drd!mark From: mark@DRD.Com (Mark Lawrence) Newsgroups: comp.lang.perl Subject: Perl dumps core on SparcStation: Script At 11 ... Message-ID: <1990Jul19.133014.1445@DRD.Com> Date: 19 Jul 90 13:30:14 GMT Reply-To: mark@drd.Com (Mark Lawrence) Organization: DRD Corporation, Tulsa, OK Lines: 75 $Header: perly.c,v 3.0.1.5 90/03/27 16:20:57 lwall Locked $ Patch level: 18 SparcStation 1+ (4/65) and Sun 3/60, both running 4.0.3. The following script runs fine on the 3/60 but dumps core (Segmentation fault) on the Sparc. dbmopen(units,"foo",0666) || die "Can't open units ndbm files"; $unitfile = "foo.txt"; open unitfile || die "Can't open $unitfile"; while () { next if (/^#/ || /^!/); ($symbol,$type,$id,$name) = split(/[\t\n ]/); print "$symbol,$name,$type,$id\n"; $units{$symbol,'Type'} = $type; # DUMPS CORE AT THIS LINE $units{$symbol,'ID'} = $id; $units{$symbol,'Name'} = $name; } close(unitfile); dbmclose(units); foo.txt: !Symbol Type id name gpm 11 2 FlowRate audit: 262 sparky:/home/rtd/mark/tmp% perl foo.pl gpm,FlowRate,11,2 Segmentation fault (core dumped) 263 sparky:/home/rtd/mark/tmp% ll core -rw-r--r-- 1 mark staff 8499632 Jul 19 08:25 core 264 sparky:/home/rtd/mark/tmp% swat GDB 3.5, Copyright (C) 1989 Free Software Foundation, Inc. There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details. GDB is free software and you are welcome to distribute copies of it under certain conditions; type "info copying" to see the conditions. Reading symbol data from /usr/local/bin/perl... (no debugging symbols found)...done. Type "help" for a list of commands. (gdb) core core Core file is from "perl". Program terminated with signal 11, Segmentation fault. (gdb) where #0 0x4476c in dbm_nextkey () #1 0x43c60 in dbm_fetch () #2 0x2026c in hfetch () #3 0x1aaec in eval () #4 0x17aa8 in eval () #5 0x3f00 in cmd_exec () #6 0x4794 in cmd_exec () #7 0x22df8 in main () (gdb) Selected macros from the Makefile: CC = gcc YACC = yacc bin = /usr/local/bin privlib = /usr/local/lib/perl mansrc = /usr/man/manl manext = l CFLAGS = -fpcc-struct-return -I/usr/include/sun -O LDFLAGS = SMALL = LARGE = mallocsrc = malloc.c mallocobj = malloc.o SLN = ln -s libs = -ldbm -lm GCC Version: 267 sparky:/usr/local/src/perl% gcc -v gcc version 1.37.1