Skip Menu |
Report information
Id: 127254
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: alex.jakimenko [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: Segmentation fault on recursive binding (my $x := (my $y := $x))
Date: Wed, 13 Jan 2016 00:29:31 +0200
From: Aleks-Daniel Jakimenko-Aleksejev <alex.jakimenko [...] gmail.com>
To: rakudobug [...] perl.org
Download (untitled) / with headers
text/plain 400b
Code:
my $x := (my $y := $x);
say $x.WHAT;

Result:
Segmentation fault


Code:
my $x := (my $y := $x);
say $y.WHAT; # same for $y

Result:
Segmentation fault


Code:
my $x := (my $y := $x);
say $x.^methods;

Result:
Segmentation fault


Code:
my $x := (my $y := $x);
say $x.blah;

Result:
Cannot call method 'blah' on a null object
  in block <unit> at ./test.p6 line 3


So it's just a null object.
To: perl6-compiler [...] perl.org
From: Nicholas Clark <nick [...] ccl4.org>
Date: Wed, 13 Jan 2016 11:51:52 +0000
Subject: Re: [perl #127254] Segmentation fault on recursive binding (my $x := (my $y := $x))
Download (untitled) / with headers
text/plain 500b
Thanks for the report. On Tue, Jan 12, 2016 at 02:29:46PM -0800, Alex Jakimenko wrote: Show quoted text
> Code: > my $x := (my $y := $x); > say $x.WHAT; > > Result: > Segmentation fault > > > Code: > my $x := (my $y := $x); > say $y.WHAT; # same for $y > > Result: > Segmentation fault > > > Code: > my $x := (my $y := $x); > say $x.^methods; > > Result: > Segmentation fault
ASAN shows that all of these are "just" NULL pointer dereferences. No (other) undefined behaviour at the C level. Nicholas Clark
Download (untitled) / with headers
text/plain 529b
None of those segfault for me with an up-to-date Rakudo Moar on 64-bit Linux. Here's what they print: my $x := (my $y := $x); say $x.WHAT; # (Mu) say $y.WHAT; # (Mu) say $x.^name; # VMNull say $x.^methods; # {} say $x.blah; # Cannot call method 'blah' on a null object (Which is still a bug, of course, but better than a crash.) Please update your Rakudo, and check if you can still reproduce the segfaults. If so, please state your operating system and output of `perl6 --version`.
Well, bisectable says that https://github.com/rakudo/rakudo/commit/ae2ae92330 is the fix to this issue.

So yes, it doesn't segfault anymore, that's correct.

On 2016-05-11 04:55:02, smls75@gmail.com wrote:
Show quoted text
> None of those segfault for me with an up-to-date Rakudo Moar on 64-bit
> Linux.
> Here's what they print:
>
> my $x := (my $y := $x);
> say $x.WHAT; # (Mu)
> say $y.WHAT; # (Mu)
> say $x.^name; # VMNull
> say $x.^methods; # {}
> say $x.blah; # Cannot call method 'blah' on a null object
>
> (Which is still a bug, of course, but better than a crash.)
>
> Please update your Rakudo, and check if you can still reproduce the
> segfaults.
> If so, please state your operating system and output of `perl6
> --version`.




This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org