develooper Front page | perl.perl5.porters | Postings from September 2003

[perl #24061] shared array memory leak in 5.8.1

From:
Eric Garland
Date:
September 28, 2003 16:58
Subject:
[perl #24061] shared array memory leak in 5.8.1
Message ID:
rt-24061-65381.14.9544917464205@rt.perl.org
# New Ticket Created by  Eric Garland 
# Please include the string:  [perl #24061]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=24061 >



This is a bug report for perl from perlbug@ericgarland.com,
generated with the help of perlbug 1.34 running under perl v5.8.1.


-----------------------------------------------------------------
[Please enter your report here]

This program will make perl 5.8.1 expand to using 350 mb on my linux 
machine within 60 seconds: 


use threads;
use threads::shared;
my @shared : shared;
@shared = (1) while (1);


On perl 5.8.1-1 in cygwin in Windows 2000 it will crash perl 
within about 20 seconds.  ActivePerl 5.8.1 isn't out but it crashes
5.8.0 build 806 just like cygwin's perl.  

The ability to use threads is a major step forward for perl. With 
it you can easliy use shared variables to tightly integrate 
two separatly scheduled threads of execution to create complex
applications.  There are a lot of things you can do with shared 
scalars but shared arrays and queues are really key to this whole 
threadding thing.  I'm excited to see this functionality in perl 
and I'm really excited to start using it but with this huge leak 
I can't use it for anything but very small, infrequently used 
arrays.

Am I doing someting wrong or is this a real bug?  If it's a bug
are there any patches that I could try that could fix it?

Thanks!

	-Eric


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

Configured by egarland at Sun Sep 28 11:14:35 EDT 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.18-19.7.xsmp, archname=i686-linux-thread-multi-64int
    uname='linux fsdev2.ericgarland.com 2.4.18-19.7.xsmp #1 smp thu dec 12 07:56:58 est 2002 i686 unknown '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='-O2',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
    ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.1 2.96-98)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.2.4.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.2.4'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.8.1:
    /usr/local/lib/perl5/5.8.1/i686-linux-thread-multi-64int
    /usr/local/lib/perl5/5.8.1
    /usr/local/lib/perl5/site_perl/5.8.1/i686-linux-thread-multi-64int
    /usr/local/lib/perl5/site_perl/5.8.1
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl v5.8.1:
    HOME=/root
    LANG=en_US
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/egarland/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash




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