Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive binding my $x := (my $y := $x) binds variable to VMNull #5045

Open
p6rt opened this issue Jan 12, 2016 · 5 comments
Open

Recursive binding my $x := (my $y := $x) binds variable to VMNull #5045

p6rt opened this issue Jan 12, 2016 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jan 12, 2016

Migrated from rt.perl.org#127254 (status was 'open')

Searchable as RT127254$

@p6rt
Copy link
Author

p6rt commented Jan 12, 2016

From @AlexDaniel

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.

@p6rt
Copy link
Author

p6rt commented Jan 13, 2016

From @nwc10

Thanks for the report.

On Tue, Jan 12, 2016 at 02​:29​:46PM -0800, Alex Jakimenko wrote​:

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

@p6rt
Copy link
Author

p6rt commented Jan 13, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented May 11, 2016

From @smls

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

@p6rt
Copy link
Author

p6rt commented Feb 16, 2017

From @AlexDaniel

Well, bisectable says that rakudo/rakudo@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​:

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

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant