develooper Front page | perl.perl5.porters | Postings from February 2006

Re: Bug#350369: *a=$a=*b;${"a"}=*a; gets a segmentation fault

Thread Next
From:
Brendan O'Dea
Date:
February 26, 2006 04:05
Subject:
Re: Bug#350369: *a=$a=*b;${"a"}=*a; gets a segmentation fault
Message ID:
20060226120456.GB18947@londo.c47.org
forwarded 350369 perl5-porters@perl.org
thanks

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).

--bod

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About