[comp.lang.perl] perl 3.0 pl 12

dan@kfw.COM (Dan Mick) (03/07/90)

The summary pretty much says it; perl 3.0 pl12 is dumping core on trying
to debug Tom Christiansen's makewhatis.pl, posted recently.  I've narrowed
it down to the point in cons.c:make_sub(), line 78; at that point, 
cmd->c_next is NULL, so of course the assignment to cmd->c_next->c_flags is
not very copacetic.  I have not been able to determine the cause yet; I'm
remaking with LEAKTEST on.

This seems to be at the point just after the last subroutine in the target
perl program is read (i.e., on the make_sub() call for the last sub in
makewhatis.pl, which is extract_names); not sure if that will help.

tneff@bfmny0.UU.NET (Tom Neff) (03/08/90)

I also have problems using 'perl -d' on some large scripts.
'Bus error - core dumped' is typical.  I don't have time to
track this down right now!  But it exists.  V/386 3.2, PL12.

lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) (03/08/90)

In article <1990Mar7.032442.2312@kfw.COM> dan@charyb.UUCP (Dan Mick) writes:
: The summary pretty much says it; perl 3.0 pl12 is dumping core on trying
: to debug Tom Christiansen's makewhatis.pl, posted recently.  I've narrowed
: it down to the point in cons.c:make_sub(), line 78; at that point, 
: cmd->c_next is NULL, so of course the assignment to cmd->c_next->c_flags is
: not very copacetic.  I have not been able to determine the cause yet; I'm
: remaking with LEAKTEST on.
: 
: This seems to be at the point just after the last subroutine in the target
: perl program is read (i.e., on the make_sub() call for the last sub in
: makewhatis.pl, which is extract_names); not sure if that will help.

The conditional based on perldb is bogus there--it should always use
cmd->c_flags.  Will be fixed in patch 13.

Which won't take as long as patch 9.

Larry

dan@kfw.COM (Dan Mick) (03/08/90)

I've discovered that it's almost always the case that cmd->c_next is null
at that point (line 78 in cons.c), as cons.c:75 calls make_ccmd(), which 
calls dodb(), which calls append_line(), which looks like it adds to the
end of the list without setting c_next.  I don't know whether or not 
c_next should be set to the head of the list or what, but if I change
line 77 in cons.c from

if (perldb)

to

if (perldb && cmd->c_next)

I can actually get into the debugger.

The odd thing is, it seems this happens on *any* perl script that has a
return in a subroutine...it doesn't seem to be affected by machine-dependent
options.

Larry?

tchrist@convex.COM (Tom Christiansen) (03/08/90)

Yup, it's true, although I don't know why.  I've sent the results
to Larry.  This actually happens on other scripts of mine as 
well, like cfman.  I'm using the backup version for perl -d.
The programs run fine with pl 12; only perl -d complains.

If anyone is interested, I have newer versions of man and makewhatis
that work with HP systems and their man1.Z directories.  They also
work with multi-character man sections like man1m on HPs.  Makewhatis
checks for linked files it's already seen, and between this and the 
cross-referencing, it should save HP users a lot of disk space.
There are other nice features as well, including handling compressed man pages.

This has been tested on Suns, HPs, and more conventional BSD systems.  If
anyone wants a pre-release copy before it goes to comp.sources.misc, mail
me.  If you don't know what I'm talking about, I've rewritten man and
makewhatis to use dbm files for the whatis databases in $MANPATH keyed on
all the aliases in the NAME sections, obviating the need for links or .so
includes.  I'm not going to post it again until I am done with the entire suite, 
which should include man pages for the following:

	man(1)     	-- explains how this man works
	whatis(5)	-- explains whatis format, including whatis.{pag,dir}
	catman(8)	-- can also compress 
	makewhatis(8)   -- much faster/more correct version of makewhatis

Beta testers welcome.

--tom
--

    Tom Christiansen                       {uunet,uiucdcs,sun}!convex!tchrist 
    Convex Computer Corporation                            tchrist@convex.COM
		 "EMACS belongs in <sys/errno.h>: Editor too big!"

chris@utgard.uucp (Chris Anderson) (03/10/90)

In article <15238@bfmny0.UU.NET> tneff@bfmny0.UU.NET (Tom Neff) writes:
>I also have problems using 'perl d' on some large scripts.
>'Bus error  core dumped' is typical.  I don't have time to
>track this down right now!  But it exists.  V/386 3.2, PL12.

Me too.  Although the error is "Bus error".
Pyramid 9825 OSx 4.4c.  These scripts debug fine
under PL8.


-- 
| Chris Anderson  						       |
| QMA, Inc.		        email : {csusac,sactoh0}!utgard!chris  |
|----------------------------------------------------------------------|
| My employer never listens to me, so why should he care what I say?   |