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 involving reverse causality when calling a method with s/// syntax in it in Rakudo #1963

Closed
p6rt opened this issue Jul 22, 2010 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Jul 22, 2010

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

Searchable as RT76664$

@p6rt
Copy link
Author

p6rt commented Jul 22, 2010

From @masak

<masak> rakudo​: class A { method pack($_) { s/c// }};
A.new.pack("ccc") # discovered by cono++
<p6eval> rakudo 220b67​: OUTPUT«Null PMC access in find_method('new') [...]
* masak submits rakudobug

Remove the s/c//, and everything works. Remove .pack("ccc"), and
everything works. How is it that the .pack call participates in
causing an error related to finding .new ?

@p6rt
Copy link
Author

p6rt commented Jul 28, 2010

From @coke

On Thu Jul 22 09​:58​:56 2010, masak wrote​:

<masak> rakudo​: class A { method pack($_) { s/c// }};
A.new.pack("ccc") # discovered by cono++
<p6eval> rakudo 220b67​: OUTPUT«Null PMC access in find_method('new') [...]
* masak submits rakudobug

Remove the s/c//, and everything works. Remove .pack("ccc"), and
everything works. How is it that the .pack call participates in
causing an error related to finding .new ?

21​:44 < [Coke]> rakudo​: class A { method pack($_) { s/c// }}; A.new.pack("ccc")
  # discovered by cono++
21​:44 <+p6eval> rakudo 7f5c22​: OUTPUT«Cannot modify readonly value␤ in
  '&infix​:<=>' at line 1␤ in 'A​::pack' at line
  22​:/tmp/HIyuNvbnYe␤ in main program body at line
  22​:/tmp/HIyuNvbnYe␤»

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jul 28, 2010

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

@p6rt
Copy link
Author

p6rt commented Oct 10, 2011

From @coke

On Tue Jul 27 18​:45​:07 2010, coke wrote​:

On Thu Jul 22 09​:58​:56 2010, masak wrote​:

<masak> rakudo​: class A { method pack($_) { s/c// }};
A.new.pack("ccc") # discovered by cono++
<p6eval> rakudo 220b67​: OUTPUT«Null PMC access in find_method('new')
[...]
* masak submits rakudobug

Remove the s/c//, and everything works. Remove .pack("ccc"), and
everything works. How is it that the .pack call participates in
causing an error related to finding .new ?

21​:44 < [Coke]> rakudo​: class A { method pack($_) { s/c// }};
A.new.pack("ccc")
# discovered by cono++
21​:44 <+p6eval> rakudo 7f5c22​: OUTPUT«Cannot modify readonly value␤
in
'&infix​:<=>' at line 1␤ in 'A​::pack' at line
22​:/tmp/HIyuNvbnYe␤ in main program body at line
22​:/tmp/HIyuNvbnYe␤»

Pretty much unchanged. Is this closable with tests now?

19​:37 < [Coke]> rakudo​: class A { method pack($_) { s/c// }}; A.new.pack("ccc")
19​:37 <+p6eval> rakudo 38907e​: OUTPUT«Cannot assign to a readonly variable or a
  value␤ in sub infix​:<=> at src/gen/CORE.setting​:7361␤ in
  method pack at /tmp/5h1grLXx6g​:1␤ in block <anon> at
  /tmp/5h1grLXx6g​:1␤ in <anon> at /tmp/5h1grLXx6g​:1␤»

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 11, 2011

From @masak

On Mon Oct 10 16​:38​:39 2011, coke wrote​:

On Tue Jul 27 18​:45​:07 2010, coke wrote​:

On Thu Jul 22 09​:58​:56 2010, masak wrote​:

<masak> rakudo​: class A { method pack($_) { s/c// }};
A.new.pack("ccc") # discovered by cono++
<p6eval> rakudo 220b67​: OUTPUT«Null PMC access in
find_method('new')
[...]
* masak submits rakudobug

Remove the s/c//, and everything works. Remove .pack("ccc"), and
everything works. How is it that the .pack call participates in
causing an error related to finding .new ?

21​:44 < [Coke]> rakudo​: class A { method pack($_) { s/c// }};
A.new.pack("ccc")
# discovered by cono++
21​:44 <+p6eval> rakudo 7f5c22​: OUTPUT«Cannot modify readonly value␤
in
'&infix​:<=>' at line 1␤ in 'A​::pack' at line
22​:/tmp/HIyuNvbnYe␤ in main program body at line
22​:/tmp/HIyuNvbnYe␤»

Pretty much unchanged. Is this closable with tests now?

19​:37 < [Coke]> rakudo​: class A { method pack($_) { s/c// }};
A.new.pack("ccc")
19​:37 <+p6eval> rakudo 38907e​: OUTPUT«Cannot assign to a readonly
variable or a
value␤ in sub infix​:<=> at src/gen/CORE.setting​:7361␤
in
method pack at /tmp/5h1grLXx6g​:1␤ in block <anon> at
/tmp/5h1grLXx6g​:1␤ in <anon> at /tmp/5h1grLXx6g​:1␤»

It doesn't Null PMC Access any more, so I'm happy. Leaving open in case
someone decides it needs tests, too.

@p6rt
Copy link
Author

p6rt commented Oct 20, 2011

From @moritz

fwiw the error is correct, because $_ is read-only (because it's a
parameter, and because "ccc" is a literal, and as such immutable).

Tested in subst.t

@p6rt
Copy link
Author

p6rt commented Oct 20, 2011

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

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