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

Owner: Nobody
Requestors: zefram [at] fysh.org
Cc:
AdminCc:

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



To: rakudobug [...] perl.org
From: Zefram <zefram [...] fysh.org>
Date: Sun, 13 Dec 2015 05:14:53 +0000
Subject: [BUG] $init-time-num breaks introspection
Download (untitled) / with headers
text/plain 304b
$ perl6 -e 'say $init-time-num; say CORE::<$init-time-num>' 1449983501.60682 Lexical with name '$init-time-num' has a different type in this frame in block <unit> at -e:1 It's the retrieval of the value from the symbol table that triggers the error. This is a hazard for introspective code. -zefram
Date: Sun, 13 Dec 2015 10:44:56 +0000
Subject: Re: [perl #126889] [BUG] $init-time-num breaks introspection
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
To: "Zefram (via RT)" <perl6-bugs-followup [...] perl.org>
Download (untitled) / with headers
text/plain 1.3k
Show quoted text
> On 13 Dec 2015, at 05:15, Zefram (via RT) <perl6-bugs-followup@perl.org> wrote: > > # New Ticket Created by Zefram > # Please include the string: [perl #126889] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=126889 > > > > $ perl6 -e 'say $init-time-num; say CORE::<$init-time-num>' > 1449983501.60682 > Lexical with name '$init-time-num' has a different type in this frame > in block <unit> at -e:1 > > It's the retrieval of the value from the symbol table that triggers > the error. This is a hazard for introspective code.
This actually applies to any native on any PseudoStash: $ 6 'my int $a = 42; say MY::<$a>' Lexical with name '$a' has a different type in this frame in block <unit> at -e:1 Also: $init-time-num is an unintended leak of a variable to allow for lazy population of $*INITTIME. I’ve now removed that leak by not populating $*INITTIME lazily anymore. This adds 2 milliseconds to bare startup. FWIW, the bug seems to be in the underlying nqp::atkey: $ 6 'use nqp; my int $a = 42; my $m := nqp::getattr(MY::,Map,q/$!storage/); say nqp::atkey($m,q/$a/)' Lexical with name '$a' has a different type in this frame in block <unit> at -e:1 $ 6 'use nqp; my Int $a = 42; my $m := nqp::getattr(MY::,Map,q/$!storage/); say nqp::atkey($m,q/$a/)’ 42 Liz
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
To: "Zefram (via RT)" <perl6-bugs-followup [...] perl.org>
Subject: Re: [perl #126889] [BUG] $init-time-num breaks introspection
Date: Sun, 13 Dec 2015 10:57:11 +0000
Download (untitled) / with headers
text/plain 1.1k
Show quoted text
> On 13 Dec 2015, at 10:44, Elizabeth Mattijsen <liz@dijkmat.nl> wrote:
>> On 13 Dec 2015, at 05:15, Zefram (via RT) <perl6-bugs-followup@perl.org> wrote: >> >> # New Ticket Created by Zefram >> # Please include the string: [perl #126889] >> # in the subject line of all future correspondence about this issue. >> # <URL: https://rt.perl.org/Ticket/Display.html?id=126889 > >> >> >> $ perl6 -e 'say $init-time-num; say CORE::<$init-time-num>' >> 1449983501.60682 >> Lexical with name '$init-time-num' has a different type in this frame >> in block <unit> at -e:1 >> >> It's the retrieval of the value from the symbol table that triggers >> the error. This is a hazard for introspective code.
> > This actually applies to any native on any PseudoStash: > > $ 6 'my int $a = 42; say MY::<$a>' > Lexical with name '$a' has a different type in this frame > in block <unit> at -e:1 > > Also: $init-time-num is an unintended leak of a variable to allow for lazy population of $*INITTIME. I’ve now removed that leak by not populating $*INITTIME lazily anymore. This adds 2 milliseconds to bare startup.
In 4bc8f3358029866a0854d266 I actually found a way to keep the lazy init *and* remove the leak. 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