perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Foertsch <torsten.foert...@gmx.net>
Subject is APR intended to work with threads?
Date Tue, 15 May 2007 10:01:56 GMT
$ perl -MAPR::Pool -Mthreads -e '
APR::Pool->new;
$_->join for (map {threads->create(sub{})} 1,2);print "DONE\n"'
DONE

but

$ perl -MAPR::Pool -Mthreads -e '
my $p=APR::Pool->new;
$_->join for (map {threads->create(sub{})} 1,2); print "DONE\n"'
DONE
*** glibc detected *** perl: double free or corruption (!prev): 0x0820e670 ***
======= Backtrace: =========
/lib/libc.so.6[0xb7e4c6e1]
/lib/libc.so.6(cfree+0x89)[0xb7e4dd79]
/opt/apache22-worker/lib/libapr-1.so.0(apr_allocator_destroy+0x44)[0xb7b87b59]
/opt/apache22-worker/lib/libapr-1.so.0(apr_pool_destroy+0x117)[0xb7b88647]
/opt/apache22-worker/lib/libapr-1.so.0(apr_pool_terminate+0x46)[0xb7b8820e]
/opt/apache22-worker/lib/libapr-1.so.0(apr_terminate+0x30)[0xb7b897e6]
/opt/apache22-worker/mod_perl/5.8.8/i586-linux-thread-multi/auto/APR/APR.so(XS_APR_END+0x59)[0xb7fb5d39]
perl(Perl_pp_entersub+0x3c3)[0x80caef3]
perl[0x8062f7d]
perl(Perl_call_sv+0x6d4)[0x8067434]
perl(Perl_call_list+0x27f)[0x806790f]
perl(perl_destruct+0x12e1)[0x8069961]
perl(main+0xc6)[0x80601b6]
/lib/libc.so.6(__libc_start_main+0xdc)[0xb7dfdf9c]
perl[0x8060061]
======= Memory map: ========
08048000-08160000 r-xp 00000000 03:05 129870     /usr/bin/perl
08160000-08165000 rw-p 00117000 03:05 129870     /usr/bin/perl
08165000-082fb000 rw-p 08165000 00:00 0          [heap]
b6800000-b6821000 rw-p b6800000 00:00 0
b6821000-b6900000 ---p b6821000 00:00 0
b6952000-b6953000 ---p b6952000 00:00 0
b6953000-b7153000 rw-p b6953000 00:00 0
b7174000-b7175000 ---p b7174000 00:00 0
b7175000-b7975000 rw-p b7175000 00:00 0
b7996000-b79a7000 r-xp 00000000 03:05 32517      /lib/libz.so.1.2.3
b79a7000-b79a9000 rw-p 00010000 03:05 32517      /lib/libz.so.1.2.3
b79a9000-b7ac4000 r-xp 00000000 03:05 260697     /usr/lib/libcrypto.so.0.9.8
b7ac4000-b7aca000 r--p 0011b000 03:05 260697     /usr/lib/libcrypto.so.0.9.8
b7aca000-b7ad9000 rw-p 00121000 03:05 260697     /usr/lib/libcrypto.so.0.9.8
b7ad9000-b7adc000 rw-p b7ad9000 00:00 0
b7adc000-b7b15000 r-xp 00000000 03:05 260698     /usr/lib/libssl.so.0.9.8
b7b15000-b7b19000 rw-p 00039000 03:05 260698     /usr/lib/libssl.so.0.9.8
b7b19000-b7b2f000 r-xp 00000000 03:05 259608     /usr/lib/libsasl2.so.2.0.22
b7b2f000-b7b31000 rw-p 00015000 03:05 259608     /usr/lib/libsasl2.so.2.0.22
b7b31000-b7b40000 r-xp 00000000 03:05 32488      /lib/libresolv-2.5.so
b7b40000-b7b42000 rw-p 0000e000 03:05 32488      /lib/libresolv-2.5.so
b7b42000-b7b44000 rw-p b7b42000 00:00 0
b7b4f000-b7b59000 r-xp 00000000 03:05 32504      /lib/libgcc_s.so.1
b7b59000-b7b5b000 rw-p 00009000 03:05 32504      /lib/libgcc_s.so.1
b7b5b000-b7b61000 r-xp 00000000 03:05 681480     /usr/lib/perl5/5.8.8/i586-linux-thread-multi/auto/threads/threads.so
b7b61000-b7b63000 rw-p 00005000 03:05 681480     /usr/lib/perl5/5.8.8/i586-linux-thread-multi/auto/threads/threads.so
b7b63000-b7b67000 r-xp 00000000 03:05 1395452    /opt/apache22-worker/mod_perl/5.8.8/i586-linux-thread-multi/auto/APR/Pool/Pool.so
b7b67000-b7b68000 r--p 00003000 03:05 1395452    /opt/apache22-worker/mod_perl/5.8.8/i586-linux-thread-multi/auto/APR/Pool/Pool.so
b7b68000-b7b69000 rw-p 00004000 03:05 1395452    /opt/apache22-worker/mod_perl/5.8.8/i586-linux-thread-multi/auto/APR/Pool/Pool.so
b7b69000-b7b70000 r-xp 00000000 03:05 32490      /lib/librt-2.5.so
b7b70000-b7b72000 rw-p 00006000 03:05 32490      /lib/librt-2.5.so
b7b72000-b7b99000 r-xp 00000000 03:05 1266919    /opt/apache22-worker/lib/libapr-1.so.0.2.7
b7b99000-b7b9a000 r--p 00026000 03:05 1266919    /opt/apache22-worker/lib/libapr-1.so.0.2.7
b7b9a000-b7b9b000 rw-p 00027000 03:05 1266919    /opt/apache22-worker/lib/libapr-1.so.0.2.7
b7b9b000-b7bb9000 r-xp 00000000 03:05 571254     /usr/lib/libexpat.so.1.5.0
b7bb9000-b7bba000 r--p 0001d000 03:05 571254     /usr/lib/libexpat.so.1.5.0
b7bba000-b7bbc000 rw-p 0001e000 03:05 571254     /usr/lib/libexpat.so.1.5.0
b7bbc000-b7c00000 r-xp 00000000 03:05 571803     /usr/lib/libsqlite.so.0.8.6
b7c00000-b7c03000 rw-p 00043000 03:05 571803     /usr/lib/libsqlite.so.0.8.6
b7c03000-b7c5c000 r-xp 00000000 03:05 571799     /usr/lib/libsqlite3.so.0.8.6
b7c5c000-b7c5e000 rw-p 00059000 03:05 571799     /usr/lib/libsqlite3.so.0.8.6
b7c5e000-b7c94000 r-xp 00000000 03:05 259925     /usr/lib/libldap-2.3.so.0.2.15
b7c94000-b7c96000 rw-p 00035000 03:05 259925     /usr/lib/libldap-2.3.so.0.2.15
b7c96000-b7cb2000 r-xp 00000000 03:05 1266952    /opt/apache22-worker/lib/libaprutil-1.so.0.2.7
b7cb2000-b7cb3000 r--p 0001b000 03:05 1266952    /opt/apache22-worker/lib/libaprutil-1.so.0.2.7
b7cb3000-b7cb4000 rw-p 0001c000 03:05 1266952    /opt/apache22-worker/lib/libaprutil-1.so.0.2.7
b7cb4000-b7cd5000 rw-p b7cb4000 00:00 0
b7cd5000-b7d10000 r--p 00000000 03:05 617761     /usr/lib/locale/en_US.utf8/LC_CTYPE
b7d10000-b7de7000 r--p 00000000 03:05 617762     /usr/lib/locale/en_US.utf8/LC_COLLATE
b7de7000-b7de8000 rw-p b7de7000 00:00 0
b7de8000-b7f10000 r-xp 00000000 03:05 32460      /lib/libc-2.5.so
b7f10000-b7f11000 r--p 00128000 03:05 32460      /lib/libc-2.5.so
b7f11000-b7f13000 rw-p 00129000 03:05 32460      /lib/libc-2.5.so
b7f13000-b7f16000 rw-p b7f13000 00:00 0
b7f16000-b7f2a000 r-xp 00000000 03:05 32486      /lib/libpthread-2.5.so
b7f2a000-b7f2c000 rw-p 00013000 03:05 32486      /lib/libpthread-2.5.so
b7f2c000-b7f2e000 rw-p b7f2c000 00:00 0
b7f2e000-b7f30000 r-xp 00000000 03:05 32494      /lib/libutil-2.5.so
b7f30000-b7f32000 rw-p 00001000 03:05 32494      /lib/libutil-2.5.so
b7f32000-b7f33000 rw-p b7f32000 00:00 0
b7f33000-b7f3c000 r-xp 00000000 03:05 32464      /lib/libcrypt-2.5.so
b7f3c000-b7f3f000 rw-p 00008000 03:05 32464      /lib/libcrypt-2.5.so
b7f3f000-b7f66000 rw-p b7f3f000 00:00 0
b7f66000-b7f8a000 r-xp 00000000 03:05 32468      /lib/libm-2.5.so
b7f8a000-b7f8c000 rw-p 00023000 03:05 32468      /lib/libm-2.5.so
b7f8c000-b7f8e000 r-xp 00000000 03:05 32466      /lib/libdl-2.5.so
b7f8e000-b7f90000 rw-p 00001000 03:05 32466      /lib/libdl-2.5.so
b7f90000-b7fa2000 r-xp 00000000 03:05 32471      /lib/libnsl-2.5.so
b7fa2000-b7fa4000 rw-p 00011000 03:05 32471      /lib/libnsl-2.5.so
b7fa4000-b7fa6000 rw-p b7fa4000 00:00 0
b7fa6000-b7fb2000 r-xp 00000000 03:05 259923     /usr/lib/liblber-2.3.so.0.2.15
b7fb2000-b7fb4000 rw-p 0000b000 03:05 259923     /usr/lib/liblber-2.3.so.0.2.15
b7fb4000-b7fb8000 r-xp 00000000 03:05 1395418    /opt/apache22-worker/mod_perl/5.8.8/i586-linux-thread-multi/auto/APR/APR.so
b7fb8000-b7fb9000 r--p 00003000 03:05 1395418    /opt/apache22-worker/mod_perl/5.8.8/i586-linux-thread-multi/auto/APR/APR.so
b7fb9000-b7fba000 rw-p 00004000 03:05 1395418    /opt/apache22-worker/mod_perl/5.8.8/i586-linux-thread-multi/auto/APR/APR.so
b7fba000-b7fbb000 r--p 00000000 03:05 617743     /usr/lib/locale/en_US.utf8/LC_NUMERIC
b7fbb000-b7fbc000 r--p 00000000 03:05 601630     /usr/lib/locale/en_US.utf8/LC_TIME
b7fbc000-b7fbd000 r--p 00000000 03:05 601629     /usr/lib/locale/en_US.utf8/LC_MONETARY
b7fbd000-b7fbe000 r--p 00000000 03:05 617736     /usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES
b7fbe000-b7fbf000 r--p 00000000 03:05 617668     /usr/lib/locale/en_US.utf8/LC_PAPER
b7fbf000-b7fc0000 r--p 00000000 03:05 617691     /usr/lib/locale/en_US.utf8/LC_NAME
b7fc0000-b7fc1000 r--p 00000000 03:05 601626     /usr/lib/locale/en_US.utf8/LC_ADDRESS
b7fc1000-b7fc2000 r--p 00000000 03:05 617653     /usr/lib/locale/en_US.utf8/LC_TELEPHONE
b7fc2000-b7fc3000 r--p 00000000 03:05 617654     /usr/lib/locale/en_US.utf8/LC_MEASUREMENT
b7fc3000-b7fca000 r--s 00000000 03:05 600904     /usr/lib/gconv/gconv-modules.cache
b7fca000-b7fcb000 r--p 00000000 03:05 601627     /usr/lib/locale/en_US.utf8/LC_IDENTIFICATION
b7fcb000-b7fcc000 rw-p b7fcb000 00:00 0
b7fcc000-b7fcd000 r-xp b7fcc000 00:00 0          [vdso]
b7fcd000-b7fe8000 r-xp 00000000 03:05 32453      /lib/ld-2.5.so
b7fe8000-b7fea000 rw-p 0001a000 03:05 32453      /lib/ld-2.5.so
bfeae000-bfec4000 rw-p bfeae000 00:00 0          [stack]
Aborted


At least 2 threads need to be created. It crashes also if $p in undefined
between thread creation and joining but it does not if it is undefined before
thread creation.

Perl: 5.8.8
mod_perl: trunk
httpd: 2.2.3

Torsten

Mime
View raw message