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

Null PMC access when calling .new on a subclass with a proto overriding the regular .new in Rakudo #3142

Closed
p6rt opened this issue May 20, 2013 · 7 comments

Comments

@p6rt
Copy link

p6rt commented May 20, 2013

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

Searchable as RT118067$

@p6rt
Copy link
Author

p6rt commented May 20, 2013

From @masak

<dagurval> r​: class A is DateTime { proto method new($) {*} }; A.new
<camelia> rakudo 8d2ec9​: OUTPUT«Not enough positional parameters
passed; got 1 but expected 2␤ in method new [...]»
<dagurval> r​: class A is DateTime { proto method new($) {*} }; A.new(now)
<camelia> rakudo 8d2ec9​: OUTPUT«Null PMC access in get_pmc_keyed()␤
in method new [...]»
<dagurval> that looks like implementation leak though
<gfldex> Null PMC is parroty way to say segfault
<masak> it's basically always wrong, unless you're doing weird MOP stuff.
* masak submits rakudobug
<arnsholt> I'd go so far as saying a Null PMC error is always a bug,
unless you happen to know it's not =)
<masak> r​: class A is Any { proto method new($) {*} }; A.new(now)
<camelia> rakudo 8d2ec9​: OUTPUT«Null PMC access in get_pmc_keyed()␤
in method new [...]»
<masak> ok, not related to DateTime. phew.
<dagurval> :)

@p6rt
Copy link
Author

p6rt commented Oct 16, 2014

From @usev6

Just an update​: There is no longer a Null PMC access error, but Rakudo complains about no matching signature​:

$ perl6-m -e 'class A is Any { proto method new($) {*} }; A.new(now)'
Cannot call 'new'; none of these signatures match​:
  in block <unit> at -e​:1

$ perl6-p -e 'class A is Any { proto method new($) {*} }; A.new(now)'
Cannot call 'new'; none of these signatures match​:
  in any at gen/parrot/BOOTSTRAP.nqp​:1223
  in method new at -e​:1
  in block <unit> at -e​:1

$ perl6-j -e 'class A is Any { proto method new($) {*} }; A.new(now)'
Cannot call 'new'; none of these signatures match​:
  in any at gen/jvm/BOOTSTRAP.nqp​:1216
  in block <unit> at -e​:1

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 16, 2014

From @usev6

Just an update​: There is no longer a Null PMC access error, but Rakudo complains about no matching signature​:

$ perl6-m -e 'class A is Any { proto method new($) {*} }; A.new(now)'
Cannot call 'new'; none of these signatures match​:
  in block <unit> at -e​:1

$ perl6-p -e 'class A is Any { proto method new($) {*} }; A.new(now)'
Cannot call 'new'; none of these signatures match​:
  in any at gen/parrot/BOOTSTRAP.nqp​:1223
  in method new at -e​:1
  in block <unit> at -e​:1

$ perl6-j -e 'class A is Any { proto method new($) {*} }; A.new(now)'
Cannot call 'new'; none of these signatures match​:
  in any at gen/jvm/BOOTSTRAP.nqp​:1216
  in block <unit> at -e​:1

@p6rt
Copy link
Author

p6rt commented Oct 16, 2014

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

@p6rt
Copy link
Author

p6rt commented Oct 16, 2014

From @masak

On Thu Oct 16 00​:10​:27 2014, bartolin@​gmx.de wrote​:

Just an update​: There is no longer a Null PMC access error, but Rakudo
complains about no matching signature​:

$ perl6-m -e 'class A is Any { proto method new($) {*} }; A.new(now)'
Cannot call 'new'; none of these signatures match​:
in block <unit> at -e​:1

$ perl6-p -e 'class A is Any { proto method new($) {*} }; A.new(now)'
Cannot call 'new'; none of these signatures match​:
in any at gen/parrot/BOOTSTRAP.nqp​:1223
in method new at -e​:1
in block <unit> at -e​:1

$ perl6-j -e 'class A is Any { proto method new($) {*} }; A.new(now)'
Cannot call 'new'; none of these signatures match​:
in any at gen/jvm/BOOTSTRAP.nqp​:1216
in block <unit> at -e​:1

First off, resolving ticket because the Null PMC access is gone, and that's what was reported.

Secondly, I think the above behavior is right. The error message comes from correctly finding and dispatching on the declared proto, and then correctly complaining that no declared multi (of which, as it happens, there are none) matches.

@p6rt
Copy link
Author

p6rt commented Oct 16, 2014

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

@p6rt p6rt closed this as completed Oct 16, 2014
@p6rt
Copy link
Author

p6rt commented Oct 16, 2014

From @usev6

I added a test to S32-exceptions/misc.t with the following commit​: Raku/roast@d55c943637

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