Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

[perl #70273] vec causes leaks

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


perlbug-followup at perl

Nov 5, 2009, 9:11 AM

Post #1 of 3 (141 views)
Permalink
[perl #70273] vec causes leaks

# New Ticket Created by "Eric Brine"
# Please include the string: [perl #70273]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=70273 >


This is a bug report for perl from ikegami [at] adaelis,
generated with the help of perlbug 1.39 running under perl 5.10.1.


-----------------------------------------------------------------
[Please describe your issue here]


vec increases the refcount of its target:

>perl -MDevel::Peek -le"my $x=''; Dump $x; vec($x,0,1)=0; Dump $x;"
SV = PV(0x236044) at 0x238264
REFCNT = 1
FLAGS = (PADMY,POK,pPOK)
PV = 0x23fd84 ""\0
CUR = 0
LEN = 4
SV = PV(0x236044) at 0x238264
REFCNT = 2
FLAGS = (PADMY,POK,pPOK)
PV = 0x23fd84 "\0"\0
CUR = 1
LEN = 4


The memory leaking effects can be seen using these snippets:

>perl -le"{ my $x=''; $x = bless {}; } print 'G'; DESTROY { print 'D' }"
D
G

>perl -le"{ my $x=''; vec($x,0,1)=0; $x = bless {}; } print 'G'; DESTROY {
print 'D' }"
G
D


This has been occurring at least as far back as 5.6.0

- Eric


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=medium
---
Site configuration information for perl 5.10.1:

Configured by SYSTEM at Mon Aug 24 13:48:02 2009.

Summary of my perl5 (revision 5 version 10 subversion 1) configuration:

Platform:
osname=MSWin32, osvers=5.00, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32
-D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE
-DPRIVLIB_LAST_IN_INC -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
-DUSE_PERLIO -DPERL_MSVCRT_READFIX',
optimize='-MD -Zi -DNDEBUG -O1',
cppflags='-DWIN32'
ccversion='12.00.8804', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf
-libpath:"C:\progs\perl5101\lib\CORE" -machine:x86'
libpth=\lib
libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib
uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
msvcrt.lib
perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib
uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
msvcrt.lib
libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl510.lib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
-opt:ref,icf -libpath:"C:\progs\perl5101\lib\CORE" -machine:x86'

Locally applied patches:
ACTIVEPERL_LOCAL_PATCHES_ENTRY
32728 64-bit fix for Time::Local

---
@INC for perl 5.10.1:
c:/Progs/perl5101/site/lib
c:/Progs/perl5101/lib
.

---
Environment for perl 5.10.1:
HOME (unset)
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)

PATH=c:\bin;c:\progs\perl5101\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\WBEM
PERL_BADLANG (unset)
SHELL (unset)


perl at profvince

Nov 5, 2009, 12:56 PM

Post #2 of 3 (130 views)
Permalink
Re: [perl #70273] vec causes leaks [In reply to]

It's not only lvalue vec(), it's also lvalue pos(), substr() and maybe
keys().

I'll have a look at this.

Vincent.


perl at profvince

Nov 5, 2009, 2:26 PM

Post #3 of 3 (129 views)
Permalink
Re: [perl #70273] vec causes leaks [In reply to]

> It's not only lvalue vec(), it's also lvalue pos(), substr() and maybe
> keys().
>
> I'll have a look at this.
>
> Vincent.
>
>

Actually, this has already been reported in
http://rt.perl.org/rt3/Ticket/Display.html?id=67838, and I came to the
same conclusions as Bram.
Let's continue there.

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.