[comp.lang.perl] Perl on Motorola M88k's

clewis@ferret.ocunix.on.ca (Chris Lewis) (02/09/91)

I installed Perl (PL18 - stable but old) onto a Motorola 8864 88000 RISC
box.  Greenhills C.  It hangs when doing some moderately simple things.
Such as:
	$list = `ls directory`;
	@L = split($list);
	print $L[0];

L[0], as printed, isn't a file name in the directory, and perl
sits chewing cpu.  It does this both with and without -O.  With
Perl's malloc it simply dumps core.

It is an quite an old patch level, what I'm really asking is
for those people using Perl on 88k's, especially heavy use, to
drop me a line letting me know what patch level you're at, what
problems you've encountered, and if you had to do anything special
to get it to work.

Thanks

lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) (02/12/91)

In article <1314@ecicrl.ocunix.on.ca> clewis@ferret.ocunix.on.ca (Chris Lewis) writes:
: I installed Perl (PL18 - stable but old) onto a Motorola 8864 88000 RISC
: box.  Greenhills C.  It hangs when doing some moderately simple things.
: Such as:
: 	$list = `ls directory`;
: 	@L = split($list);
: 	print $L[0];

Er, that may be moderately simple, but it's also simply wrong.  The first
argument to split is a pattern to split on.  You're trying to split $_
using $list as a delimiter.

Earlier version of perl do unexpected things when you do unexpected things.
It's getting better, but feeding random stuff to the regular expression
parser is bound to do interesting things.  In this particular case,
patchlevel 18 has a known problem with patterns containing more than 255
constant characters in a row.

Larry

clewis@ferret.ocunix.on.ca (Chris Lewis) (02/14/91)

In article <11389@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes:
>In article <1314@ecicrl.ocunix.on.ca> clewis@ferret.ocunix.on.ca (Chris Lewis) writes:
>: I installed Perl (PL18 - stable but old) onto a Motorola 8864 88000 RISC
>: box.  Greenhills C.  It hangs when doing some moderately simple things.
>: Such as:
>: 	$list = `ls directory`;
>: 	@L = split($list);
>: 	print $L[0];

>Er, that may be moderately simple, but it's also simply wrong.  The first
>argument to split is a pattern to split on.  You're trying to split $_
>using $list as a delimiter.

Sorry.  This is what comes of trying to reproduce the code from memory for
a posting.  Obviously I remembered it wrong.  (This code has been in our
software since mid-level patches of Perl 2.0, and it does work on all of the
other platforms (ie: 386/ix, RS/6000, 3b1(!)).  The m88k seems, well, a bit
rough around the edges in the compiler department.  What do you expect from a
compiler that emits two lines of copyright notices every time you invoke it?)

Anyhow, I have patched the perl on the m88k up to PL44.  I get the
following message from perl:
	panic: corrupt saved stack index at handlers/chkfiles line 113.

handlers/chkfiles is a chunk of perl script, executed thusly:

	$handler = "handlers/chkfiles";
	do $handler;

Here's a chunk of handlers/chkfiles around line 113 (not from memory this
time :-}):

	if ($ctype eq 'SL') {
	    if ($crest) {
		$fullname = do symexpand($crest, $citem);
		$symlinks{$fullname} .= "$citem ";
	    } else {
		$unklinks .= "$citem ";
	    }
	    next;
	}
	    
	if ($ctype eq 'D') { 
	    if ($crest =~ 'forms a directory loop' && $dirloopokay{$citem}) {
		next;
	    }
	    push(direrr, "$citem\\$crest\\$caux");
	    next;
	}
->	if ($ctype eq 'G') { push(grouperr, "$citem\\$crest\\$caux"); next; }
	if ($ctype eq 'F') { push(fileerr, "$citem\\$crest\\$caux"); next; }
	if ($ctype eq 'S') {
	    push(tURGENT, "Severe chkfiles problem: $citem $crest $caux");
	    next;
	}
	do ersaerror("Unknown chkfiles record: $line\n");

"->" points to line 113.

This is with optimization on, both with and without the malloc that comes
with perl.  I'll be futzing around with the optimizer and other flags
tomorrow when I go beat on it again.  When I commented out handlers/chkfiles,
perl went on a memory allocation binge and was killed at 2K clicks...
(on other platforms, 600 clicks is what it usually takes to run this
code - this is a small part of several thousand lines of perl).
There seems to have been several unofficial patches go by for PL44, but
didn't save them, - would any of those help?  Configure also said that
this compiler was capable of casting "wierd floats to unsigned long"
if that is suggestive of anything.

Oh, and yes, regression testing: fails op.stat test 34 (thinks "."
is a block special!), and lib.big test 62.  I explored the op.stat
problem, and it must be a compiler bug, or there's something severely
wrong with the O/S... I tested "if (-c" and that does work properly.
Will be further exploring tomorrow.

If anyone out there has perl on a Motorola m88k, *please* let me know of your
experiences.  The compiler is V3.2, level 2 (supposedly the latest)

Thanks,
-- 
Chris Lewis, Phone: (613) 832-0541, Internet: clewis@ferret.ocunix.on.ca
UUCP: uunet!mitel!cunews!latour!ecicrl!clewis; Ferret Mailing List:
(ferret-request@eci386); Psroff (not Adobe Transcript) enquiries:
psroff-request@eci386, current patchlevel is *7*.