Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!cos!hadron!inco!alembic!csu From: csu@alembic.acs.com (Dave Mack) Newsgroups: comp.lang.perl Subject: Re: Perl PL 28 fails op.dbm on SparcStation 1 Keywords: ndbm; core; blooie Message-ID: <1990Aug24.061936.7472@alembic.acs.com> Date: 24 Aug 90 06:19:36 GMT References: <1990Aug17.031514.14790@midway.uchicago.edu> <1990Aug21.203346.598@maths.tcd.ie> Organization: Alembic Computer Services, McLean VA Lines: 56 In article <1990Aug21.203346.598@maths.tcd.ie> ajudge@maths.tcd.ie (Alan Judge) writes: >In <1990Aug17.031514.14790@midway.uchicago.edu> keith@curry.uchicago.edu (Keith Waclena) writes: >>Perl at PL 27 and also at PL 28 both fail op.dbm, dumping core in a >>big way. Here is a trivial script that illustrates the problem: >>Anyway, my environment is Sun SparcStation-1 running SunOS Release >>4.0.3. I compiled with both Sun's cc and Gnu cc; same results. Also >>blows up on a Sun 4/110 running SunOS 4.0. > >I am running perl PL 28 on a Sun SS-1/4.0.3c, and op.dbm (and all the other >tests) works fine for me. I suggest you check your patches/sources etc... > >I compiled perl with cc. Me too, on a Sun-4/110 running SunOS4.1, and it also passes op.dbm. Unfortunately, it appears that delete, when applied to an assoc array (from dbm), deletes the wrong entry in the database. In particular, this code, which worked perfectly under Perl3.18, very quietly does the wrong thing: #! /usr/local/bin/perl # # rmbyalias deletes an entry from real2alias database given the alias # # Usage: rmbyalias # umask 0077; if ( $#ARGV != 0 ) { print STDERR "Usage: rmbyalias \n"; exit(1); } $target_alias = $ARGV[0]; dbmopen(r2a,"/usr/personals/real2alias",0600) || die "$0: can't dbmopen real2alias: $!\n"; open(LOG,">>/usr/personals/REMOVED"); while (($key,$value) = each %r2a) { if ( "$value" eq "$target_alias" ) { delete $r2a{$key}; print LOG "$value:$key\n"; print "Removed $value:$key\n"; } } dbmclose(r2a); close(LOG); exit(0); Further context: in SunOS4.1, libdbm.a (according to the man page) is actually ndbm. I have no idea whether or not this is relevant. -- Dave Mack csu@alembic.ACS.COM