rocky / Perl-Devel-Callsite

Get caller Perl OP address
https://metacpan.org/pod/Devel::Callsite
2 stars 2 forks source link

Document and test the DB changes #3

Closed mauzo closed 10 years ago

mauzo commented 10 years ago

Also some other minor cleanup.

(Can you really not just pull from my repo?)

rocky commented 10 years ago

Pull requests are less error prone.

This merged code is not without problems:

$ perl -d -Mblib t/basic.t

Loading DB routines from perl5db.pl version 1.33
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

1..27
ok 1 - loading module
ok 2 - running import
ok 3 - Valid first call
ok 4 - Valid second call
ok 5 - Two separate calls
ok 6 - Nested callsite
ok 7 - Callsite defaults to level 0
ok 8 - Going too far returns empty list
ok 9 - Going too far returns undef
ok 10 - Nested callsite inside loop
ok 11 - Callsite inside two loops
ok 12 - Deeply nested callsite
not ok 13 - Sanity check (DB::sub was called)
#   Failed test 'Sanity check (DB::sub was called)'
#   at t/basic.t line 75.
#          got: '7'
#     expected: '2'
ok 14 - Calls with DB::sub
ok 15 - Nested calls with DB::sub
ok 16 - Nested calls with and without DB::sub
not ok 17 - Sanity check (DB::sub was not called)
#   Failed test 'Sanity check (DB::sub was not called)'
#   at t/basic.t line 84.
#          got: '3'
#     expected: '0'
ok 18 - Call from DB returns 2 values
ok 19 - First value is the same (no DB::sub)
ok 20 - Second value is the same (no DB::sub)
not ok 21 - Sanity check (DB::sub was called)
#   Failed test 'Sanity check (DB::sub was called)'
#   at t/basic.t line 93.
#          got: '4'
#     expected: '1'
ok 22 - Call from DB with DB::sub returns 2 values
ok 23 - First value is the same (with DB::sub)
ok 24 - Second value is different (with DB::sub)
ok 25 - Valid context in initial thread
ok 26 - Valid context in child thread
ok 27 - Parent and child contexts are different
# Looks like you failed 3 tests of 27.
Debugged program terminated.  Use q to quit or R to restart,
  use o inhibit_exit to avoid stopping after program termination,
  h q, h R or h o to get additional info.
  DB<1>

And worse:

$ trepan.pl t/basic.t
1..27
ok 1 - loading module
ok 2 - running import
ok 3 - Valid first call
ok 4 - Valid second call
ok 5 - Two separate calls
ok 6 - Nested callsite
ok 7 - Callsite defaults to level 0

Program received signal SEGV.
!! main::(t/basic.t:27)
my @toofar = callsite(1);
set auto eval is on.
(trepanpl):
mauzo commented 10 years ago

At 1AM -0700 on 10/03/14 you (R. Bernstein) wrote:

Pull requests are less error prone.

This merged code is not without problems:

$ perl -d -Mblib t/basic.t

not ok 13 - Sanity check (DB::sub was called)
#   Failed test 'Sanity check (DB::sub was called)'
#   at t/basic.t line 75.
#          got: '7'
#     expected: '2'

That's expected and unavoidable. t/basic.t now includes a (minimal) Perl debugger, and if you run two debuggers at the same time they are obviously going to interfere with each other. I assume the tests pass for you without -d?

And worse:

$ trepan.pl t/basic.t
1..27
ok 1 - loading module
ok 2 - running import
ok 3 - Valid first call
ok 4 - Valid second call
ok 5 - Two separate calls
ok 6 - Nested callsite
ok 7 - Callsite defaults to level 0

Program received signal SEGV.
!! main::(t/basic.t:27)
my @toofar = callsite(1);

OK, that's more worrying. I can't reproduce it with 5.16.3 (I get the same two expected failures as above, but no segfault). Can you send me your perl -V?

Also, when building Devel::Trepan with a perl built with -DDEBUGGING I get an assertion failure:

cpanm (App::cpanminus) 1.7001 on perl 5.016003 built for amd64-freebsd [...] Fetching http://www.cpan.org/authors/id/R/RO/ROCKY/Devel-Trepan-0.51.tar.gz [...] t/20test-cont.t ............ ok Assertion failed: (SvFLAGS(_svpad) & SVs_PADMY), function Perl_pp_enteriter, file pp_ctl.c, line 2182.

Failed test 'Output comparison'

at /home/mauzo/.cpanm/work/1394445106.25539/Devel-Trepan-0.51/t/Helper.pm line 99.

Compare /home/mauzo/.cpanm/work/1394445106.25539/Devel-Trepan-0.51/t/data/debug.got with /home/mauzo/.cpanm/work/1394445106.25539/Devel-Trepan-0.51/t/data/debug.right:

--- /home/mauzo/.cpanm/work/1394445106.25539/Devel-Trepan-0.51/t/data/debug.right 2013-11-16 17:40:13.000000000 +0000

+++ /home/mauzo/.cpanm/work/1394445106.25539/Devel-Trepan-0.51/t/data/debug.got 2014-03-10 09:52:37.003324646 +0000

@@ -1,59 +0,0 @@

--- main::(gcd.pl:18)

-die sprintf "Need two integer arguments, got %d", scalar(@ARGV) unless

[the diff includes the whole file]

Ben

rocky commented 10 years ago

That's expected and unavoidable. t/basic.t now includes a (minimal) Perl debugger,

So split the test in two: those that are testing the new feature inside a debugger and those from before that don't need that. This way at least some of the tests can be debugged.

Perl info:

$ perl -V
Summary of my perl5 (revision 5 version 14 subversion 2) configuration:

  Platform:
    osname=linux, osvers=2.6.42-37-generic, archname=i686-linux-gnu-thread-multi-64int
    uname='linux aatxe 2.6.42-37-generic #58-ubuntu smp thu jan 24 15:28:10 utc 2013 i686 i686 i386 gnulinux '
    config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i686-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.14 -Darchlib=/usr/lib/perl/5.14 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.14.2 -Dsitearch=/usr/local/lib/perl/5.14.2 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Duse64bitint -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -Ui_libutil -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -Dlibperl=libperl.so.5.14.2 -des'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -g',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -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=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 =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/i386-linux-gnu /lib/../lib /usr/lib/i386-linux-gnu /usr/lib/../lib /lib /usr/lib
    libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
    perllibs=-ldl -lm -lpthread -lc -lcrypt
    libc=, so=so, useshrplib=true, libperl=libperl.so.5.14.2
    gnulibc_version='2.15'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector'

Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
                        PERL_PRESERVE_IVUV USE_64_BIT_INT USE_ITHREADS
                        USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
                        USE_REENTRANT_API
  Locally applied patches:
    DEBPKG:debian/arm_thread_stress_timeout - http://bugs.debian.org/501970 Raise the timeout of ext/threads/shared/t/stress.t to accommodate slower build hosts
    DEBPKG:debian/cpan_definstalldirs - Provide a sensible INSTALLDIRS default for modules installed from CPAN.
    DEBPKG:debian/db_file_ver - http://bugs.debian.org/340047 Remove overly restrictive DB_File version check.
    DEBPKG:debian/doc_info - Replace generic man(1) instructions with Debian-specific information.
    DEBPKG:debian/enc2xs_inc - http://bugs.debian.org/290336 Tweak enc2xs to follow symlinks and ignore missing @INC directories.
    DEBPKG:debian/errno_ver - http://bugs.debian.org/343351 Remove Errno version check due to upgrade problems with long-running processes.
    DEBPKG:debian/libperl_embed_doc - http://bugs.debian.org/186778 Note that libperl-dev package is required for embedded linking
    DEBPKG:fixes/respect_umask - Respect umask during installation
    DEBPKG:debian/writable_site_dirs - Set umask approproately for site install directories
    DEBPKG:debian/extutils_set_libperl_path - EU:MM: Set location of libperl.a to /usr/lib
    DEBPKG:debian/no_packlist_perllocal - Don't install .packlist or perllocal.pod for perl or vendor
    DEBPKG:debian/prefix_changes - Fiddle with *PREFIX and variables written to the makefile
    DEBPKG:debian/fakeroot - Postpone LD_LIBRARY_PATH evaluation to the binary targets.
    DEBPKG:debian/instmodsh_doc - Debian policy doesn't install .packlist files for core or vendor.
    DEBPKG:debian/ld_run_path - Remove standard libs from LD_RUN_PATH as per Debian policy.
    DEBPKG:debian/libnet_config_path - Set location of libnet.cfg to /etc/perl/Net as /usr may not be writable.
    DEBPKG:debian/m68k_thread_stress - http://bugs.debian.org/517938 http://bugs.debian.org/495826 Disable some threads tests on m68k for now due to missing TLS.
    DEBPKG:debian/mod_paths - Tweak @INC ordering for Debian
    DEBPKG:debian/module_build_man_extensions - http://bugs.debian.org/479460 Adjust Module::Build manual page extensions for the Debian Perl policy
    DEBPKG:debian/prune_libs - http://bugs.debian.org/128355 Prune the list of libraries wanted to what we actually need.
    DEBPKG:fixes/net_smtp_docs - [rt.cpan.org #36038] http://bugs.debian.org/100195 Document the Net::SMTP 'Port' option
    DEBPKG:debian/perlivp - http://bugs.debian.org/510895 Make perlivp skip include directories in /usr/local
    DEBPKG:debian/disable-zlib-bundling - Disable zlib bundling in Compress::Raw::Zlib
    DEBPKG:debian/cpanplus_definstalldirs - http://bugs.debian.org/533707 Configure CPANPLUS to use the site directories by default.
    DEBPKG:debian/cpanplus_config_path - Save local versions of CPANPLUS::Config::System into /etc/perl.
    DEBPKG:debian/deprecate-with-apt - http://bugs.debian.org/580034 Point users to Debian packages of deprecated core modules
    DEBPKG:fixes/hurd-ccflags - [a190e64] http://bugs.debian.org/587901 [perl #92244] Make hints/gnu.sh append to $ccflags rather than overriding them
    DEBPKG:debian/squelch-locale-warnings - http://bugs.debian.org/508764 Squelch locale warnings in Debian package maintainer scripts
    DEBPKG:debian/skip-upstream-git-tests - Skip tests specific to the upstream Git repository
    DEBPKG:fixes/extutils-cbuilder-cflags - [011e8fb] http://bugs.debian.org/624460 [perl #89478] Append CFLAGS and LDFLAGS to their Config.pm counterparts in EU::CBuilder
    DEBPKG:fixes/module-build-home-directory - http://bugs.debian.org/624850 [rt.cpan.org #67893] Fix failing tilde test when run under a UID without a passwd entry
    DEBPKG:debian/patchlevel - http://bugs.debian.org/567489 List packaged patches for 5.14.2-6ubuntu2.4 in patchlevel.h
    DEBPKG:fixes/h2ph-multiarch - [e7ec705] http://bugs.debian.org/625808 [perl #90122] Make h2ph correctly search gcc include directories
    DEBPKG:fixes/index-tainting - [3b36395] http://bugs.debian.org/291450 [perl #64804] RT 64804: tainting with index() of a constant
    DEBPKG:debian/skip-kfreebsd-crash - http://bugs.debian.org/628493 [perl #96272] Skip a crashing test case in t/op/threads.t on GNU/kFreeBSD
    DEBPKG:fixes/document_makemaker_ccflags - http://bugs.debian.org/628522 [rt.cpan.org #68613] Document that CCFLAGS should include $Config{ccflags}
    DEBPKG:fixes/sys-syslog-socket-timeout-kfreebsd.patch - http://bugs.debian.org/627821 [rt.cpan.org #69997] Use a socket timeout on GNU/kFreeBSD to catch ICMP port unreachable messages
    DEBPKG:fixes/hurd-hints - http://bugs.debian.org/636609 Improve general GNU hints, needed for GNU/Hurd.
    DEBPKG:fixes/pod_fixes - [7698aed] http://bugs.debian.org/637816 Fix typos in several pod/perl*.pod files
    DEBPKG:debian/find_html2text - http://bugs.debian.org/640479 Configure CPAN::Distribution with correct name of html2text
    DEBPKG:fixes/digest_eval_hole - http://bugs.debian.org/644108 Close the eval "require $module" security hole in Digest->new($algorithm)
    DEBPKG:fixes/hurd-ndbm - [f0d0a20] [perl #102680] http://bugs.debian.org/645989 Add GNU/Hurd hints for NDBM_File
    DEBPKG:fixes/sysconf.t-posix - [8040185] [perl #102888] http://bugs.debian.org/646016 Fix hang in ext/POSIX/t/sysconf.t on GNU/Hurd
    DEBPKG:fixes/hurd-largefile - [1fda587] [perl #103014] http://bugs.debian.org/645790 enable LFS on GNU/Hurd
    DEBPKG:debian/hurd_test_todo_syslog - http://bugs.debian.org/650093 Disable failing GNU/Hurd tests in cpan/Sys-Syslog/t/syslog.t
    DEBPKG:fixes/hurd_skip_itimer_virtual - [rt.cpan.org #72754] http://bugs.debian.org/650094 Skip interval timer tests in Time::HiRes on GNU/Hurd
    DEBPKG:debian/hurd_test_skip_socketpair - http://bugs.debian.org/650186 Disable failing GNU/Hurd tests ext/Socket/t/socketpair.t
    DEBPKG:debian/hurd_test_skip_sigdispatch - http://bugs.debian.org/650188 Disable failing GNU/Hurd tests op/sigdispatch.t
    DEBPKG:debian/hurd_test_skip_stack - http://bugs.debian.org/650175 Disable failing GNU/Hurd tests dist/threads/t/stack.t
    DEBPKG:debian/hurd_test_skip_recv - http://bugs.debian.org/650095 Disable failing GNU/Hurd tests cpan/autodie/t/recv.t
    DEBPKG:debian/hurd_test_skip_libc - http://bugs.debian.org/650097 Disable failing GNU/Hurd tests dist/threads/t/libc.t
    DEBPKG:debian/hurd_test_skip_pipe - http://bugs.debian.org/650187 Disable failing GNU/Hurd tests io/pipe.t
    DEBPKG:debian/hurd_test_skip_io_pipe - http://bugs.debian.org/650096 Disable failing GNU/Hurd tests dist/IO/t/io_pipe.t
    DEBPKG:fixes/CVE-2012-5195 - avoid calling memset with a negative count
    DEBPKG:fixes/CVE-2012-5526 - [PATCH 1/4] CR escaping for P3P header
    DEBPKG:CVE-2013-1667.patch - [PATCH] Prevent premature hsplit() calls, and only trigger REHASH after hsplit()
    DEBPKG:CVE-2012-6329.patch - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=695224 [1735f6f] fix arbitrary command execution via _compile function in Maketext.pm
  Built under linux
  Compiled at Feb  4 2014 22:52:09
  @INC:
    /etc/perl
    /usr/local/lib/perl/5.14.2
    /usr/local/share/perl/5.14.2
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.14
    /usr/share/perl/5.14
    /usr/local/lib/site_perl
    .

You should try with the curret git source of Devel-Trepan rather than the last release.

Will investigate further later.

As for:

t/20test-cont.t ............ ok
Assertion failed: (SvFLAGS(_svpad) & SVs_PADMY), function Perl_pp_enteriter, file pp_ctl.c, line 2182.

This looks like Perl crashing and I have never seen this in any smoker report. Will investigate later to see if I can reproduce.

mauzo commented 10 years ago

At 5AM -0700 on 10/03/14 you (R. Bernstein) wrote:

That's expected and unavoidable. t/basic.t now includes a (minimal) Perl debugger,

So split the test in two: those that are testing the new feature inside a debugger and those from before that don't need that. This way at least some of the tests can be debugged.

Seems like a waste of time to me. I was only running the tests under perl -d as a demonstration of the bug in 0.07; nobody is going to do this under normal circumstances. (It's not as though the test script is complicated.) Of course, if you want to anyway, feel free... :).

Perl info:

$ perl -V
Summary of my perl5 (revision 5 version 14 subversion 2) configuration:

  Platform:
    osname=linux, osvers=2.6.42-37-generic, archname=i686-linux-gnu-thread-multi-64int
    uname='linux aatxe 2.6.42-37-generic #58-ubuntu smp thu jan 24 15:28:10 utc 2013 i686 i686 i386 gnulinux '
    config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i686-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.14 -Darchlib=/usr/lib/perl/5.14 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.14.2 -Dsitearch=/usr/local/lib/perl/5.14.2 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Duse64bitint -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -Ui_libutil -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -Dlibperl=libperl.so.5.14.2 -des'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -g',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -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=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 =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/i386-linux-gnu /lib/../lib /usr/lib/i386-linux-gnu /usr/lib/../lib /lib /usr/lib
    libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
    perllibs=-ldl -lm -lpthread -lc -lcrypt
    libc=, so=so, useshrplib=true, libperl=libperl.so.5.14.2
    gnulibc_version='2.15'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector'

Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
                        PERL_PRESERVE_IVUV USE_64_BIT_INT USE_ITHREADS
                        USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
                        USE_REENTRANT_API
  Locally applied patches:
[approximately half-a-million patches snipped...]
  Built under linux
  Compiled at Feb  4 2014 22:52:09
  @INC:
    /etc/perl
    /usr/local/lib/perl/5.14.2
    /usr/local/share/perl/5.14.2
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.14
    /usr/share/perl/5.14
    /usr/local/lib/site_perl
    .

You should try with the curret git source of Devel-Trepan rather than the last release.

OK, that is what I am using now, specifically commit e592f0. I can't reproduce the crash with this perl:

Summary of my perl5 (revision 5 version 14 subversion 2) configuration: Commit id: dc281e6088d189558b79a5121119b7196c8b3db0 Platform: osname=freebsd, osvers=9.1-release-p7, archname=amd64-freebsd-thread-multi uname='freebsd anubis.morrow.me.uk 9.1-release-p7 freebsd 9.1-release-p7 #0 r+77e25d0: tue sep 10 18:12:13 bst 2013 root@anubis:usrobjusrsrcsysanubis amd64 ' config_args='-des -DDEBUGGING -Dusethreads -Dprefix=/opt/perl5142g -Dsiteprefix=/opt/perl5142g/site -Dsitelib=/opt/perl5142g/site/lib -Dman1dir=none -Dman3dir=none' 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=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include', optimize='-O -g', cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.2.1 20070831 patched [FreeBSD]', 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 ='-pthread -Wl,-E -fstack-protector -L/usr/local/lib' libpth=/usr/lib /usr/local/lib libs=-lgdbm -lm -lcrypt perllibs=-lm -lcrypt libc=, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib -fstack-protector'

Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PERL_TRACK_MEMPOOL USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Built under freebsd Compiled at Mar 10 2014 23:26:18 %ENV: PERLDOC="-MPod::Text::Ansi" PERLDOC_PAGER="less -R" @INC: /opt/perl5142g/site/lib/amd64-freebsd-thread-multi /opt/perl5142g/site/lib /opt/perl5142g/lib/5.14.2/amd64-freebsd-thread-multi /opt/perl5142g/lib/5.14.2 .

or with this perl:

Summary of my perl5 (revision 5 version 14 subversion 2) configuration:

Platform: osname=freebsd, osvers=9.1-release-p7, archname=i386-freebsd-thread-multi-64int uname='freebsd hathor.morrow.me.uk 9.1-release-p7 freebsd 9.1-release-p7 #0 r+77e25d0: tue sep 10 18:12:13 bst 2013 root@anubis:usrobjusrsrcsysanubis i386 ' config_args='-des -Dprefix=/opt/perl5142g -Dsiteprefix=/opt/perl5142g/site -Dsitelib=/opt/perl5142g/site/lib -Dman1dir=none -Dman3dir=none -DDEBUGGING -Dusethreads -Duselargefiles -Duse64bitint -Dcccdlflags=-fPIC -Duseshrplib' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include', optimize='-O -g', cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.2.1 20070831 patched [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 ='-pthread -Wl,-E -fstack-protector -L/usr/local/lib' libpth=/usr/lib /usr/local/lib libs=-lm -lcrypt perllibs=-lm -lcrypt libc=, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-R/opt/perl5142g/lib/5.14.2/i386-freebsd-thread-multi-64int/CORE' cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib -fstack-protector'

Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PERL_TRACK_MEMPOOL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Built under freebsd Compiled at Mar 11 2014 00:33:25 @INC: /opt/perl5142g/site/lib/i386-freebsd-thread-multi-64int /opt/perl5142g/site/lib /opt/perl5142g/lib/5.14.2/i386-freebsd-thread-multi-64int /opt/perl5142g/lib/5.14.2 .

so at this point I'm a bit stumped. Can you reproduce it with a released (ie., unpatched) perl? Can you reproduce it with a -DDEBUGGING build, to see if you get an assertion failure, or, failing that, a C backtrace? Given that the perl you were using was build with -DDEBUGGING=-g, there should be debug symbols for it somewhere, so you should at least be able to get a C backtrace from that crash.

Will investigate further later.

OK, cool. At this point I suspect this isn't a bug in Callsite, but we can't be sure of that yet.

As for:

t/20test-cont.t ............ ok
Assertion failed: (SvFLAGS(_svpad) & SVs_PADMY), function Perl_pp_enteriter, file pp_ctl.c, line 2182.

This looks like Perl crashing and I have never seen this in any smoker report.

Very few smokers are using perls built with -DDEBUGGING. An assertion failure definitely indicates a bug somewhere (in core perl, in an XS module, or in the way something like PadWalker is being used), but the bug may not necessarily be triggered by the test suite on an ordinary perl.

Will investigate later to see if I can reproduce.

OK. For the record, this was with a 5.16.3 built with -DDEBUGGING. With a 5.14.2 with -DDEBUGGING I do not see the crash (and all tests pass). perl -V for the perl which crashes:

Summary of my perl5 (revision 5 version 16 subversion 3) configuration: Commit id: fd04d42d38f4751b981eb6e9213ee1ab8ef11ea6 Platform: osname=freebsd, osvers=9.1-release-p7, archname=amd64-freebsd uname='freebsd anubis.morrow.me.uk 9.1-release-p7 freebsd 9.1-release-p7 #0 r+77e25d0: tue sep 10 18:12:13 bst 2013 root@anubis:usrobjusrsrcsysanubis amd64 ' config_args='-des -Dprefix=/opt/perlg -Uinstallusrbinperl -Dsiteprefix=/opt/perlg/site -Dsitelib=/opt/perlg/site/lib -Dman1dir=none -Dman3dir=none -Dinc_version_list=none -Dusemymalloc=y -Dcc=cc -Duseshrplib -Aprepend:ldflags=-pthread -DDEBUGGING' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=y, bincompat5005=undef Compiler: cc='cc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include', optimize='-O -g', cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.2.1 20070831 patched [FreeBSD]', 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 ='-pthread -Wl,-E -fstack-protector -L/usr/local/lib' libpth=/usr/lib /usr/local/lib libs=-lgdbm -lm -lcrypt -lutil -lc perllibs=-lm -lcrypt -lutil -lc libc=, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-R/opt/perlg/lib/5.16.3/amd64-freebsd/CORE' cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib -fstack-protector'

Characteristics of this binary (from libperl): Compile-time options: DEBUGGING HAS_TIMES MYMALLOC PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF Built under freebsd Compiled at Mar 8 2014 01:40:02 %ENV: PERLDOC="-MPod::Text::Ansi" PERLDOC_PAGER="less -R" @INC: /opt/perlg/site/lib/amd64-freebsd /opt/perlg/site/lib /opt/perlg/lib/5.16.3/amd64-freebsd /opt/perlg/lib/5.16.3 .

Ben

rocky commented 10 years ago

[breaking tests into two files]

Seems like a waste of time to me. I was only running the tests under perl -d as a demonstration of the bug in 0.07; nobody is going to do this under normal circumstances

Actually it's as as much a stylistic thing as it is a practical thing. And I have run the debugger (my debugger) on tests.

It's this kind of attitude and lack of responsiveness that worries me about transferring ownership. Granted you've been doing all of the heavy lifting. But the more I feel that it is going to be hard to get the things I want done and instead get an attitude like "it's a waste of time" and "nobody is going to" then I have more hesitation about this.

Recall that I got involved in this project because I want to use it. And as I've said, I've been burned by the lack of responsiveness before when I've transferred ownership.

At any rate, with respect to breaking into two tests, no worries, I'll handle that.

I think I'll also put out an interim release soon with caveats. I'd rather have more releases closer together. And honestly I don't think the problems we've seen are things that most will encounter anytime soon. And if that's not the case, I'd like to find out.

As for the crash with Devel::Trepan and Perl 5.16.3 on FreeBSD, my take is to try with the most recent Perl. If that has a problem, then it is probably good to report it back. For the record, Devel::Trepan does not use XS or C extensions, it doesn't rely on PadWalker either. It is all Pure Perl.

I'll also try doing the same with my SEGV.

mauzo commented 10 years ago

At 6PM -0700 on 10/03/14 you (R. Bernstein) wrote:

[breaking tests into two files]

Seems like a waste of time to me. I was only running the tests under perl -d as a demonstration of the bug in 0.07; nobody is going to do this under normal circumstances

Actually it's as as much a stylistic thing as it is a practical thing. And I have run the debugger (my debugger) on tests.

It's this kind of attitude and lack of responsiveness that worries me about transfering ownership. Granted you've been doing all of the heavy lifting. But the more I feel that it is going to be hard to get the things I want done and instead get an attitude like "it's a waste of time" and "nobody is going to" then I have more hesitation about this.

Yes, giving me maint or comaint would mean that you don't necessarily get everything done just the way you want it. OTOH, I would read the RT mail, and I would fix any actual bugs. If you don't think that's a good trade-off, I'm happy to leave things as they are.

Recall that I got involved in this project because I want to use it. And as I've said, I've been burned by the lack of responsiveness before when I've transferred ownership.

Given that I got involved here on my own initiative, with no incentive beyond the fact that this is code I am (rather indirectly) responsible for and people seem to be using it to do real work, I don't think you can accuse me of lack of responsiveness.

I think I'll also put out an interim release soon with caveats. I'd rather have more releases closer together. And honestly I don't think the problems we've seen are things that most will encounter anytime soon. And if that's not the case, I'd like to find out.

I agree. I'm not even sure there need to be any documented caveats: we've encountered some not-yet-explained failures in connexion with a large and complicated chunk of code that perhaps is causing them all on its own, but nothing that can be tied directly to the code in Callsite.

(This should not be taken as a disparagement of Trepan. I haven't really looked at it in detail, but it's obvious that it does a lot of complicated things with a lot of slightly-scary XS modules and infrequently-used parts of the perl interpreter. Chances are the failures are coming from somewhere in there, and not from the rather straightforward code in Callsite.)

As for the crash with Devel::Trepan and Perl 5.16.3 on FreeBSD, my take is to try with the most recent Perl. If that has a problem, then it is probably good to report it back.

I only really reported that as a courtesy. I'm not terribly interested in tracking it down, though I would be willing to run some straightforward tests, or do a little elementary C debugging, if that would be helpful.

To show willing, I do not see a crash with the perl below, so it looks like this might be restricted to the 5.16 series.

Summary of my perl5 (revision 5 version 18 subversion 2) configuration: Commit id: e2a4306ace4a19cb3a434e4eb9fedad6ff1248b4 Platform: osname=freebsd, osvers=9.1-release-p7, archname=amd64-freebsd uname='freebsd anubis.morrow.me.uk 9.1-release-p7 freebsd 9.1-release-p7 #0 r+77e25d0: tue sep 10 18:12:13 bst 2013 root@anubis:usrobjusrsrcsysanubis amd64 ' config_args='-des -DDEBUGGING -Dprefix=/opt/perl5182g -Dsiteprefix=/opt/perl5182g/site -Dsitelib=/opt/perl5182g/site/lib -Dman1dir=none -Dman3dir=none -Dusemymalloc=y -Duseshrplib -Aprepend:ldflags=-pthread ' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=y, bincompat5005=undef Compiler: cc='cc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include', optimize='-O -g', cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.2.1 20070831 patched [FreeBSD]', 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 ='-pthread -Wl,-E -fstack-protector -L/usr/local/lib' libpth=/usr/lib /usr/local/lib libs=-lgdbm -lm -lcrypt -lutil -lc perllibs=-lm -lcrypt -lutil -lc libc=, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-R/opt/perl5182g/lib/5.18.2/amd64-freebsd/CORE' cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib -fstack-protector'

Characteristics of this binary (from libperl): Compile-time options: DEBUGGING HAS_TIMES MYMALLOC PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF Built under freebsd Compiled at Mar 11 2014 02:39:03 %ENV: PERLDOC="-MPod::Text::Ansi" PERLDOC_PAGER="less -R" @INC: /opt/perl5182g/site/lib/amd64-freebsd /opt/perl5182g/site/lib /opt/perl5182g/lib/5.18.2/amd64-freebsd /opt/perl5182g/lib/5.18.2 .

Ben

rocky commented 10 years ago

To be clear, I continue to greatly appreciate all the work you've done on this and making it possible. This project is virtually all of your code. The new level parameter I want to put into Devel::Trepan when I get a chance as it can show exact locations up the callstack.

I don't mind not getting everything I want in as long as there are good and well-justified reasons. I don't think there was a resolution to being a co-maintainer. But to the extent that I can think of something, I've added you as a collaborator to rocky/Perl5-Devel-Callstack.