Skip Menu |
Report information
Id: 122896
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: raydiak [at] cyberuniverses.com
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] 'is cached' routines break when precompiled
To: rakudobug [...] perl.org
Date: Sat, 4 Oct 2014 00:41:05 +0000
From: raydiak [...] cyberuniverses.com
Download (untitled) / with headers
text/plain 398b
Create a module M containing "module M { sub f () is cached is export { } }". When precompiled, the following error occurs when f() is called: Cannot invoke null object in block at src/gen/m-CORE.setting:3604 in any enter at src/gen/m-Metamodel.nqp:3110 in method invoke at src/gen/m-CORE.setting:3548 This is perl6 version 2014.09-81-g89abcf2 built on MoarVM version 2014.09-12-gb9e24ee
Download (untitled) / with headers
text/plain 570b
Test case has been added to S10-packages/precompilation.t. Fudged for jvm and moar. On Fri Oct 03 17:41:15 2014, raydiak@cyberuniverses.com wrote: Show quoted text
> Create a module M containing "module M { sub f () is cached is export > { } }". When precompiled, the following error occurs when f() is > called: > > Cannot invoke null object > in block at src/gen/m-CORE.setting:3604 > in any enter at src/gen/m-Metamodel.nqp:3110 > in method invoke at src/gen/m-CORE.setting:3548 > > This is perl6 version 2014.09-81-g89abcf2 built on MoarVM version > 2014.09-12-gb9e24ee
Subject: Re: [perl #122896] [BUG] 'is cached' routines break when precompiled
To: "(via RT)" <perl6-bugs-followup [...] perl.org>
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
Date: Thu, 8 Jan 2015 10:14:34 +0100
Download (untitled) / with headers
text/plain 948b
Show quoted text
> On 04 Oct 2014, at 02:41, (via RT) <perl6-bugs-followup@perl.org> wrote: > > # New Ticket Created by > # Please include the string: [perl #122896] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=122896 > > > > Create a module M containing "module M { sub f () is cached is export { } }". When precompiled, the following error occurs when f() is called: > > Cannot invoke null object > in block at src/gen/m-CORE.setting:3604 > in any enter at src/gen/m-Metamodel.nqp:3110 > in method invoke at src/gen/m-CORE.setting:3548 > > This is perl6 version 2014.09-81-g89abcf2 built on MoarVM version 2014.09-12-gb9e24ee
At least on OS X, this has now changed to a segfault on Moar, easily reproducible thus: $ perl6 -e 'CompUnit.new("t/spec/packages/Example/C.pm").precomp’ $ perl6 -It/spec/packages -e ‘use Example::C; f()’ Segmentation fault: 11 Liz
Subject: Re: [perl #122896] [BUG] 'is cached' routines break when precompiled
To: Elizabeth Mattijsen <liz [...] dijkmat.nl>
From: Bart Wiegmans <bartwiegmans [...] gmail.com>
CC: "(via RT)" <perl6-bugs-followup [...] perl.org>
Date: Thu, 8 Jan 2015 10:16:57 +0100
Which backend is that? I'm assuming moar.

2015-01-08 10:14 GMT+01:00 Elizabeth Mattijsen <liz@dijkmat.nl>:
Show quoted text
> On 04 Oct 2014, at 02:41, (via RT) <perl6-bugs-followup@perl.org> wrote:
>
> # New Ticket Created by
> # Please include the string:  [perl #122896]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org/Ticket/Display.html?id=122896 >
>
>
> Create a module M containing "module M { sub f () is cached is export { } }".  When precompiled, the following error occurs when f() is called:
>
> Cannot invoke null object
>  in block  at src/gen/m-CORE.setting:3604
>  in any enter at src/gen/m-Metamodel.nqp:3110
>  in method invoke at src/gen/m-CORE.setting:3548
>
> This is perl6 version 2014.09-81-g89abcf2 built on MoarVM version 2014.09-12-gb9e24ee

At least on OS X, this has now changed to a segfault on Moar, easily reproducible thus:

$ perl6 -e 'CompUnit.new("t/spec/packages/Example/C.pm").precomp’
$ perl6 -It/spec/packages -e ‘use Example::C; f()’
Segmentation fault: 11



Liz

Date: Thu, 8 Jan 2015 10:24:57 +0100
Subject: Re: [perl #122896] [BUG] 'is cached' routines break when precompiled
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
To: "(via RT)" <perl6-bugs-followup [...] perl.org>
Download (untitled) / with headers
text/plain 1.1k
Moar :-) Show quoted text
> On 08 Jan 2015, at 10:16, Bart Wiegmans <bartwiegmans@gmail.com> wrote: > > Which backend is that? I'm assuming moar. > > 2015-01-08 10:14 GMT+01:00 Elizabeth Mattijsen <liz@dijkmat.nl>:
> > On 04 Oct 2014, at 02:41, (via RT) <perl6-bugs-followup@perl.org> wrote: > > > > # New Ticket Created by > > # Please include the string: [perl #122896] > > # in the subject line of all future correspondence about this issue. > > # <URL: https://rt.perl.org/Ticket/Display.html?id=122896 > > > > > > > Create a module M containing "module M { sub f () is cached is export { } }". When precompiled, the following error occurs when f() is called: > > > > Cannot invoke null object > > in block at src/gen/m-CORE.setting:3604 > > in any enter at src/gen/m-Metamodel.nqp:3110 > > in method invoke at src/gen/m-CORE.setting:3548 > > > > This is perl6 version 2014.09-81-g89abcf2 built on MoarVM version 2014.09-12-gb9e24ee
> > At least on OS X, this has now changed to a segfault on Moar, easily reproducible thus: > > $ perl6 -e 'CompUnit.new("t/spec/packages/Example/C.pm").precomp’ > $ perl6 -It/spec/packages -e ‘use Example::C; f()’ > Segmentation fault: 11 > > > > Liz >
Subject: Re: [perl #122896] [BUG] 'is cached' routines break when precompiled
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
To: "(via RT)" <perl6-bugs-followup [...] perl.org>
Date: Thu, 8 Jan 2015 13:36:15 +0100
Download (untitled) / with headers
text/plain 1.3k
Show quoted text
> On 08 Jan 2015, at 10:16, Bart Wiegmans <bartwiegmans@gmail.com> wrote: > > Which backend is that? I'm assuming moar. > > 2015-01-08 10:14 GMT+01:00 Elizabeth Mattijsen <liz@dijkmat.nl>:
> > On 04 Oct 2014, at 02:41, (via RT) <perl6-bugs-followup@perl.org> wrote: > > > > # New Ticket Created by > > # Please include the string: [perl #122896] > > # in the subject line of all future correspondence about this issue. > > # <URL: https://rt.perl.org/Ticket/Display.html?id=122896 > > > > > > > Create a module M containing "module M { sub f () is cached is export { } }". When precompiled, the following error occurs when f() is called: > > > > Cannot invoke null object > > in block at src/gen/m-CORE.setting:3604 > > in any enter at src/gen/m-Metamodel.nqp:3110 > > in method invoke at src/gen/m-CORE.setting:3548 > > > > This is perl6 version 2014.09-81-g89abcf2 built on MoarVM version 2014.09-12-gb9e24ee
> > At least on OS X, this has now changed to a segfault on Moar, easily reproducible thus: > > $ perl6 -e 'CompUnit.new("t/spec/packages/Example/C.pm").precomp’ > $ perl6 -It/spec/packages -e ‘use Example::C; f()’ > Segmentation fault: 11
I further golfed this down to: multi sub trait_mod:<is>(Routine $r, :$foo!) { $r.wrap(-> |c { }); } sub a is foo { say "a" }; a Put this in a file with a .pm extension, precomp it like above, and try to load it. Liz
Subject: Re: [perl #122896] [BUG] 'is cached' routines break when precompiled
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
To: "(via RT)" <perl6-bugs-followup [...] perl.org>
Date: Thu, 8 Jan 2015 13:51:42 +0100
Download (untitled) / with headers
text/plain 961b
Show quoted text
> On 08 Jan 2015, at 13:36, Elizabeth Mattijsen <liz@dijkmat.nl> wrote: > I further golfed this down to: > > multi sub trait_mod:<is>(Routine $r, :$foo!) { > $r.wrap(-> |c { > }); > } > sub a is foo { say "a" }; > a > > Put this in a file with a .pm extension, precomp it like above, and try to load it.
By making the block completely parameterless, it gives a stack trace Cannot invoke null object at A.pm:2 (/Users/liz/Github/rakudo.moar/A.pm.moarvm::17) from src/gen/m-Metamodel.nqp:3185 (blib/Perl6/Metamodel.moarvm:enter:28) that brings us to: src/Perl6/Metamodel/Dispatchers.nqp line 101: method enter(*@pos, *%named) { my $fresh := nqp::clone(self); my $first := self.candidates[0]; nqp::setdispatcher($fresh); $first(|@pos, |%named) # <— $first is not set } So it would appear that we cannot find a candidate to be dispatched to. Perhaps the original sub is not serialized??? Liz


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org