develooper Front page | perl.perl5.porters | Postings from May 2018

[perl #133159] `B` module use freed sv

Thread Previous
From:
James E Keenan via RT
Date:
May 7, 2018 22:06
Subject:
[perl #133159] `B` module use freed sv
Message ID:
rt-4.0.24-9528-1525730768-1566.133159-15-0@perl.org
On Sat, 28 Apr 2018 17:53:50 GMT, damien-43@gmx.fr wrote:
> 
> This is a bug report for perl from damien-43@gmx.fr,
> generated with the help of perlbug 1.40 running under perl 5.26.2.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> Hi
> B module does not work with constants sv if it is created in eval
> 'string'.
> 
> % cat t.pl
> use v5.26;
> use B;
> 
> eval '
>     $_ = B::svref_2object(\"foo");
>     p($_);
> ';
> say "=" x 80;
> 
> p($_);
> 
> sub p {
>     my $pv = shift;
>     printf "PVX = '%s'\n", $pv->PVX;
>     printf "CUR = %d\n", $_->CUR;
>     printf "LEN = %d\n", $pv->LEN;
>     printf "FLAGS = %d\n", $pv->FLAGS;
>     printf "SvTYPE = %d\n", $pv->SvTYPE;
>     say ref $pv->object_2svref;
> }
> 
> % perl t.pl
> PVX = 'foo'
> CUR = 3
> LEN = 10
> FLAGS = 402736131
> SvTYPE = 3
> SCALAR
> ================================================================================
> PVX = '��V�U'
> CUR = 0
> LEN = 94516509793920
> FLAGS = 255
> SvTYPE = 255
> UNKNOWN
> [1]    17092 segmentation fault (core dumped)  perl t.pl
> 
> 
> [Please do not change anything below this line]
> -----------------------------------------------------------------
> ---
> Flags:
>     category=library
>     severity=low
>     module=B
> ---
> Site configuration information for perl 5.26.2:
> 

I've been able to replicate this in 5.20.3 and 5.24.1.  Hence, it was not introduced in the 5.27 development cycle and is not a blocker for 5.28.0.

Thank you very much.
-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=133159

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About