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

error message: wrong class reported in non-existent attribute error in Rakudo #2879

Closed
p6rt opened this issue Aug 30, 2012 · 8 comments
Closed

error message: wrong class reported in non-existent attribute error in Rakudo #2879

p6rt opened this issue Aug 30, 2012 · 8 comments

Comments

@p6rt
Copy link

@p6rt p6rt commented Aug 30, 2012

Migrated from rt.perl.org#114672 (status was 'resolved')

Searchable as RT114672$

@p6rt
Copy link
Author

@p6rt p6rt commented Aug 30, 2012

From @masak

<masak> rn​: class A {}; class B is A { has $!x = 5; our method foo(A​:)
{ say $!x } }; &B​::foo(A.new)
<p6eval> rakudo d70363​: OUTPUT«Can not get non-existent attribute
'$!x' on class 'B'␤ in method foo [...]
<p6eval> ..niecza v21-1-ga8aa70b​: OUTPUT«Unhandled exception​:
Attribute $!x not defined in A or any superclass [...]
* masak submits LTA error message rakudobug

The attribute *does* exist on class 'B', but Rakudo seems to think
that's where it didn't find it, rather than on class 'A'.

@p6rt
Copy link
Author

@p6rt p6rt commented Jan 25, 2015

From @usev6

This now gives a segfault on Moar and Parrot and an internal error on JVM​:

debian7$ perl6-m --version # same rakudo version for perl6-p and perl6-j
This is perl6 version 2015.01-6-g25da7a9 built on MoarVM version 2015.01-5-ga29eaa9

debian7$ perl6-m -e 'class A {}; class B is A { has $!x = 5; our method foo(A​:) { say $!x } }; &B​::foo(A.new)'
Segmentation fault

debian7$ perl6-p -e 'class A {}; class B is A { has $!x = 5; our method foo(A​:) { say $!x } }; &B​::foo(A.new)'
Segmentation fault

debian7$ perl6-j -e 'class A {}; class B is A { has $!x = 5; our method foo(A​:) { say $!x } }; &B​::foo(A.new)'
P6opaque representation does not support attributes
  in method foo at -e​:1
  in block <unit> at -e​:1

The segfault seems to happen while saying $!x -- if I remove that the code runs fine​:

debian7$ perl6-m -e 'class A {}; class B is A { has $!x = 5; our method foo(A​:) { say "alive" } }; &B​::foo(A.new)'
alive

The above happens on Debian 7 (64 bit).

Interestingly on FreeBSD 10.1 (64 bit) there is no segfault with Parrot (Moar and JVM behave as on Debian)​:

freebsd10.1$ perl6-p -e 'class A {}; class B is A { has $!x = 5; our method foo(A​:) { say $!x } }; &B​::foo(A.new)'
No such method 'gist' for invocant of type 'NQPMu'
  in sub say at gen/parrot/CORE.setting​:16823
  in sub say at gen/parrot/CORE.setting​:16815
  in method foo at -e​:1
  in block <unit> at -e​:1

freebsd10.1$ perl6-p --version
This is perl6 version 2015.01-7-gf120204 built on parrot 7.0.1 revision RELEASE_7_0_1

The Rakudo version is a few commits newer than in the first examples, but I don't think that is relevant, since on Debian even the latest Rakudo on Parrot segfaults​:

debian7$ perl6-p -e 'class A {}; class B is A { has $!x = 5; our method foo(A​:) { say $!x } }; &B​::foo(A.new)'
Segmentation fault

debian7$ perl6-p --version
This is perl6 version 2015.01-10-g5dd603b built on parrot 7.0.1 revision RELEASE_7_0_1

1 similar comment
@p6rt
Copy link
Author

@p6rt p6rt commented Jan 25, 2015

From @usev6

This now gives a segfault on Moar and Parrot and an internal error on JVM​:

debian7$ perl6-m --version # same rakudo version for perl6-p and perl6-j
This is perl6 version 2015.01-6-g25da7a9 built on MoarVM version 2015.01-5-ga29eaa9

debian7$ perl6-m -e 'class A {}; class B is A { has $!x = 5; our method foo(A​:) { say $!x } }; &B​::foo(A.new)'
Segmentation fault

debian7$ perl6-p -e 'class A {}; class B is A { has $!x = 5; our method foo(A​:) { say $!x } }; &B​::foo(A.new)'
Segmentation fault

debian7$ perl6-j -e 'class A {}; class B is A { has $!x = 5; our method foo(A​:) { say $!x } }; &B​::foo(A.new)'
P6opaque representation does not support attributes
  in method foo at -e​:1
  in block <unit> at -e​:1

The segfault seems to happen while saying $!x -- if I remove that the code runs fine​:

debian7$ perl6-m -e 'class A {}; class B is A { has $!x = 5; our method foo(A​:) { say "alive" } }; &B​::foo(A.new)'
alive

The above happens on Debian 7 (64 bit).

Interestingly on FreeBSD 10.1 (64 bit) there is no segfault with Parrot (Moar and JVM behave as on Debian)​:

freebsd10.1$ perl6-p -e 'class A {}; class B is A { has $!x = 5; our method foo(A​:) { say $!x } }; &B​::foo(A.new)'
No such method 'gist' for invocant of type 'NQPMu'
  in sub say at gen/parrot/CORE.setting​:16823
  in sub say at gen/parrot/CORE.setting​:16815
  in method foo at -e​:1
  in block <unit> at -e​:1

freebsd10.1$ perl6-p --version
This is perl6 version 2015.01-7-gf120204 built on parrot 7.0.1 revision RELEASE_7_0_1

The Rakudo version is a few commits newer than in the first examples, but I don't think that is relevant, since on Debian even the latest Rakudo on Parrot segfaults​:

debian7$ perl6-p -e 'class A {}; class B is A { has $!x = 5; our method foo(A​:) { say $!x } }; &B​::foo(A.new)'
Segmentation fault

debian7$ perl6-p --version
This is perl6 version 2015.01-10-g5dd603b built on parrot 7.0.1 revision RELEASE_7_0_1

@p6rt
Copy link
Author

@p6rt p6rt commented Jan 25, 2015

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

@p6rt p6rt commented Apr 7, 2016

From @diakopter

Moar still segfaults​:

13​:35 <diakopter> m​: class A {}; class B is A { has $!x = 5; our method foo(A​:) { say $!x } }; &B​::foo(A.new)
13​:36 <camelia> rakudo-moar 61d231​: OUTPUT«(signal SEGV)»

@p6rt
Copy link
Author

@p6rt p6rt commented Sep 2, 2016

From @zoffixznet

Fixed by timotimo in MoarVM as per http://irclog.perlgeek.de/perl6-dev/2016-09-02#i_13139713

Tests needed

@p6rt
Copy link
Author

@p6rt p6rt commented Sep 11, 2016

From @zoffixznet

Tests added in Raku/roast@3815be036a

@p6rt p6rt closed this as completed Sep 11, 2016
@p6rt
Copy link
Author

@p6rt p6rt commented Sep 11, 2016

@zoffixznet - Status changed from 'open' to 'resolved'

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

No branches or pull requests

1 participant