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

Bogus array subsignature in declaration my ([$a]); binds variable to VMNull #4840

Open
p6rt opened this issue Dec 9, 2015 · 5 comments
Open
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 9, 2015

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

Searchable as RT126857$

@p6rt
Copy link
Author

p6rt commented Dec 9, 2015

From @AlexDaniel

Code​:
my ([$a]); $a.WHAT

Result​:
Segmentation fault

This was found by _nadim (
http://irclog.perlgeek.de/perl6/2015-12-09#i_11685717)

It is interesting that someone stumbled upon it.

So! We can make it mention “null object” like this​:
my ([$a]); $a.say

Result​:
Cannot call method 'say' on a null object
  in block <unit> at ./test3.pl​:2

Though it kinda works if you just “say” it​:
my ([$a]); say $a

Result​:
(Mu)

I am not sure what this code should produce. But at least it should not
segfault, that's for sure.

@p6rt
Copy link
Author

p6rt commented Mar 12, 2016

From @moritz

On Wed Dec 09 09​:52​:15 2015, alex.jakimenko@​gmail.com wrote​:

Code​:
my ([$a]); $a.WHAT

Result​:
Segmentation fault

This was found by _nadim (
http://irclog.perlgeek.de/perl6/2015-12-09#i_11685717)

It is interesting that someone stumbled upon it.

So! We can make it mention “null object” like this​:
my ([$a]); $a.say

Result​:
Cannot call method 'say' on a null object
in block <unit> at ./test3.pl​:2

Though it kinda works if you just “say” it​:
my ([$a]); say $a

Result​:
(Mu)

Valgrind output​:

==28589== Invalid read of size 8
==28589== at 0x4F98777​: MVM_interp_run (in /home/moritz/p6/rakudo/install/lib/libmoar.so)
==28589== by 0x5049318​: MVM_vm_run_file (in /home/moritz/p6/rakudo/install/lib/libmoar.so)
==28589== by 0x400FBE​: main (in /home/moritz/p6/rakudo/install/bin/moar)
==28589== Address 0x10 is not stack'd, malloc'd or (recently) free'd

Looks like a null-pointer dereference to me. No idea where it's coming from though.

@p6rt
Copy link
Author

p6rt commented May 11, 2016

From @smls

Similarly to ticket #​127254, this does not segfault for me on an upt-to-date Rakduo Moar.

Here's what it prints​:

  my ([$a]);
  say $a.WHAT; # (Mu)
  say $a.^name; # VMNull
  say $a.gist; # Cannot call method 'gist' on a null object

Please check if you can still reproduce the crash after updating Rakudo.

@p6rt
Copy link
Author

p6rt commented May 11, 2016

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

@p6rt
Copy link
Author

p6rt commented Oct 11, 2017

From @AlexDaniel

Well, the crash is no longer there, but it shouldn't be a VMNull.

This problem was observed again today in this discussion​: http://colabti.org/irclogger/irclogger_log/perl6?date=2017-10-11#l104

On 2016-05-11 05​:05​:20, smls75@​gmail.com wrote​:

Similarly to ticket #​127254, this does not segfault for me on an upt-
to-date Rakduo Moar.

Here's what it prints​:

my ([$a]);
say $a.WHAT; # (Mu)
say $a.^name; # VMNull
say $a.gist; # Cannot call method 'gist' on a null object

Please check if you can still reproduce the crash after updating
Rakudo.

@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