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

[perl #128189] Assert fail in sv.c with no further symptoms: et''/$0{\0}

Thread Next
From:
Father Chrysostomos via RT
Date:
May 19, 2016 22:22
Subject:
[perl #128189] Assert fail in sv.c with no further symptoms: et''/$0{\0}
Message ID:
rt-4.0.18-12132-1463696540-1275.128189-15-0@perl.org
On Thu May 19 15:02:05 2016, sprout wrote:
> On Thu May 19 14:53:18 2016, dcollinsn@gmail.com wrote:
> > The slightly shorter testcase:
> > 
> > perl -W -e 'e f/$0{\0}/'
> > 
> > also shows this error
> 
> Shorter:
> 
> perl -we '"$0{\0}"'
> perl -we '/$0{\0}/'
> 
> Any uninitialized warning that tries to mention $0{\0} will trigger it.
> 

It appears that the subscript has to be an OP_CONST, because qr// doesn’t trigger it.

A bisect points to:

commit 04698ff67968faa57a46c12d31e17c17baf08876
Author: Father Chrysostomos <sprout@cpan.org>
Date:   Sat Nov 27 06:22:24 2010 -0800

    [perl #79178] STORE/FETCH of tie()d hash get stringified key

but that is a red herring.  It fixed another bug, exposing this one.

Here is a similar bug with array indices.  There is no crash here, but the number in the subscript is bogus:

$ ./miniperl -we '"$0[\0]"'
Useless use of string in void context at -e line 1.
Use of reference "SCALAR(0x7fad6882fcf0)" as array index at -e line 1.
Use of uninitialized value $0[1753414896] in string at -e line 1.
$ perl -le 'print 0x7fad6882fcf0'
140382759484656

I would expect the output of the latter command to match the subscript in the uninit warning.

-- 

Father Chrysostomos


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

Thread Next


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