Subject: | Shared Scalars Leak |
Unless I am doing something wrong it appears that threads::shared leaks
when doing a scalar attribute assignment.
Leaky Code:
#! your_path/perl -l
use strict;
use threads ( 'exit' => 'threads_only' );
use threads::shared;
my $semX :shared = 0;
exit 0;
Test::LeakTrace::Script Output:
perl -MTest::LeakTrace::Script -l ./t.pl
leaked HASH(0x81743b8) from /apps/perl/1401/i686/lib/attributes.pm line 50.
leaked ARRAY(0x8174358) from /apps/perl/1401/i686/lib/attributes.pm line 50.
leaked SCALAR(0x8174348) from /apps/perl/1401/i686/lib/attributes.pm
line 50.
leaked GLOB(0x8174338) from /apps/perl/1401/i686/lib/attributes.pm line 50.
leaked SCALAR(0x8173888) from ./t.pl line 5.
Non-Leaky Code:
#! your_path/perl -l
use strict;
use threads ( 'exit' => 'threads_only' );
use threads::shared;
my $semX;
threads::shared::share($semX);
exit 0;
VERSIONING INFORMATION:
Platforms: Linux SuSe 10 and 11 i686 and x86_64
threads::shared VERSIONING:
threads-shared
Perl extension for sharing data structures between threads
Version: 1.37
Released: 2011-04-21
Author: Jerry D. Hedden <jdhedden@cpan.org>
Provide: threads::shared version 1.37
Require: Carp
Require: Config
Require: ExtUtils::testlib
Require: Scalar::Util
Require: Test
Require: Test::More
Require: XSLoader
Require: strict
Require: threads version 1.73 or better
Require: warnings
Repo: ActiveState Package Repository
CPAN: http://search.cpan.org/dist/threads-shared-1.37/
Installed: 1.37 (perl)
Perl VERSIONING:
Summary of my perl5 (revision 5 version 14 subversion 1) configuration:
Platform:
osname=linux, osvers=2.6.17-1.2142_fc4, archname=i686-linux-thread-multi
uname='linux perl-linux-vm 2.6.17-1.2142_fc4 #1 tue jul 11 22:41:14
edt 2006 i686 i686 i386 gnulinux '
config_args='-ders -Dcc=gcc -Dusethreads -Duseithreads
-Uinstallusrbinperl -Ulocincpth= -Uloclibpth=
-Accflags=-DUSE_SITECUSTOMIZE -Duselargefiles
-Accflags=-DPERL_RELOCATABLE_INCPUSH -Accflags=-fno-merge-constants
-Dprefix=/apps/perl/1401/i686 -Dprivlib=/apps/perl/1401/i686/lib
-Darchlib=/apps/perl/1401/i686/lib
-Dsiteprefix=/apps/perl/1401/i686/site
-Dsitelib=/apps/perl/1401/i686/site/lib
-Dsitearch=/apps/perl/1401/i686/site/lib -Dsed=/bin/sed -Duseshrplib
-Dcf_by=ActiveState -Dcf_email=support@ActiveState.com'
hint=recommended, useposix=true, d_sigaction=define
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='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DUSE_SITECUSTOMIZE
-DPERL_RELOCATABLE_INCPUSH -fno-merge-constants -fno-strict-aliasing
-pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DUSE_SITECUSTOMIZE
-DPERL_RELOCATABLE_INCPUSH -fno-merge-constants -fno-strict-aliasing -pipe'
ccversion='', gccversion='4.0.2 20051125 (Red Hat 4.0.2-8)',
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='gcc', ldflags =''
libpth=/lib /usr/lib /usr/local/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.3.6.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.3.6'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/apps/perl/1401/i686/lib/CORE'
cccdlflags='-fPIC', lddlflags='-shared -O2'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
PERL_PRESERVE_IVUV USE_ITHREADS USE_LARGE_FILES
USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API
USE_SITECUSTOMIZE
Locally applied patches:
ActivePerl Build 1401 [294969]
Built under linux
Compiled at Jun 16 2011 18:35:13
@INC:
/apps/perl/1401/i686/site/lib
/apps/perl/1401/i686/lib
.