Subject: | Segfault when used with Scope::Upper |
When using Scope::Upper's unwind under profiling, my application dumps
core. This doesn't happen without profiling (it behaves correctly).
Unfortunatelly, i can't provide short and simple example (it happens
only in real world, short apps works OK), only stacktrace in attachment.
Algorythm i use is like:
1. save current scope pointer (HERE)
2. do { call->call->call->call->unwind saved scope }
3. unwind to saved scope (here it segfaults)
My enviroment is:
% perl -e 'use Scope::Upper; print $Scope::Upper::VERSION'
0.09
% perl -e 'use Devel::NYTProf; print $Devel::NYTProf::VERSION'
2.10
% perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=freebsd, osvers=7.0-release, archname=i386-freebsd-64int
uname='freebsd begom.com 7.0-release freebsd 7.0-release #1: tue feb
10 11:29:32 msk 2009 inferno@begom.com:usrobjusrsrcrelease-7.0sysbegom
i386 '
config_args='-sde -Dprefix=/usr/local
-Darchlib=/usr/local/lib/perl5/5.8.8/mach
-Dprivlib=/usr/local/lib/perl5/5.8.8
-Dman3dir=/usr/local/lib/perl5/5.8.8/perl/man/man3
-Dman1dir=/usr/local/man/man1
-Dsitearch=/usr/local/lib/perl5/site_perl/5.8.8/mach
-Dsitelib=/usr/local/lib/perl5/site_perl/5.8.8
-Dscriptdir=/usr/local/bin
-Dsiteman3dir=/usr/local/lib/perl5/5.8.8/man/man3
-Dsiteman1dir=/usr/local/man/man1 -Ui_malloc -Ui_iconv
-Uinstallusrbinperl -Dcc=cc -Duseshrplib
-Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.8/BSDPAN"
-Doptimize=-g -ggdb -DDEBUGGING -Ud_dosuid -Ui_gdbm -Dusethreads=n
-Dusemymalloc=y -Duse64bitint'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=undef uselongdouble=undef
usemymalloc=y, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.8/BSDPAN"
-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DDEBUGGING -fno-strict-aliasing
-pipe -Wdeclaration-after-statement -I/usr/local/include',
optimize='-g -ggdb',
cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.8/BSDPAN"
-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DDEBUGGING -fno-strict-aliasing
-pipe -Wdeclaration-after-statement -I/usr/local/include'
ccversion='', gccversion='4.2.1 20070719 [FreeBSD]', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long long', ivsize=8, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -Wl,-E -L/usr/local/lib'
libpth=/usr/lib /usr/local/lib
libs=-lm -lcrypt -lutil
perllibs=-lm -lcrypt -lutil
libc=, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='
-Wl,-R/usr/local/lib/perl5/5.8.8/mach/CORE'
cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING MYMALLOC PERL_MALLOC_WRAP USE_64_BIT_INT
USE_LARGE_FILES USE_PERLIO
Locally applied patches:
defined-or
Built under freebsd
Compiled at May 27 2009 07:15:34
@INC:
/usr/local/lib/perl5/5.8.8/BSDPAN
/usr/local/lib/perl5/site_perl/5.8.8/mach
/usr/local/lib/perl5/site_perl/5.8.8
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.8.8/mach
/usr/local/lib/perl5/5.8.8
.
Subject: | coredump.txt |
% gdb /usr/local/bin/perl /var/tmp/perl5.8.8.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
warning: core file may not match specified executable file.
Core was generated by `perl5.8.8'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so
Reading symbols from /lib/libm.so.5...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /lib/libcrypt.so.4...done.
Loaded symbols for /lib/libcrypt.so.4
Reading symbols from /lib/libutil.so.7...done.
Loaded symbols for /lib/libutil.so.7
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/Devel/auto/Devel/NYTProf/NYTProf.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/Devel/auto/Devel/NYTProf/NYTProf.so
Reading symbols from /usr/lib/librt.so.1...done.
Loaded symbols for /usr/lib/librt.so.1
Reading symbols from /lib/libz.so.4...done.
Loaded symbols for /lib/libz.so.4
Reading symbols from
/usr/local/lib/perl5/5.8.8/mach/auto/List/Util/Util.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/List/Util/Util.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/B/Hooks/OP/Check/Check.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/auto/B/Hooks/OP/Check/Check.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Devel/Declare/Declare.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Devel/Declare/Declare.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/DBI/DBI.so...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/DBI/DBI.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Scope/Upper/Upper.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Scope/Upper/Upper.so
Reading symbols from
/usr/local/lib/perl5/5.8.8/mach/auto/Time/HiRes/HiRes.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/Time/HiRes/HiRes.so
Reading symbols from
/usr/local/lib/perl5/5.8.8/mach/auto/Encode/Encode.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/Encode/Encode.so
Reading symbols from
/usr/local/lib/perl5/5.8.8/mach/auto/Fcntl/Fcntl.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/Fcntl/Fcntl.so
Reading symbols from
/usr/local/lib/perl5/5.8.8/mach/auto/Storable/Storable.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/Storable/Storable.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Cache/Memcached/Fast/Fast.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Cache/Memcached/Fast/Fast.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Data/Dumper/Dumper.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Data/Dumper/Dumper.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Unix/Syslog/Syslog.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Unix/Syslog/Syslog.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/List/MoreUtils/MoreUtils.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/auto/List/MoreUtils/MoreUtils.so
Reading symbols from
/usr/local/lib/perl5/5.8.8/mach/auto/MIME/Base64/Base64.so...done.
Loaded symbols for
//usr/local/lib/perl5/5.8.8/mach/auto/MIME/Base64/Base64.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Digest/SHA/SHA.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Digest/SHA/SHA.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/IO/KQueue/KQueue.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/auto/IO/KQueue/KQueue.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Heap/Fibonacci/Fast/Fast.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Heap/Fibonacci/Fast/Fast.so
Reading symbols from
/usr/local/lib/perl5/5.8.8/mach/auto/POSIX/POSIX.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/POSIX/POSIX.so
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/auto/IO/IO.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/IO/IO.so
Reading symbols from
/usr/local/lib/perl5/5.8.8/mach/auto/Socket/Socket.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/Socket/Socket.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Math/Random/ISAAC/XS/XS.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Math/Random/ISAAC/XS/XS.so
Reading symbols from
/usr/local/lib/perl5/5.8.8/mach/auto/Digest/MD5/MD5.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/Digest/MD5/MD5.so
Reading symbols from
/usr/local/lib/perl5/5.8.8/mach/auto/File/Glob/Glob.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/File/Glob/Glob.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Compress/Raw/Zlib/Zlib.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Compress/Raw/Zlib/Zlib.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/version/vxs/vxs.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/auto/version/vxs/vxs.so
Reading symbols from
/usr/local/lib/perl5/site_perl/5.8.8/mach/auto/DBD/Pg/Pg.so...done.
Loaded symbols for
//usr/local/lib/perl5/site_perl/5.8.8/mach/auto/DBD/Pg/Pg.so
Reading symbols from /usr/local/pgsql/lib/libpq.so.5...done.
Loaded symbols for /usr/local/pgsql/lib/libpq.so.5
Reading symbols from /usr/lib/libssl.so.5...done.
Loaded symbols for /usr/lib/libssl.so.5
Reading symbols from /lib/libcrypto.so.5...done.
Loaded symbols for /lib/libcrypto.so.5
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 0x2832a9bf in pp_entersub_profiler () at NYTProf.xs:2253
2253 NYTProf.xs: No such file or directory.
in NYTProf.xs
(gdb) bt full
#0 0x2832a9bf in pp_entersub_profiler () at NYTProf.xs:2253
line = 132
fid_line_key =
"\026(\204\023R\b\005\000\000\000`óF\t_Ã\024(\001\000\000\000\000\000\000\000\024\000\000\000\f\023R\bôì¿\177ô\207\036(¸ê¿\177\f\237\021("
file = 0x8e27148 "Game/Quests/Executor.pm"
subname_sv = (SV *) 0x9481e20
subname_pv = 0x94823f0 ",$H\t"
stash_name = 0x0
cv = (CV *) 0x1
is_xs = 0
saved_errno = 35
fid = 139589652
fid_line_key_len = 155689156
sv_tmp = (SV *) 0x1
op = (OP *) 0x8547848
prev_cop = (COP *) 0x8ed3888
next_op = (OP *) 0x8ed32c8
sp = (SV **) 0x851f818
sub_sv = (SV *) 0x8e28260
sub_call_start = {sub_call_time = {tv_sec = 3016320, tv_nsec =
290151516},
fid_line = "\020\037ë\b\003", '\0' <repeats 15 times>,
"Ñï\2216$pH\t\000\000\000\000Xë¿\177Ç\201\022(ð#H\t\234Ðì\b\000", subname_sv
= 0x3691efd1,
sub_av = 0x8106008, sub_cv = 0x1, call_depth = 915533777,
current_overhead_ticks = 0, current_subr_secs = 26.10449370000002}
profile_sub_call = 1
#1 0x28109ecf in Perl_runops_debug () at dump.c:1459
No locals.
#2 0x280a11f8 in S_run_body (oldscope=1) at perl.c:2366
No locals.
#3 0x280a0c7a in perl_run (my_perl=0x28401100) at perl.c:2283
oldscope = 1
ret = 0
cur_env = {je_prev = 0x281ea640, je_buf = {{_sjb = {671747094,
673089524, 2143284204, 2143284328, 2143284468, 0, 4735, 671576576,
134527328,
2143284468, 0, 0}}}, je_ret = 0, je_mustcatch = 0 '\0'}
#4 0x08049143 in main (argc=3, argv=0x7fbfece4, env=0x7fbfecf4) at
#perlmain.c:99
exitstatus = 0
(gdb)