Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

op/threads.t segfaults with threads and mymalloc #10459

Open
p5pRT opened this issue Jun 22, 2010 · 7 comments
Open

op/threads.t segfaults with threads and mymalloc #10459

p5pRT opened this issue Jun 22, 2010 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 22, 2010

Migrated from rt.perl.org#75972 (status was 'open')

Searchable as RT75972$

@p5pRT
Copy link
Author

p5pRT commented Jun 22, 2010

From perl@profvince.com

Created by perl@profvince.com

The following code, which is a reduced testcase for the op/threads.t failure, segfaults for a perl built with threads and mymalloc enabled :

  #!perl
 
  # Requires threads and mymalloc
 
  use strict;
  use warnings;
  use threads;
 
  my @​t;
  push @​t, threads->create( sub { require IO }) for 1 .. 1000;
  $_->join for grep defined, @​t;

It also sometimes aborts with this assertion failure :

  assertion botched (free()ed/realloc()ed-away memory was overwritten?)​: !(MallocCfg[MallocCfg_filldead] && MallocCfg[MallocCfg_fillcheck]) || !cmp_pat_4bytes((unsigned char*)(p + 1), (((1 << ((bucket) >> 0)) + ((bucket >= 15 * 1) ? 4096 : 0)) - (sizeof(union overhead) + sizeof (unsigned int))) + sizeof (unsigned int), fill_deadbeef) (malloc.c​:1546)

Valgrind says :

...
==22779== Invalid read of size 4
==22779== at 0x5533F8​: Perl_hv_common (hv.c​:361)
==22779== by 0x464F55​: perl_get_emergency_buffer (malloc.c​:1160)
==22779== by 0x4656B9​: emergency_sbrk (malloc.c​:1256)
==22779== by 0x46688B​: getpages (malloc.c​:1717)
==22779== by 0x46747F​: morecore (malloc.c​:1965)
==22779== by 0x465C60​: Perl_malloc (malloc.c​:1477)
==22779== by 0x5D6008​: Perl_ptr_table_store (sv.c​:10840)
==22779== by 0x55300D​: Perl_he_dup (hv.c​:175)
==22779== by 0x5D92D6​: S_sv_dup_common (sv.c​:11273)
==22779== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==22779== by 0x5D59D2​: Perl_gp_dup (sv.c​:10694)
==22779== by 0x5D8969​: S_sv_dup_common (sv.c​:11194)
==22779== Address 0xabababababababb7 is not stack'd, malloc'd or (recently) free'd
==22779==
==22779==
==22779== Process terminating with default action of signal 11 (SIGSEGV)
==22779== General Protection Fault
==22779== at 0x5533F8​: Perl_hv_common (hv.c​:361)
==22779== by 0x464F55​: perl_get_emergency_buffer (malloc.c​:1160)
==22779== by 0x4656B9​: emergency_sbrk (malloc.c​:1256)
==22779== by 0x46688B​: getpages (malloc.c​:1717)
==22779== by 0x46747F​: morecore (malloc.c​:1965)
==22779== by 0x465C60​: Perl_malloc (malloc.c​:1477)
==22779== by 0x5D6008​: Perl_ptr_table_store (sv.c​:10840)
==22779== by 0x55300D​: Perl_he_dup (hv.c​:175)
==22779== by 0x5D92D6​: S_sv_dup_common (sv.c​:11273)
==22779== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==22779== by 0x5D59D2​: Perl_gp_dup (sv.c​:10694)
==22779== by 0x5D8969​: S_sv_dup_common (sv.c​:11194)
==22779==
==22779== HEAP SUMMARY​:
...

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl 5.13.2:

Configured by vince at Tue Jun 22 23:29:08 CEST 2010.

Summary of my perl5 (revision 5 version 13 subversion 2) configuration:
  Commit id: e4b5ce810b542fc115cb7db392c771730fc4f98e
  Platform:
    osname=linux, osvers=2.6.34-fuuka.profvince.com, archname=x86_64-linux-thread-multi
    uname='linux fuuka 2.6.34-fuuka.profvince.com #1 smp wed jun 16 22:13:24 cest 2010 x86_64 intel(r) core(tm)2 duo cpu e6750 @ 2.66ghz genuineintel gnulinux '
    config_args='-Doptimize= -g3 -des -Dusedevel -Dman1dir=none -Dman3dir=none -Dcf_email=vpit@cpan.org -Dmydomain=fuuka.profvince.com -Dusedevel -DDEBUGGING -Dusethreads -Dusemmorebits -Dusemymalloc -Dprefix=/home/vince/perl/builds/dbg/thr/64/mm/5.13.1-223-ge4b5ce8'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=y, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize=' -g3',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector'
    ccversion='', gccversion='4.4.4', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    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 -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.11.2.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.11.2'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared  -g3 -L/usr/local/lib -fstack-protector'

Locally applied patches:
    


@INC for perl 5.13.2:
    lib
    /home/vince/perl/builds/dbg/thr/64/mm/5.13.1-223-ge4b5ce8/lib/site_perl/5.13.2/x86_64-linux-thread-multi
    /home/vince/perl/builds/dbg/thr/64/mm/5.13.1-223-ge4b5ce8/lib/site_perl/5.13.2
    /home/vince/perl/builds/dbg/thr/64/mm/5.13.1-223-ge4b5ce8/lib/5.13.2/x86_64-linux-thread-multi
    /home/vince/perl/builds/dbg/thr/64/mm/5.13.1-223-ge4b5ce8/lib/5.13.2
    .


Environment for perl 5.13.2:
    HOME=/home/vince
    LANG=fr_FR.UTF-8
    LANGUAGE (unset)
    LC_ALL=fr_FR.UTF-8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/vince/bin:/home/vince/perl/builds/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4:/opt/intel/cce/10.1.018/bin:/usr/games/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash


@p5pRT
Copy link
Author

p5pRT commented Jun 22, 2010

From perl@profvince.com

Valgrind with more callers :

...
==23560== Invalid read of size 4
==23560== at 0x5533F8​: Perl_hv_common (hv.c​:361)
==23560== by 0x464F55​: perl_get_emergency_buffer (malloc.c​:1160)
==23560== by 0x4656B9​: emergency_sbrk (malloc.c​:1256)
==23560== by 0x46688B​: getpages (malloc.c​:1717)
==23560== by 0x46747F​: morecore (malloc.c​:1965)
==23560== by 0x465C60​: Perl_malloc (malloc.c​:1477)
==23560== by 0x584CC9​: S_more_sv (sv.c​:266)
==23560== by 0x5D70B6​: S_sv_dup_common (sv.c​:11039)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5531E2​: Perl_he_dup (hv.c​:205)
==23560== by 0x5D92D6​: S_sv_dup_common (sv.c​:11273)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5D59D2​: Perl_gp_dup (sv.c​:10694)
==23560== by 0x5D8969​: S_sv_dup_common (sv.c​:11194)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5531E2​: Perl_he_dup (hv.c​:205)
==23560== by 0x5D92D6​: S_sv_dup_common (sv.c​:11273)
==23560== by 0x5D9ADF​: Perl_sv_dup (sv.c​:11357)
==23560== by 0x5D83A1​: S_sv_dup_common (sv.c​:11181)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x4D8DD7​: Perl_padlist_dup (pad.c​:1878)
==23560== by 0x5D9876​: S_sv_dup_common (sv.c​:11329)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5D5A34​: Perl_gp_dup (sv.c​:10696)
==23560== by 0x5D8969​: S_sv_dup_common (sv.c​:11194)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5531E2​: Perl_he_dup (hv.c​:205)
==23560== by 0x55302B​: Perl_he_dup (hv.c​:177)
==23560== by 0x5D92D6​: S_sv_dup_common (sv.c​:11273)
==23560== by 0x5D9ADF​: Perl_sv_dup (sv.c​:11357)
==23560== by 0x5D9603​: S_sv_dup_common (sv.c​:11316)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5D5A34​: Perl_gp_dup (sv.c​:10696)
==23560== by 0x5D8969​: S_sv_dup_common (sv.c​:11194)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5531E2​: Perl_he_dup (hv.c​:205)
==23560== by 0x5D92D6​: S_sv_dup_common (sv.c​:11273)
==23560== by 0x5D9ADF​: Perl_sv_dup (sv.c​:11357)
==23560== by 0x5D9603​: S_sv_dup_common (sv.c​:11316)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5D5A34​: Perl_gp_dup (sv.c​:10696)
==23560== by 0x5D8969​: S_sv_dup_common (sv.c​:11194)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5531E2​: Perl_he_dup (hv.c​:205)
==23560== by 0x5D92D6​: S_sv_dup_common (sv.c​:11273)
==23560== by 0x5D9ADF​: Perl_sv_dup (sv.c​:11357)
==23560== by 0x5D83A1​: S_sv_dup_common (sv.c​:11181)
==23560== by 0x5D9ADF​: Perl_sv_dup (sv.c​:11357)
==23560== by 0x5DD13D​: perl_clone (sv.c​:12157)
==23560== by 0x6466F55​: S_ithread_create (threads.xs​:769)
==23560== Address 0xabababababababb7 is not stack'd, malloc'd or
(recently) free'd
==23560==
==23560==
==23560== Process terminating with default action of signal 11 (SIGSEGV)
==23560== General Protection Fault
==23560== at 0x5533F8​: Perl_hv_common (hv.c​:361)
==23560== by 0x464F55​: perl_get_emergency_buffer (malloc.c​:1160)
==23560== by 0x4656B9​: emergency_sbrk (malloc.c​:1256)
==23560== by 0x46688B​: getpages (malloc.c​:1717)
==23560== by 0x46747F​: morecore (malloc.c​:1965)
==23560== by 0x465C60​: Perl_malloc (malloc.c​:1477)
==23560== by 0x584CC9​: S_more_sv (sv.c​:266)
==23560== by 0x5D70B6​: S_sv_dup_common (sv.c​:11039)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5531E2​: Perl_he_dup (hv.c​:205)
==23560== by 0x5D92D6​: S_sv_dup_common (sv.c​:11273)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5D59D2​: Perl_gp_dup (sv.c​:10694)
==23560== by 0x5D8969​: S_sv_dup_common (sv.c​:11194)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5531E2​: Perl_he_dup (hv.c​:205)
==23560== by 0x5D92D6​: S_sv_dup_common (sv.c​:11273)
==23560== by 0x5D9ADF​: Perl_sv_dup (sv.c​:11357)
==23560== by 0x5D83A1​: S_sv_dup_common (sv.c​:11181)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x4D8DD7​: Perl_padlist_dup (pad.c​:1878)
==23560== by 0x5D9876​: S_sv_dup_common (sv.c​:11329)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5D5A34​: Perl_gp_dup (sv.c​:10696)
==23560== by 0x5D8969​: S_sv_dup_common (sv.c​:11194)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5531E2​: Perl_he_dup (hv.c​:205)
==23560== by 0x55302B​: Perl_he_dup (hv.c​:177)
==23560== by 0x5D92D6​: S_sv_dup_common (sv.c​:11273)
==23560== by 0x5D9ADF​: Perl_sv_dup (sv.c​:11357)
==23560== by 0x5D9603​: S_sv_dup_common (sv.c​:11316)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5D5A34​: Perl_gp_dup (sv.c​:10696)
==23560== by 0x5D8969​: S_sv_dup_common (sv.c​:11194)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5531E2​: Perl_he_dup (hv.c​:205)
==23560== by 0x5D92D6​: S_sv_dup_common (sv.c​:11273)
==23560== by 0x5D9ADF​: Perl_sv_dup (sv.c​:11357)
==23560== by 0x5D9603​: S_sv_dup_common (sv.c​:11316)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5D5A34​: Perl_gp_dup (sv.c​:10696)
==23560== by 0x5D8969​: S_sv_dup_common (sv.c​:11194)
==23560== by 0x5D9A7C​: Perl_sv_dup_inc (sv.c​:11351)
==23560== by 0x5531E2​: Perl_he_dup (hv.c​:205)
==23560== by 0x5D92D6​: S_sv_dup_common (sv.c​:11273)
==23560== by 0x5D9ADF​: Perl_sv_dup (sv.c​:11357)
==23560== by 0x5D83A1​: S_sv_dup_common (sv.c​:11181)
==23560== by 0x5D9ADF​: Perl_sv_dup (sv.c​:11357)
==23560== by 0x5DD13D​: perl_clone (sv.c​:12157)
==23560== by 0x6466F55​: S_ithread_create (threads.xs​:769)
==23560==
==23560== HEAP SUMMARY​:
...

@p5pRT
Copy link
Author

p5pRT commented Dec 12, 2013

From @jkeenan

On Tue Jun 22 14​:58​:31 2010, perl@​profvince.com wrote​:

This is a bug report for perl from perl@​profvince.com,
generated with the help of perlbug 1.39 running under perl 5.13.2.

-----------------------------------------------------------------
[Please describe your issue here]

The following code, which is a reduced testcase for the op/threads.t
failure, segfaults for a perl built with threads and mymalloc enabled
:

#!perl

# Requires threads and mymalloc

use strict;
use warnings;
use threads;

my @​t;
push @​t, threads->create( sub { require IO }) for 1 .. 1000;
$_->join for grep defined, @​t;

It also sometimes aborts with this assertion failure :

assertion botched (free()ed/realloc()ed-away memory was overwritten?)​:
!(MallocCfg[MallocCfg_filldead] && MallocCfg[MallocCfg_fillcheck]) ||
!cmp_pat_4bytes((unsigned char*)(p + 1), (((1 << ((bucket) >> 0)) +
((bucket >= 15 * 1) ? 4096 : 0)) - (sizeof(union overhead) + sizeof
(unsigned int))) + sizeof (unsigned int), fill_deadbeef)
(malloc.c​:1546)

Valgrind says :

[snip Valgrind output; see OP]

-----------------------------------------------------------------
---
Flags​:
category=core
severity=low
---
Site configuration information for perl 5.13.2​:

Configured by vince at Tue Jun 22 23​:29​:08 CEST 2010.

Summary of my perl5 (revision 5 version 13 subversion 2)
configuration​:
Commit id​: e4b5ce8
Platform​:
osname=linux, osvers=2.6.34-fuuka.profvince.com, archname=x86_64-
linux-thread-multi
uname='linux fuuka 2.6.34-fuuka.profvince.com #1 smp wed jun 16
22​:13​:24 cest 2010 x86_64 intel(r) core(tm)2 duo cpu e6750 @​ 2.66ghz
genuineintel gnulinux '
config_args='-Doptimize= -g3 -des -Dusedevel -Dman1dir=none
-Dman3dir=none -Dcf_email=vpit@​cpan.org -Dmydomain=fuuka.profvince.com
-Dusedevel -DDEBUGGING -Dusethreads -Dusemmorebits -Dusemymalloc
-Dprefix=/home/vince/perl/builds/dbg/thr/64/mm/5.13.1-223-ge4b5ce8'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define,
usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=y, bincompat5005=undef
Compiler​:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-
strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
optimize=' -g3',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-
aliasing -pipe -fstack-protector'
ccversion='', gccversion='4.4.4', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=16
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 -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64
/usr/local/lib64
libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
-lgdbm_compat
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.11.2.so, so=so, useshrplib=false,
libperl=libperl.a
gnulibc_version='2.11.2'
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -g3 -L/usr/local/lib
-fstack-protector'

Locally applied patches​:

---
@​INC for perl 5.13.2​:
lib
/home/vince/perl/builds/dbg/thr/64/mm/5.13.1-223-
ge4b5ce8/lib/site_perl/5.13.2/x86_64-linux-thread-multi
/home/vince/perl/builds/dbg/thr/64/mm/5.13.1-223-
ge4b5ce8/lib/site_perl/5.13.2
/home/vince/perl/builds/dbg/thr/64/mm/5.13.1-223-
ge4b5ce8/lib/5.13.2/x86_64-linux-thread-multi
/home/vince/perl/builds/dbg/thr/64/mm/5.13.1-223-
ge4b5ce8/lib/5.13.2
.

---
Environment for perl 5.13.2​:
HOME=/home/vince
LANG=fr_FR.UTF-8
LANGUAGE (unset)
LC_ALL=fr_FR.UTF-8
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/home/vince/bin​:/home/vince/perl/builds/bin​:/usr/local/bin​:/usr/bin​:/bin​:/opt/bin​:/usr/x86_64-
pc-linux-gnu/gcc-bin/4.4.4​:/opt/intel/cce/10.1.018/bin​:/usr/games/bin
PERL_BADLANG (unset)
SHELL=/bin/bash

This problem appears to still be present in blead.

At commit 4b76cb9, I configured as follows​:

#####
sh ./Configure -des -Dusedevel -Doptimize=-g3 -DDEBUGGING -Dusethreads -Dusemmorebits -Dusemymalloc
#####

... which was as close to the OP's configuration as I could understand. I built perl successfully. All tests in t/op/threads.t passed. However, I also tried a script based on the OP's script; see attached.

At 1000 repetitions, the program completed successfully. However at 5000 reps I got a seg fault and at 10000 I got something like the weird results the OP posted.

#####
[perl] 1011 $ ./perl -Ilib ../p5p/75972-threads.pl 5000
Segmentation fault
[perl] 1012 $ ./perl -Ilib ../p5p/75972-threads.pl 10000
assertion botched (assertion botched (free()ed/realloc()ed-away memory was overwrittenfree()ed/realloc()ed-away memory was overwritten?)​: ?)​: !(MallocCfg[MallocCfg_filldead] && MallocCfg[MallocCfg_fillcheck]) || !cmp_pat_4bytes((unsigned char*)(p + 1), (((1 << ((bucket) >> 0)) + ((bucket >= 15 * 1) ? 4096 : 0)) - (sizeof(union overhead) + sizeof (unsigned int))) + sizeof (unsigned int), fill_deadbeef)!(MallocCfg[MallocCfg_filldead] && MallocCfg[MallocCfg_fillcheck]) || !cmp_pat_4bytes((unsigned char*)(p + 1), (((1 << ((bucket) >> 0)) + ((bucket >= 15 * 1) ? 4096 : 0)) - (sizeof(union overhead) + sizeof (unsigned int))) + sizeof (unsigned int), fill_deadbeef) ( (malloc.cmalloc.c​::13451345)
)
Aborted
#####

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Dec 12, 2013

From @jkeenan

75972-threads.pl

@p5pRT
Copy link
Author

p5pRT commented Dec 12, 2013

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Dec 12, 2013

From @jkeenan

On Wed Dec 11 19​:05​:02 2013, jkeenan wrote​:

This problem appears to still be present in blead.

At commit 4b76cb9, I configured as
follows​:

#####
sh ./Configure -des -Dusedevel -Doptimize=-g3 -DDEBUGGING -Dusethreads
-Dusemmorebits -Dusemymalloc
#####

... which was as close to the OP's configuration as I could
understand. I built perl successfully. All tests in t/op/threads.t
passed. However, I also tried a script based on the OP's script; see
attached.

At 1000 repetitions, the program completed successfully. However at
5000 reps I got a seg fault and at 10000 I got something like the
weird results the OP posted.

#####
[perl] 1011 $ ./perl -Ilib ../p5p/75972-threads.pl 5000
Segmentation fault
[perl] 1012 $ ./perl -Ilib ../p5p/75972-threads.pl 10000
assertion botched (assertion botched (free()ed/realloc()ed-away memory
was overwrittenfree()ed/realloc()ed-away memory was overwritten?)​: ?)​:
!(MallocCfg[MallocCfg_filldead] && MallocCfg[MallocCfg_fillcheck]) ||
!cmp_pat_4bytes((unsigned char*)(p + 1), (((1 << ((bucket) >> 0)) +
((bucket >= 15 * 1) ? 4096 : 0)) - (sizeof(union overhead) + sizeof
(unsigned int))) + sizeof (unsigned int),
fill_deadbeef)!(MallocCfg[MallocCfg_filldead] &&
MallocCfg[MallocCfg_fillcheck]) || !cmp_pat_4bytes((unsigned char*)(p
+ 1), (((1 << ((bucket) >> 0)) + ((bucket >= 15 * 1) ? 4096 : 0)) -
(sizeof(union overhead) + sizeof (unsigned int))) + sizeof (unsigned
int), fill_deadbeef) ( (malloc.cmalloc.c​::13451345)
)
Aborted
#####

I next configured the same way except omitting the '-mymalloc'​:

#####
sh ./Configure -des -Dusedevel -Doptimize=-g3 -DDEBUGGING -Dusethreads -Dusemmorebits
#####

This time, my test script completed successfully at each of 1000, 5000, and 10000 reps. (The 10,000 rep case took 2​:48 to run on dromedary.)

So '-Dmymalloc' appears to be the most problematic argument.

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented May 22, 2019

From @jkeenan

On Thu, 12 Dec 2013 03​:18​:20 GMT, jkeenan wrote​:

On Wed Dec 11 19​:05​:02 2013, jkeenan wrote​:

This problem appears to still be present in blead.

At commit 4b76cb9, I configured as
follows​:

#####
sh ./Configure -des -Dusedevel -Doptimize=-g3 -DDEBUGGING
-Dusethreads
-Dusemmorebits -Dusemymalloc
#####

... which was as close to the OP's configuration as I could
understand. I built perl successfully. All tests in t/op/threads.t
passed. However, I also tried a script based on the OP's script; see
attached.

At 1000 repetitions, the program completed successfully. However at
5000 reps I got a seg fault and at 10000 I got something like the
weird results the OP posted.

#####
[perl] 1011 $ ./perl -Ilib ../p5p/75972-threads.pl 5000
Segmentation fault
[perl] 1012 $ ./perl -Ilib ../p5p/75972-threads.pl 10000
assertion botched (assertion botched (free()ed/realloc()ed-away
memory
was overwrittenfree()ed/realloc()ed-away memory was overwritten?)​:
?)​:
!(MallocCfg[MallocCfg_filldead] && MallocCfg[MallocCfg_fillcheck]) ||
!cmp_pat_4bytes((unsigned char*)(p + 1), (((1 << ((bucket) >> 0)) +
((bucket >= 15 * 1) ? 4096 : 0)) - (sizeof(union overhead) + sizeof
(unsigned int))) + sizeof (unsigned int),
fill_deadbeef)!(MallocCfg[MallocCfg_filldead] &&
MallocCfg[MallocCfg_fillcheck]) || !cmp_pat_4bytes((unsigned char*)(p
+ 1), (((1 << ((bucket) >> 0)) + ((bucket >= 15 * 1) ? 4096 : 0)) -
(sizeof(union overhead) + sizeof (unsigned int))) + sizeof (unsigned
int), fill_deadbeef) ( (malloc.cmalloc.c​::13451345)
)
Aborted
#####

I next configured the same way except omitting the '-mymalloc'​:

Should have typed​: "except omitting the '-Dusemymalloc'​:"

#####
sh ./Configure -des -Dusedevel -Doptimize=-g3 -DDEBUGGING -Dusethreads
-Dusemmorebits
#####

This time, my test script completed successfully at each of 1000,
5000, and 10000 reps. (The 10,000 rep case took 2​:48 to run on
dromedary.)

So '-Dmymalloc' appears to be the most problematic argument.

Should have typed​: "So '-Dusemymalloc' appears to be the most problematic argument."

Thank you very much.
Jim Keenan

--
James E Keenan (jkeenan@​cpan.org)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants