Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!texsun!convex!convex.COM From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.lang.perl Subject: Re: man dbm access causes core dump on Sun 4/OS 4.03 Keywords: core dump, patch 41, man Message-ID: <109356@convex.convex.com> Date: 28 Nov 90 00:59:32 GMT References: <25213.659656454@buckaroo.ics.uci.edu> Sender: usenet@convex.com Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 139 In article <25213.659656454@buckaroo.ics.uci.edu> nagel@ICS.UCI.EDU writes: >I am using Tom Christianson's latest man program and under s/son/sen >patchlevel 41, on Sun 4/OS 4.03 systems, dbm access in that program >causes perl to dump core. Note that this does not happen under OS >4.1, or any other hardware/OS combination I have access to. Has >anyone else seen this behavior? I reported this to Larry, but I >can't seem to isolate the problem enough to help him track it >down... I'm trying to write some small scripts that cause identical >crashes, but for now I'm wondering if I'm the only one and more >importantly, if someone has found a fix for this. I am running 4.0.3, but not PL41 on the Suns, and I've not seen the problem. It could be sun's ndbm routines, or perl's assoc array binding thereof, or the weirdness I use to eval the array name to pull the right stuff. I may try to upgrade this weekend, at which point I'll tell you whether I see the problem as well. Do you have problems with any other dbm programs? I'll append three little programmettes that deal with the man stuff: straycats -- find catpages with no parent manpage source catwhatis -- cat out the whatis database(s) countman -- count the number of entries in a man tree The first will work with any man system, the last two expect to use mine. I'd be interested to hear whether the last two dump core for you, since they deal with the databases as well, although in a more straight-forward manner. --tom #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # countman # straycats # catwhatis # This archive created: Tue Nov 27 18:57:14 1990 export PATH; PATH=/bin:/usr/bin:$PATH echo shar: "extracting 'countman'" '(326 characters)' if test -f 'countman' then echo shar: "will not over-write existing file 'countman'" else sed 's/^ X//' << \SHAR_EOF > 'countman' X#!/usr/local/bin/perl X# X# countman -- count the number of entries in a man tree X X$| = 1; Xfor (split(/:/, shift || $ENV{'MANPATH'} || '/usr/man')) { X dbmopen(%whatis, "$_/whatis", undef) || (warn "$0: dbmopen $_: $!\n",next); X print $_, ': '; X for ($count = 0; each %whatis; $count++) { } X print $count, "\n"; X} SHAR_EOF if test 326 -ne "`wc -c < 'countman'`" then echo shar: "error transmitting 'countman'" '(should have been 326 characters)' fi chmod 775 'countman' fi echo shar: "extracting 'straycats'" '(525 characters)' if test -f 'straycats' then echo shar: "will not over-write existing file 'straycats'" else sed 's/^ X//' << \SHAR_EOF > 'straycats' X#!/usr/local/bin/perl X# X# straycats -- find catpages with no parent manpage source X Xfor $root (split(/:/, shift || $ENV{'MANPATH'} || '/usr/man')) { X X chdir($root) || die "can't chdir to $root: $!\n"; X X foreach $catdir ( ) { X opendir (catdir, $catdir) || die "can't opendir $dir: $!"; X ($mandir = $catdir) =~ s/cat/man/; X foreach $file ( readdir(catdir) ) { X next if $file eq '.'; X next if $file eq '..'; X next if -e "$mandir/$file"; X print "no man page for $root/$catdir/$file\n"; X } X } X X} SHAR_EOF if test 525 -ne "`wc -c < 'straycats'`" then echo shar: "error transmitting 'straycats'" '(should have been 525 characters)' fi chmod 775 'straycats' fi echo shar: "extracting 'catwhatis'" '(565 characters)' if test -f 'catwhatis' then echo shar: "will not over-write existing file 'catwhatis'" else sed 's/^ X//' << \SHAR_EOF > 'catwhatis' X#!/usr/local/bin/perl X# X# catwhatis -- cat out the whatis database(s) X Xfor $manroot (split(/:/, shift || $ENV{'MANPATH'} || '/usr/man')) { X if (!dbmopen(manroot, "$manroot/whatis", undef)) { X warn "Can't dbmopen $manroot/whatis: $!\n"; X next; X } X print "$manroot:\n"; X while (($key,$value) = each %manroot) { X for (split(/\002/, $value)) { X if (/\001/) { X ($cmd, $page, $section, $desc) = split(/\001/); X printf "%-30s - %s\n", "$cmd ($section)", $desc; X } else { X printf "%-30s > %s\n", $key, $_; X } X } X } X dbmclose(manroot); X} SHAR_EOF if test 565 -ne "`wc -c < 'catwhatis'`" then echo shar: "error transmitting 'catwhatis'" '(should have been 565 characters)' fi chmod 775 'catwhatis' fi exit 0 # End of shell archive