Front page | perl.perl5.porters |
Postings from June 2010
[perl #75656] lvalue subs don't copy on write
From:
tomushkin @ gmail . com
Date:
June 10, 2010 02:15
Subject:
[perl #75656] lvalue subs don't copy on write
Message ID:
rt-3.6.HEAD-4976-1276160053-1068.75656-75-0@perl.org
# New Ticket Created by tomushkin@gmail.com
# Please include the string: [perl #75656]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=75656 >
This is a bug report for perl from tomushkin@gmail.com,
generated with the help of perlbug 1.39 running under perl 5.10.1.
-----------------------------------------------------------------
[Please describe your issue here]
$ perl -e 'sub a : lvalue { $a }; $a = __PACKAGE__; a = 1'
The code dies with "Can't return a readonly value from lvalue subroutine".
My quick reasoning:
__PACKAGE__ is FAKE flagged, according to Devel::Peek::Dump().
Checking with perl's source, that seems to be the meanings of the copy on write implementation.
Consequent, $a is faked and the actual assignment is to be delayed until modification is attempted.
pp_hot.c:2558 where the error comes from doesn't handle the flag.
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=high
---
Site configuration information for perl 5.10.1:
Configured by Gentoo at Fri Nov 20 14:44:03 EET 2009.
Summary of my perl5 (revision 5 version 10 subversion 1) configuration:
Platform:
osname=linux, osvers=2.6.31.5, archname=i686-linux
uname='linux oz 2.6.31.5 #2 preempt tue oct 27 16:02:10 eet 2009 i686 intel(r) pentium(r) m processor 1.86ghz genuineintel gnulinux '
config_args='-des -Duseshrplib -Darchname=i686-linux -Dcc=i686-pc-linux-gnu-gcc -Doptimize=-O2 -march=pentium-m -pipe -fomit-frame-pointer -Dscriptdir=/usr/bin -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr -Dprivlib=/usr/lib/perl5/5.10.1 -Darchlib=/usr/lib/perl5/5.10.1/i686-linux -Dvendorlib=/usr/lib/perl5/vendor_perl/5.10.1 -Dvendorarch=/usr/lib/perl5/vendor_perl/5.10.1/i686-linux -Dsitelib=/usr/lib/perl5/site_perl/5.10.1 -Dsitearch=/usr/lib/perl5/site_perl/5.10.1/i686-linux -Dlibperl=libperl.so.5.10.1 -Dlocincpth= -Duselargefiles -Dd_semctl_semun -Dinc_version_list=5.10.0 5.10.0/i686-linux -Dcf_by=Gentoo -Dmyhostname=localhost -Dperladmin=root@localhost -Dinstallusrbinperl=n -Ud_csh -Uusenm -Di_ndbm -Di_gdbm -Di_db'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='i686-pc-linux-gnu-gcc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -march=pentium-m -pipe -fomit-frame-pointer',
cppflags='-fno-strict-aliasing -pipe -fstack-protector'
ccversion='', gccversion='4.3.4', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='i686-pc-linux-gnu-gcc', ldflags =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.9.so, so=so, useshrplib=true, libperl=libperl.so.5.10.1
gnulibc_version='2.9'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -march=pentium-m -pipe -fomit-frame-pointer -L/usr/local/lib -fstack-protector'
Locally applied patches:
---
@INC for perl 5.10.1:
/usr/lib/perl5/site_perl/5.10.1/i686-linux
/usr/lib/perl5/site_perl/5.10.1
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.10.1/i686-linux
/usr/lib/perl5/vendor_perl/5.10.1
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.10.1/i686-linux
/usr/lib/perl5/5.10.1
.
---
Environment for perl 5.10.1:
HOME=/home/toma
LANG (unset)
LANGUAGE (unset)
LC_CTYPE=en_US.UTF-8
LD_LIBRARY_PATH=
LOGDIR (unset)
PATH=:/usr/local/bin:/usr/bin:/bin:/usr/games:/opt/bin:/usr/i686-pc-linux-gnu/arm-elf/gcc-bin/4.4.2:/usr/i686-pc-linux-gnu/gcc-bin/4.3.4:/opt/sancho:/usr/games/bin
PERL5LIB=
PERL_BADLANG (unset)
SHELL=/bin/zsh
-
[perl #75656] lvalue subs don't copy on write
by tomushkin @ gmail . com