Skip Menu |

This queue is for tickets about the Math-Random-MT CPAN distribution.

Report information
The Basics
Id: 123093
Status: new
Priority: 0/
Queue: Math-Random-MT

People
Owner: Nobody in particular
Requestors: me [...] peter-r.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Use of threads causes a doublefree
Date: Thu, 21 Sep 2017 13:51:24 +0100
To: bug-Math-Random-MT [...] rt.cpan.org
From: Peter Roberts <me [...] peter-r.co.uk>
Here's a minimal reproduction use threads; use Math::Random::MT; my $gen = Math::Random::MT->new(0); async {} -> join(); ➜ framework git:(threads-for-io) ✗ perl -V Summary of my perl5 (revision 5 version 26 subversion 0) configuration: Platform: osname=linux osvers=4.10.0-33-generic archname=x86_64-linux-thread-multi uname='linux proberts-ubu 4.10.0-33-generic #37-ubuntu smp fri aug 11 10:55:28 utc 2017 x86_64 x86_64 x86_64 gnulinux ' config_args='-de -Dprefix=/home/peter/perl5/perlbrew/perls/alt -Dusethreads -Aeval:scriptdir=/home/peter/perl5/perlbrew/perls/alt/bin' hint=recommended useposix=true d_sigaction=define useithreads=define usemultiplicity=define use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='cc' ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' optimize='-O2' cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' ccversion='' gccversion='6.3.0 20170406' gccosandvers='' intsize=4 longsize=8 ptrsize=8 doublesize=8 byteorder=12345678 doublekind=3 d_longlong=define longlongsize=8 d_longdbl=define longdblsize=16 longdblkind=3 ivtype='long' ivsize=8 nvtype='double' nvsize=8 Off_t='off_t' lseeksize=8 alignbytes=8 prototype=define Linker and Libraries: ld='cc' ldflags =' -fstack-protector-strong -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.24.so so=so useshrplib=false libperl=libperl.a gnulibc_version='2.24' Dynamic Linking: dlsrc=dl_dlopen.xs dlext=so d_dlsymun=undef ccdlflags='-Wl,-E' cccdlflags='-fPIC' lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_OP_PARENT PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Locally applied patches: Devel::PatchPerl 1.48 Built under linux Compiled at Sep 11 2017 15:21:04 %ENV: PERLBREW_FISH_VERSION="0.80" PERLBREW_HOME="/home/peter/.perlbrew" PERLBREW_MANPATH="/home/peter/perl5/perlbrew/perls/alt/man" PERLBREW_PATH="/home/peter/perl5/perlbrew/bin /home/peter/perl5/perlbrew/perls/alt/bin" PERLBREW_PERL="alt" PERLBREW_ROOT="/home/peter/perl5/perlbrew" PERLBREW_VERSION="0.80" @INC: /home/peter/perl5/perlbrew/perls/alt/lib/site_perl/5.26.0/x86_64-linux-thread-multi /home/peter/perl5/perlbrew/perls/alt/lib/site_perl/5.26.0 /home/peter/perl5/perlbrew/perls/alt/lib/5.26.0/x86_64-linux-thread-multi /home/peter/perl5/perlbrew/perls/alt/lib/5.26.0 Peter
Subject: Re: [rt.cpan.org #123093] AutoReply: Use of threads causes a doublefree
Date: Thu, 21 Sep 2017 14:22:07 +0100
To: bug-Math-Random-MT [...] rt.cpan.org
From: Peter Roberts <me [...] peter-r.co.uk>
➜ framework git:(threads-for-io) ✗ perl mt_test.pl *** Error in `perl': double free or corruption (!prev): 0x0000563232f2eb30 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x7908b)[0x7f9679e7908b] /lib/x86_64-linux-gnu/libc.so.6(+0x82c3a)[0x7f9679e82c3a] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f9679e86d2c] /home/peter/perl5/perlbrew/perls/alt/lib/site_perl/5.26.0/x86_64-linux-thread-multi/auto/Math/Random/MT/MT.so(+0x164e)[0x7f967971864e] perl(Perl_pp_entersub+0x450)[0x563231d7ab20] perl(Perl_call_sv+0x35c)[0x563231cec41c] perl(+0xdf8b5)[0x563231d7f8b5] perl(Perl_sv_clear+0x6c0)[0x563231d802e0] perl(Perl_sv_free2+0x60)[0x563231d80600] perl(Perl_leave_scope+0xe43)[0x563231db2623] perl(Perl_pp_leave+0x70)[0x563231dbc6d0] perl(Perl_runops_standard+0x16)[0x563231d72896] perl(perl_run+0x319)[0x563231cf3fe9] perl(main+0x13d)[0x563231ccb28d] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f9679e203f1] perl(_start+0x2a)[0x563231ccb2ca] ======= Memory map: ======== 563231ca0000-563231e96000 r-xp 00000000 08:01 8786015 /home/peter/perl5/perlbrew/perls/alt/bin/perl 563232095000-56323209b000 r--p 001f5000 08:01 8786015 /home/peter/perl5/perlbrew/perls/alt/bin/perl 56323209b000-56323209d000 rw-p 001fb000 08:01 8786015 /home/peter/perl5/perlbrew/perls/alt/bin/perl 563232e63000-563233096000 rw-p 00000000 00:00 0 [heap] 7f9674000000-7f9674021000 rw-p 00000000 00:00 0 7f9674021000-7f9678000000 ---p 00000000 00:00 0 7f9678cff000-7f9678d15000 r-xp 00000000 08:01 1577506 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f9678d15000-7f9678f14000 ---p 00016000 08:01 1577506 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f9678f14000-7f9678f15000 r--p 00015000 08:01 1577506 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f9678f15000-7f9678f16000 rw-p 00016000 08:01 1577506 /lib/x86_64-linux-gnu/libgcc_s.so.1 7f9678f16000-7f9678f17000 ---p 00000000 00:00 0 7f9678f17000-7f9679717000 rw-p 00000000 00:00 0 7f9679717000-7f967971a000 r-xp 00000000 08:01 11407731 /home/peter/perl5/perlbrew/perls/alt/lib/site_perl/5.26.0/x86_64-linux-thread-multi/auto/Math/Random/MT/MT.so 7f967971a000-7f9679919000 ---p 00003000 08:01 11407731 /home/peter/perl5/perlbrew/perls/alt/lib/site_perl/5.26.0/x86_64-linux-thread-multi/auto/Math/Random/MT/MT.so 7f9679919000-7f967991a000 r--p 00002000 08:01 11407731 /home/peter/perl5/perlbrew/perls/alt/lib/site_perl/5.26.0/x86_64-linux-thread-multi/auto/Math/Random/MT/MT.so 7f967991a000-7f967991b000 rw-p 00003000 08:01 11407731 /home/peter/perl5/perlbrew/perls/alt/lib/site_perl/5.26.0/x86_64-linux-thread-multi/auto/Math/Random/MT/MT.so 7f967991b000-7f9679924000 r-xp 00000000 08:01 10620627 /home/peter/perl5/perlbrew/perls/alt/lib/5.26.0/x86_64-linux-thread-multi/auto/threads/threads.so 7f9679924000-7f9679b23000 ---p 00009000 08:01 10620627 /home/peter/perl5/perlbrew/perls/alt/lib/5.26.0/x86_64-linux-thread-multi/auto/threads/threads.so 7f9679b23000-7f9679b24000 r--p 00008000 08:01 10620627 /home/peter/perl5/perlbrew/perls/alt/lib/5.26.0/x86_64-linux-thread-multi/auto/threads/threads.so 7f9679b24000-7f9679b25000 rw-p 00009000 08:01 10620627 /home/peter/perl5/perlbrew/perls/alt/lib/5.26.0/x86_64-linux-thread-multi/auto/threads/threads.so 7f9679b25000-7f9679e00000 r--p 00000000 08:01 16782001 /usr/lib/locale/locale-archive 7f9679e00000-7f9679fbe000 r-xp 00000000 08:01 1572945 /lib/x86_64-linux-gnu/libc-2.24.so 7f9679fbe000-7f967a1bd000 ---p 001be000 08:01 1572945 /lib/x86_64-linux-gnu/libc-2.24.so 7f967a1bd000-7f967a1c1000 r--p 001bd000 08:01 1572945 /lib/x86_64-linux-gnu/libc-2.24.so 7f967a1c1000-7f967a1c3000 rw-p 001c1000 08:01 1572945 /lib/x86_64-linux-gnu/libc-2.24.so 7f967a1c3000-7f967a1c7000 rw-p 00000000 00:00 0 7f967a1c7000-7f967a1d0000 r-xp 00000000 08:01 1572947 /lib/x86_64-linux-gnu/libcrypt-2.24.so 7f967a1d0000-7f967a3cf000 ---p 00009000 08:01 1572947 /lib/x86_64-linux-gnu/libcrypt-2.24.so 7f967a3cf000-7f967a3d0000 r--p 00008000 08:01 1572947 /lib/x86_64-linux-gnu/libcrypt-2.24.so 7f967a3d0000-7f967a3d1000 rw-p 00009000 08:01 1572947 /lib/x86_64-linux-gnu/libcrypt-2.24.so 7f967a3d1000-7f967a3ff000 rw-p 00000000 00:00 0 7f967a3ff000-7f967a507000 r-xp 00000000 08:01 1572949 /lib/x86_64-linux-gnu/libm-2.24.so 7f967a507000-7f967a706000 ---p 00108000 08:01 1572949 /lib/x86_64-linux-gnu/libm-2.24.so 7f967a706000-7f967a707000 r--p 00107000 08:01 1572949 /lib/x86_64-linux-gnu/libm-2.24.so 7f967a707000-7f967a708000 rw-p 00108000 08:01 1572949 /lib/x86_64-linux-gnu/libm-2.24.so 7f967a708000-7f967a70b000 r-xp 00000000 08:01 1572948 /lib/x86_64-linux-gnu/libdl-2.24.so 7f967a70b000-7f967a90a000 ---p 00003000 08:01 1572948 /lib/x86_64-linux-gnu/libdl-2.24.so 7f967a90a000-7f967a90b000 r--p 00002000 08:01 1572948 /lib/x86_64-linux-gnu/libdl-2.24.so 7f967a90b000-7f967a90c000 rw-p 00003000 08:01 1572948 /lib/x86_64-linux-gnu/libdl-2.24.so 7f967a90c000-7f967a924000 r-xp 00000000 08:01 1572960 /lib/x86_64-linux-gnu/libpthread-2.24.so 7f967a924000-7f967ab24000 ---p 00018000 08:01 1572960 /lib/x86_64-linux-gnu/libpthread-2.24.so 7f967ab24000-7f967ab25000 r--p 00018000 08:01 1572960 /lib/x86_64-linux-gnu/libpthread-2.24.so 7f967ab25000-7f967ab26000 rw-p 00019000 08:01 1572960 /lib/x86_64-linux-gnu/libpthread-2.24.so 7f967ab26000-7f967ab2a000 rw-p 00000000 00:00 0 7f967ab2a000-7f967ab50000 r-xp 00000000 08:01 1572869 /lib/x86_64-linux-gnu/ld-2.24.so 7f967ad31000-7f967ad33000 rw-p 00000000 00:00 0 7f967ad4b000-7f967ad4f000 rw-p 00000000 00:00 0 7f967ad4f000-7f967ad50000 r--p 00025000 08:01 1572869 /lib/x86_64-linux-gnu/ld-2.24.so 7f967ad50000-7f967ad51000 rw-p 00026000 08:01 1572869 /lib/x86_64-linux-gnu/ld-2.24.so 7f967ad51000-7f967ad52000 rw-p 00000000 00:00 0 7ffdaef71000-7ffdaef92000 rw-p 00000000 00:00 0 [stack] 7ffdaefe8000-7ffdaefea000 r--p 00000000 00:00 0 [vvar] 7ffdaefea000-7ffdaefec000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] fish: “perl mt_test.pl” terminated by signal SIGABRT (Abort)