Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

when digging into the package namespace of a type capture in Rakudo #3506

Open p6rt opened 10 years ago

p6rt commented 10 years ago

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

Searchable as RT122716$

p6rt commented 10 years ago

From @masak

\ Oooh, I got a segfault! \ https://gist.github.com/Nami-Doc/f0232a94cec52f0ec14c \<- this segfaults here :)

Code inlined for great justice​:

role Zero {   constant count = 0; } role Suc[​::N] {   constant count = 1 + N​::count; }

subset _0 of Zero; subset _1 of Suc[Zero]; subset _2 of Suc[_1]; # and on and on ...

say Suc[Suc[Suc[Zero]]]​::count;

\ there's probably something submittable in there, but it doesn't look golf'd. \ segfault reproduced. golfing. \ ah, thanks :) \< masak> m​: role S[​::N] { N​::x } \ rakudo-moar 4a7429​: OUTPUT«(signal )» * masak submits rakudobug \ m​: sub foo(​::N) { N​::x } \ rakudo-moar 4a7429​: OUTPUT«(signal )» \ masak++ # golfing while I'm having fun \ m​: my (​::N); N​::x * moritz could imagine that masak++ is also having fun \ rakudo-moar 4a7429​: OUTPUT«(signal )» \ definitely having fun :)

It does make sense to :​: into a type capture, as Ven's bigger example shows. But it seems it's done "too soon", and it blows up some sensitive internal bit or other.

p6rt commented 9 years ago

From @usev6

The segfaults are mostly gone. Only on parrot there is a Null PMC Access, but only for two of the four examples. With said two examples there is an (non segfaulting) error on Moar and JVM as well​:

$ perl6 -e 'role S[​::N] { N​::x }' ## no error on Moar, Parrot and JVM

$ perl6 -e 'sub foo(​::N) { N​::x }' ## no error on Moar, Parrot and JVM

$ perl6-m -e 'my (​::N); N​::x' Cannot call method 'at_key' on a null object   in block \ at -e​:1

$ perl6-j -e 'my (​::N); N​::x' Can not call method 'at_key' on a null object   in block \ at -e​:1

$ perl6-p -e 'my (​::N); N​::x' Null PMC access in find_method('at_key')   in block \ at -e​:1

$ cat 122716.pl6 role Zero {   constant count = 0; } role Suc[​::N] {   constant count = 1 + N​::count; } subset _0 of Zero; subset _1 of Suc[Zero]; subset _2 of Suc[_1]; say Suc[Suc[Suc[Zero]]]​::count;

$ perl6-m 122716.pl6 ===SORRY!=== Cannot call method 'at_key' on a null object

$ perl6-j 122716.pl6 ===SORRY!=== Can not call method 'at_key' on a null object

$ perl6-p 122716.pl6 ===SORRY!=== Null PMC access in find_method('at_key')

p6rt commented 9 years ago

From @usev6

The segfaults are mostly gone. Only on parrot there is a Null PMC Access, but only for two of the four examples. With said two examples there is an (non segfaulting) error on Moar and JVM as well​:

$ perl6 -e 'role S[​::N] { N​::x }' ## no error on Moar, Parrot and JVM

$ perl6 -e 'sub foo(​::N) { N​::x }' ## no error on Moar, Parrot and JVM

$ perl6-m -e 'my (​::N); N​::x' Cannot call method 'at_key' on a null object   in block \ at -e​:1

$ perl6-j -e 'my (​::N); N​::x' Can not call method 'at_key' on a null object   in block \ at -e​:1

$ perl6-p -e 'my (​::N); N​::x' Null PMC access in find_method('at_key')   in block \ at -e​:1

$ cat 122716.pl6 role Zero {   constant count = 0; } role Suc[​::N] {   constant count = 1 + N​::count; } subset _0 of Zero; subset _1 of Suc[Zero]; subset _2 of Suc[_1]; say Suc[Suc[Suc[Zero]]]​::count;

$ perl6-m 122716.pl6 ===SORRY!=== Cannot call method 'at_key' on a null object

$ perl6-j 122716.pl6 ===SORRY!=== Can not call method 'at_key' on a null object

$ perl6-p 122716.pl6 ===SORRY!=== Null PMC access in find_method('at_key')

p6rt commented 9 years ago

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

p6rt commented 9 years ago

From @coke

On Sat Jan 24 14​:17​:53 2015, bartolin@​gmx.de wrote​:

The segfaults are mostly gone. Only on parrot there is a Null PMC Access, but only for two of the four examples. With said two examples there is an (non segfaulting) error on Moar and JVM as well​:

$ perl6 -e 'role S[​::N] { N​::x }' ## no error on Moar, Parrot and JVM

$ perl6 -e 'sub foo(​::N) { N​::x }' ## no error on Moar, Parrot and JVM

$ perl6-m -e 'my (​::N); N​::x' Cannot call method 'at_key' on a null object in block \ at -e​:1

$ perl6-j -e 'my (​::N); N​::x' Can not call method 'at_key' on a null object in block \ at -e​:1

$ perl6-p -e 'my (​::N); N​::x' Null PMC access in find_method('at_key') in block \ at -e​:1

$ cat 122716.pl6 role Zero { constant count = 0; } role Suc[​::N] { constant count = 1 + N​::count; } subset _0 of Zero; subset _1 of Suc[Zero]; subset _2 of Suc[_1]; say Suc[Suc[Suc[Zero]]]​::count;

$ perl6-m 122716.pl6 ===SORRY!=== Cannot call method 'at_key' on a null object

$ perl6-j 122716.pl6 ===SORRY!=== Can not call method 'at_key' on a null object

$ perl6-p 122716.pl6 ===SORRY!=== Null PMC access in find_method('at_key')

With the segfaults gone, this bug report is closable. (For extra points, try to make sure that the failure mode is correct, but that's not mandatory to close the ticket.)

-- Will "Coke" Coleda