Front page | perl.perl5.porters |
Postings from May 2008
[perl #54756] double free or corruption using threads and goto
Thread Next
From:
Luis Lencina
Date:
May 25, 2008 02:22
Subject:
[perl #54756] double free or corruption using threads and goto
Message ID:
rt-3.6.HEAD-11257-1211645751-927.54756-75-0@perl.org
# New Ticket Created by "Luis Lencina"
# Please include the string: [perl #54756]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=54756 >
This is a bug report for perl from luis.lencina@gmail.com,
generated with the help of perlbug 1.35 running under perl v5.8.8.
-----------------------------------------------------------------
[Please enter your report here]
hello, i was learning threads in perl and i found this error. This is the
code
use Getopt::Std;
print "@ARGV\n";
getopt('n');
print "n = $opt_n\n";
print "@ARGV\n";
if($opt_n==''){print "ok\n";}
opendir MYDIR,".";
@dir=grep /temp\d+/,readdir MYDIR;
closedir
print "@dir\n";
for $i (@dir){
goto NOCREODIR if $i eq "temp02";
}
print "creo dir\n";
NOCREODIR: print "no creo\n";
use Thread;
sub hola{
print "hola\n";
}
$t=Thread->new('hola');
$t->join();
end of the code. the output was this
n =
ok
creo dir
no creo
hola
*** glibc detected *** perl: double free or corruption (!prev): 0x08175ea8
***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7e17a85]
/lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb7e1b4f0]
/lib/tls/i686/cmov/libc.so.6(closedir+0x28)[0xb7e3d6b8]
perl(Perl_sv_clear+0x719)[0x80cea09]
perl(Perl_sv_free+0x102)[0x80cebf2]
perl(Perl_gp_free+0xa9)[0x806d799]
perl(Perl_sv_clear+0x47e)[0x80ce76e]
perl(Perl_sv_free+0x102)[0x80cebf2]
perl[0x80c99d2]
perl(Perl_sv_clean_objs+0x41)[0x80c9a41]
perl(perl_destruct+0x11ac)[0x806bbcc]
perl(main+0xc6)[0x8063746]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0)[0xb7dc2450]
perl[0x8063611]
======= Memory map: ========
08048000-0814d000 r-xp 00000000 08:03 325786 /usr/bin/perl
0814d000-08151000 rw-p 00104000 08:03 325786 /usr/bin/perl
08151000-082a4000 rw-p 08151000 00:00 0 [heap]
b7300000-b7321000 rw-p b7300000 00:00 0
b7321000-b7400000 ---p b7321000 00:00 0
b740f000-b7410000 ---p b740f000 00:00 0
b7410000-b7c10000 rw-p b7410000 00:00 0
b7c11000-b7c1b000 r-xp 00000000 08:03 342070 /lib/libgcc_s.so.1
b7c1b000-b7c1c000 rw-p 0000a000 08:03 342070 /lib/libgcc_s.so.1
b7c31000-b7c37000 r-xp 00000000 08:03 847129
/usr/lib/perl/5.8.8/auto/threads/threads.so
b7c37000-b7c38000 rw-p 00005000 08:03 847129
/usr/lib/perl/5.8.8/auto/threads/threads.so
b7c38000-b7c59000 rw-p b7c38000 00:00 0
b7c59000-b7c98000 r--p 00000000 08:03 407336
/usr/lib/locale/es_AR.utf8/LC_CTYPE
b7c98000-b7d79000 r--p 00000000 08:03 408747
/usr/lib/locale/es_AR.utf8/LC_COLLATE
b7d79000-b7d7a000 rw-p b7d79000 00:00 0
b7d7a000-b7d83000 r-xp 00000000 08:03 375462 /lib/tls/i686/cmov/
libcrypt-2.7.so
b7d83000-b7d85000 rw-p 00008000 08:03 375462 /lib/tls/i686/cmov/
libcrypt-2.7.so
b7d85000-b7dac000 rw-p b7d85000 00:00 0
b7dac000-b7ef5000 r-xp 00000000 08:03 375460 /lib/tls/i686/cmov/
libc-2.7.so
b7ef5000-b7ef6000 r--p 00149000 08:03 375460 /lib/tls/i686/cmov/
libc-2.7.so
b7ef6000-b7ef8000 rw-p 0014a000 08:03 375460 /lib/tls/i686/cmov/
libc-2.7.so
b7ef8000-b7efb000 rw-p b7ef8000 00:00 0
b7efb000-b7f0f000 r-xp 00000000 08:03 375474 /lib/tls/i686/cmov/
libpthread-2.7.so
b7f0f000-b7f11000 rw-p 00013000 08:03 375474 /lib/tls/i686/cmov/
libpthread-2.7.so
b7f11000-b7f14000 rw-p b7f11000 00:00 0
b7f14000-b7f37000 r-xp 00000000 08:03 375464 /lib/tls/i686/cmov/
libm-2.7.so
b7f37000-b7f39000 rw-p 00023000 08:03 375464 /lib/tls/i686/cmov/
libm-2.7.so
b7f39000-b7f3b000 r-xp 00000000 08:03 375463 /lib/tls/i686/cmov/
libdl-2.7.so
b7f3b000-b7f3d000 rw-p 00001000 08:03 375463 /lib/tls/i686/cmov/
libdl-2.7.so
b7f41000-b7f42000 r--p 00000000 08:03 407720
/usr/lib/locale/es_AR.utf8/LC_NUMERIC
b7f42000-b7f43000 r--p 00000000 08:03 408112
/usr/lib/locale/es_AR.utf8/LC_TIME
b7f43000-b7f44000 r--p 00000000 08:03 1141500
/usr/lib/locale/es_AR.utf8/LC_MONETARY
b7f44000-b7f45000 r--p 00000000 08:03 423542
/usr/lib/locale/es_AR.utf8/LC_MESSAGES/SYS_LC_MESSAGES
b7f45000-b7f46000 r--p 00000000 08:03 408110
/usr/lib/locale/es_AR.utf8/LC_PAPER
b7f46000-b7f47000 r--p 00000000 08:03 408108
/usr/lib/locale/es_AR.utf8/LC_NAME
b7f47000-b7f48000 r--p 00000000 08:03 1141501
/usr/lib/locale/es_AR.utf8/LC_ADDRESS
b7f48000-b7f49000 r--p 00000000 08:03 1141502
/usr/lib/locale/es_AR.utf8/LC_TELEPHONE
b7f49000-b7f4a000 r--p 00000000 08:03 408106
/usr/lib/locale/es_AR.utf8/LC_MEASUREMENT
b7f4a000-b7f51000 r--s 00000000 08:03 375456
/usr/lib/gconv/gconv-modules.cache
b7f51000-b7f52000 r--p 00000000 08:03 1141503
/usr/lib/locale/es_AR.utf8/LC_IDENTIFICATION
b7f52000-b7f54000 rw-p b7f52000 00:00 0
b7f54000-b7f55000 r-xp b7f54000 00:00 0 [vdso]
b7f55000-b7f6f000 r-xp 00000000 08:03 342085 /lib/ld-2.7.so
b7f6f000-b7f71000 rw-p 00019000 08:03 342085 /lib/ld-2.7.so
bf81e000-bf833000 rw-p bffeb000 00:00 0 [stack]
Cancelado
luis@luis-laptop:~/Desktop$ perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=linux, osvers=2.6.15.7, archname=i486-linux-gnu-thread-multi
uname='linux palmer 2.6.15.7 #1 smp thu sep 7 19:42:20 utc 2006 i686
gnulinux '
config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN
-Dcccdlflags=-fPIC -Darchname=i486-linux-gnu -Dprefix=/usr
-Dprivlib=/usr/share/perl/5.8 -Darchlib=/usr/lib/perl/5.8
-Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5
-Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.8.8
-Dsitearch=/usr/local/lib/perl/5.8.8 -Dman1dir=/usr/share/man/man1
-Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1
-Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl
-Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm
-Duseshrplib -Dlibperl=libperl.so.5.8.8 -Dd_dosuid -des'
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=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
-fno-strict-aliasing -pipe -I/usr/local/include'
ccversion='', gccversion='4.2.3 20071123 (prerelease) (Ubuntu
4.2.2-3ubuntu4)', 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='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
perllibs=-ldl -lm -lpthread -lc -lcrypt
libc=/lib/libc-2.6.1.so, so=so, useshrplib=true,
libperl=libperl.so.5.8.8
gnulibc_version='2.6.1'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_ITHREADS
USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API
Built under linux
Compiled at Nov 27 2007 10:44:36
@INC:
/etc/perl
/usr/local/lib/perl/5.8.8
/usr/local/share/perl/5.8.8
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.8
/usr/share/perl/5.8
/usr/local/lib/site_perl
.
end of output
i found it using ActivePerl for windows but I found the same problem in
ubuntu 8.04
good luck, bye Luis
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=high
---
Site configuration information for perl v5.8.8:
Configured by Debian Project at Tue Nov 27 10:56:10 GMT 2007.
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=linux, osvers=2.6.15.7, archname=i486-linux-gnu-thread-multi
uname='linux palmer 2.6.15.7 #1 smp thu sep 7 19:42:20 utc 2006 i686
gnulinux '
config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN
-Dcccdlflags=-fPIC -Darchname=i486-linux-gnu -Dprefix=/usr
-Dprivlib=/usr/share/perl/5.8 -Darchlib=/usr/lib/perl/5.8
-Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5
-Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.8.8
-Dsitearch=/usr/local/lib/perl/5.8.8 -Dman1dir=/usr/share/man/man1
-Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1
-Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl
-Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm
-Duseshrplib -Dlibperl=libperl.so.5.8.8 -Dd_dosuid -des'
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=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
-fno-strict-aliasing -pipe -I/usr/local/include'
ccversion='', gccversion='4.2.3 20071123 (prerelease) (Ubuntu
4.2.2-3ubuntu4)', 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='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
perllibs=-ldl -lm -lpthread -lc -lcrypt
libc=/lib/libc-2.6.1.so, so=so, useshrplib=true,
libperl=libperl.so.5.8.8
gnulibc_version='2.6.1'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'
Locally applied patches:
---
@INC for perl v5.8.8:
/etc/perl
/usr/local/lib/perl/5.8.8
/usr/local/share/perl/5.8.8
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.8
/usr/share/perl/5.8
/usr/local/lib/site_perl
.
---
Environment for perl v5.8.8:
HOME=/home/luis
LANG=es_AR.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/home/luis/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/Fluent.Inc/bin/
PERL_BADLANG (unset)
SHELL=/bin/bash
Thread Next
-
[perl #54756] double free or corruption using threads and goto
by Luis Lencina