[Phoenix-pm] Bug#350369: *a=$a=*b; ${"a"}=*a; gets a segmentation fault

Brendan O'Dea bod at debian.org
Sun Feb 26 04:04:56 PST 2006

forwarded 350369 perl5-porters at perl.org

On Sun, Jan 29, 2006 at 09:40:23AM +0000, Neil Turton wrote:
>Package: perl-base
>Version: 5.8.7-10
>Perl shouldn't get a segmentation fault on valid or invalid input.  I
>think the following code is valid, even if it is ghastly.  :)
[snip: see http://bugs.debian.org/350369]

In short, the following segfaults:

  $ perl -e '*a=$a=*b; $a=42'
  Memory fault 

I'm assuming that the problem is a circular assignment within the
expression (since '$a=*b; *a=$a; $a=42' doesn't break).

The simple answer is "don't do that".  This would appear never to have
worked (certainly as far back as 5.005 crashes).


More information about the Phoenix-pm mailing list