develooper Front page | perl.perl5.porters | Postings from May 2013

[perl #118055] miniperl fails with SIGBUS on sparc (usethreads+use64bitint)

Thread Next
Niko Tyni
May 19, 2013 19:51
[perl #118055] miniperl fails with SIGBUS on sparc (usethreads+use64bitint)
Message ID:
# New Ticket Created by  Niko Tyni 
# Please include the string:  [perl #118055]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from Niko Tyni <>,
generated with the help of perlbug 1.39 running under perl 5.18.0.

[ Sorry about the timing, it took a week for our sparc build server to get
  round to building 5.18.0-RC1, and we got the result just hours after
  the 5.18.0 release. ]

5.18.0 build fails on sparc with -Dusethreads -Duse64bitint.
miniperl gets a SIGBUS with just about any non-trivial program.

  ./miniperl -w -Ilib -MExporter -e '<?>' || /usr/bin/make minitest
  ./miniperl -Ilib
  make[1]: *** [lib/] Bus error

An example backtrace:
  Starting program: /home/ntyni/perl/miniperl -e s/a/b/
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library "/lib/sparc-linux-gnu/".
  Program received signal SIGBUS, Bus error.
  0x0002ffcc in Perl_newPMOP (my_perl=0x26e008, type=33, flags=0) at op.c:4458
  4458        pmop->op_pmoffset = av_len(PL_regex_padav);
  (gdb) bt
  #0  0x0002ffcc in Perl_newPMOP (my_perl=0x26e008, type=33, flags=0) at op.c:4458
  #1  0x0008c56c in S_scan_subst (my_perl=0x26e008, start=0x28c8f1 "/a/b/\n") at toke.c:9650
  #2  0x0008421c in Perl_yylex (my_perl=0x26e008) at toke.c:8353
  #3  0x000957e8 in Perl_yyparse (my_perl=0x26e008, gramtype=258) at perly.c:341
  #4  0x00018294 in S_parse_body (my_perl=0x26e008, env=0x0, xsinit=0x4cfa4 <xs_init>) at perl.c:2309
  #5  0x00016d94 in perl_parse (my_perl=0x26e008, xsinit=0x4cfa4 <xs_init>, argc=3, argv=0xffffdd04, 
      env=0x0) at perl.c:1626
  #6  0x0004ce68 in main (argc=3, argv=0xffffdd04, env=0xffffdd14) at miniperlmain.c:111

This is also 
and a full build log is at

Perlbugging this with a non-threaded build. All the tests pass with that.
The actual Configure arguments used for testing were

 ./Configure -Doptimize="-g -O0" -des -Dusethreads -Duse64bitint

and both -Dusethreads -Duse64bitint are needed to trigger it.

Seen with gcc 4.4, 4.6 and 4.8, at both -O0 and -O2.
Also tried -DDEBUGGING with no visible difference.

Bisecting says the first bad commit is

commit 8be227ab5eaa23f2d21fd15f70190e494496dcbe
Author: Father Chrysostomos <>
Date:   Sat Jun 23 09:54:31 2012 -0700

    CV-based slab allocation for ops

Site configuration information for perl 5.18.0:

Configured by ntyni at Sun May 19 16:39:10 UTC 2013.

Summary of my perl5 (revision 5 version 18 subversion 0) configuration:
  Commit id: a9acda3b5f74585852a57b51b724804ac586cb0b
    osname=linux, osvers=2.6.32-5-sparc64-smp, archname=sparc-linux-64int
    uname='linux smetana 2.6.32-5-sparc64-smp #1 smp mon feb 25 02:19:08 utc 2013 sparc gnulinux '
    config_args='-Doptimize=-g -O0 -des -Duse64bitint'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-g -O0',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.6.3', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long 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/sparc-linux-gnu /lib/../lib /usr/lib/sparc-linux-gnu /usr/lib/../lib /lib /usr/lib /lib64 /usr/lib64
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags=' -fPIC', lddlflags='-shared -g -O0 -L/usr/local/lib -fstack-protector'

Locally applied patches:

@INC for perl 5.18.0:

Environment for perl 5.18.0:
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About