develooper Front page | perl.perl5.porters | Postings from November 2000

[5.6.0] coredump on caller(1) from die handler

Thread Next
From:
hv
Date:
November 20, 2000 10:49
Subject:
[5.6.0] coredump on caller(1) from die handler
Message ID:
200011201348.NAA13481@hugo.hybyte.com
I think this example code is fairly minimal; I haven't checked it on a
non-threading perl yet. The coredump also occurs under 5.7.0, but not
in bleadperl; if anyone can identify which patch fixed it, I'd be very
grateful. The coredump occurs in pp_caller trying to get CopSTASHPV
from a stale cx->blk_oldcop.

Hugo% perl -cw t0
Test failure at Test/Die.pm line 2.
Compilation failed in require at t0 line 13.
BEGIN failed--compilation aborted at t0 line 13.
Hugo% perl -cwe 'use Test::Handle; use Test::Die; print "ok\n"'
logfatal: <Test> <Test/Die.pm> <2> (Test failure at Test/Die.pm line 2.
)
Segmentation fault (core dumped)
Hugo% cat Test/Handle.pm
package Test::Handle;
use strict;
$SIG{__DIE__} = sub {
    logfatal(@_);
        die @_;
};

sub logfatal {
        my($pack, $mod, $line) = caller(1);
        warn "logfatal: <$pack> <$mod> <$line> (@_)\n";
}

1;
Hugo% cat Test/Die.pm 
package Test;
die "Test failure";
1;
Hugo% 

---
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.14-5.0, archname=i686-linux-thread
    uname='linux hugo 2.2.14-5.0 #1 tue mar 7 21:07:39 est 2000 i686 unknown '
    config_args='-des -Doptimize=-g -O6 -Dprefix=/opt/perl-5.6.0 -Dusethreads -Duse5005threads -Dusedevel'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=define useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='cc', optimize='-g -O6', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
    cppflags='-D_REENTRANT -DDEBUGGING -fno-strict-aliasing'
    ccflags ='-D_REENTRANT -DDEBUGGING -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    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, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lpthread -lc -lposix -lcrypt
    libc=/lib/libc-2.1.3.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: DEBUGGING USE_THREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at Oct 26 2000 11:23:53
  @INC:
    /opt/perl-5.6.0/lib/5.6.0/i686-linux-thread
    /opt/perl-5.6.0/lib/5.6.0
    /opt/perl-5.6.0/lib/site_perl/5.6.0/i686-linux-thread
    /opt/perl-5.6.0/lib/site_perl/5.6.0
    /opt/perl-5.6.0/lib/site_perl
    .

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About