[comp.lang.perl] perl crashes in package/eval/reset combination

henkp@ruuinf.cs.ruu.nl (Henk P. Penning) (12/19/90)

The following program crashes Perl on:
Hewlett-Packard 9000/300 running HP/UX 7.0, Harris HCX-9.

This is perl, version 3.0
$Header: perly.c,v 3.0.1.9 90/11/10 01:53:26 lwall Locked $
Patch level: 41
---------------------------------------------
sub pr_eval
  { print STDERR "to eval: $_[0]\n" ;
    eval $_[0] ;
  }

$i++ ;

&pr_eval('package AAP ; $x++ ;') ;
&pr_eval('package AAP ; reset("a-z") ;') ;
&pr_eval('package AAP ; $x++ ;') ;
&pr_eval('package AAP ; reset("a-z") ;') ;
---------------------------------------------
On the HPs, the problem goes away if 
-- $i++ is removed, or
-- print STDERR "to eval: $_[0]\n" is removed, or
-- the last two lines are removed.
On the HCX, perl crashes on the last two lines alone.

I need this feature in Jinx. Users type in expressions which must be
evaluated in a separate, partially reset context (package).

How do other machines behave ?
Suggestions for a work-around ?

Thanks a lot			===  HenkP ===

-- 
Henk P. Penning, Dept of Computer Science, Utrecht University.
Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands.
Telephone: +31-30-534106
e-mail   : henkp@cs.ruu.nl (uucp to hp4nl!ruuinf!henkp)

arielf@tasu8c.UUCP (Ariel Faigon) (12/20/90)

+-- henkp@ruuinf.cs.ruu.nl writes:
| The following program crashes Perl on:
| Hewlett-Packard 9000/300 running HP/UX 7.0, Harris HCX-9.

Your example works fine on my Sun 3/60, SunOs 4.1
in patchlevel 40 but crashes (SEGV) in patchlevel 41
I run Perl fully optimized with perl's malloc.

Doesn't help much, I know...

Peace,
---
Ariel Faigon, FAX group, NSTA
National Semiconductor (Israel)
6 Maskit st.  P.O.B. 3007, Herzlia 46104, Israel   Tel. (972)52-522272
arielf@taux01.nsc.com   @{hplabs,pyramid,sun,decwrl} 34 48 E / 32 10 N