On Mon, Nov 22, 2010 at 10:29:45AM +0000, Tim Bunce wrote:
> See http://matrix.cpantesters.org/?dist=Devel-NYTProf+4.05_90
>
> Can anyone shed light on why NYTProf 4.05_90 fails on OpenBSD?
> (32-bit and amd64, with and without threads, perl 5.8.9 thru 5.12.2).
>
> Looks like the profiler dies (exit status 139). The rest is noise.
The only OpenBSD system I have access to is the Sparc64 system in the GCC
compiler farm. Only 1 test fails. Sometimes. But...
-bash-4.0$ cat 25.pl
use strict;
use Benchmark;
my $i;
sub add { ++$i }
timethis( 10, \&add );
die "panic $i" unless $i == 10;
$ NYTPROF=start=begin gdb --args
/home/nick/Sandpit/snap5.9.x-v5.12.2/bin/perl5.12.2 -I blib/lib/ -d:NYTProf
25.pl
GNU gdb 6.3
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 "sparc64-unknown-openbsd4.6"...
(gdb) r
Starting program: /home/nick/Sandpit/snap5.9.x-v5.12.2/bin/perl5.12.2 -I
blib/lib/ -d:NYTProf 25.pl
timethis 10: 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)
(warning: too few iterations for a reliable count)
Program exited normally.
(gdb) r
Starting program: /home/nick/Sandpit/snap5.9.x-v5.12.2/bin/perl5.12.2 -I
blib/lib/ -d:NYTProf 25.pl
Program received signal SIGSEGV, Segmentation fault.
0x0000000048c584a8 in DB_leave (op=0x0, prev_op=0x46063980) at NYTProf.xs:1524
1524 is_multicall = (!op && CxMULTICALL(&cxstack[cxstack_ix]));
(gdb) p op
$1 = (OP *) 0x0
(gdb) p PL_curstackinfo->si_cxix
$2 = -1
(gdb) p PL_curstackinfo->si_cxstack
$3 = (PERL_CONTEXT *) 0x4577c000
(gdb)
That doesn't look good, but I have no clue what it means.
So I try it on x86 Linux, under valgrind:
$ NYTPROF=start=begin valgrind ~/Sandpit/5122-g/bin/perl -I blib/lib/
-d:NYTProf 25.pl
==31125== Memcheck, a memory error detector
==31125== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==31125== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==31125== Command: /home/nclark/Sandpit/5122-g/bin/perl -I blib/lib/ -d:NYTProf
25.pl
==31125==
==31125== Invalid read of size 1
==31125== at 0x461A244: DB_leave (NYTProf.xs:1524)
==31125== by 0x4625DC2: pp_leave_profiler (NYTProf.xs:2744)
==31125== by 0x8131F80: Perl_runops_debug (dump.c:2049)
==31125== by 0x808921D: Perl_call_sv (perl.c:2590)
==31125== by 0x825BEE1: Perl_pp_tie (pp_sys.c:850)
==31125== by 0x8131F80: Perl_runops_debug (dump.c:2049)
==31125== by 0x808935E: Perl_call_sv (perl.c:2605)
==31125== by 0x8093B03: Perl_call_list (perl.c:4600)
==31125== by 0x8073D3C: S_process_special_blocks (op.c:5960)
==31125== by 0x8073AC3: Perl_newATTRSUB (op.c:5931)
==31125== by 0x806A2C7: Perl_utilize (op.c:3986)
==31125== by 0x80EA79C: Perl_yyparse (perly.y:674)
==31125== Address 0x4444428 is 0 bytes after a block of size 128 alloc'd
==31125== at 0x40235C4: malloc (vg_replace_malloc.c:236)
==31125== by 0x81327D7: Perl_safesysmalloc (util.c:94)
==31125== by 0x8164560: Perl_av_extend (av.c:183)
==31125== by 0x8218F43: Perl_new_stackinfo (scope.c:59)
==31125== by 0x80A9FC7: Perl_amagic_call (gv.c:2131)
==31125== by 0x819CD29: Perl_sv_2bool (sv.c:3125)
==31125== by 0x8170F01: Perl_pp_or (pp_hot.c:419)
==31125== by 0x8131F80: Perl_runops_debug (dump.c:2049)
==31125== by 0x808935E: Perl_call_sv (perl.c:2605)
==31125== by 0x8093B03: Perl_call_list (perl.c:4600)
==31125== by 0x8073D3C: S_process_special_blocks (op.c:5960)
==31125== by 0x8073AC3: Perl_newATTRSUB (op.c:5931)
==31125==
==31125== Invalid read of size 1
==31125== at 0x461A244: DB_leave (NYTProf.xs:1524)
==31125== by 0x4625DC2: pp_leave_profiler (NYTProf.xs:2744)
==31125== by 0x8131F80: Perl_runops_debug (dump.c:2049)
==31125== by 0x823B4B1: S_docatch (pp_ctl.c:2870)
==31125== by 0x824390D: Perl_pp_require (pp_ctl.c:3691)
==31125== by 0x8131F80: Perl_runops_debug (dump.c:2049)
==31125== by 0x808921D: Perl_call_sv (perl.c:2590)
==31125== by 0x8088E9D: Perl_call_method (perl.c:2516)
==31125== by 0x814A09B: S_magic_methcall (mg.c:1665)
==31125== by 0x814A2AC: S_magic_methpack (mg.c:1679)
==31125== by 0x814A6C0: Perl_magic_getpack (mg.c:1696)
==31125== by 0x81429FD: Perl_mg_get (mg.c:225)
==31125== Address 0x4444428 is 0 bytes after a block of size 128 alloc'd
==31125== at 0x40235C4: malloc (vg_replace_malloc.c:236)
==31125== by 0x81327D7: Perl_safesysmalloc (util.c:94)
==31125== by 0x8164560: Perl_av_extend (av.c:183)
==31125== by 0x8218F43: Perl_new_stackinfo (scope.c:59)
==31125== by 0x80A9FC7: Perl_amagic_call (gv.c:2131)
==31125== by 0x819CD29: Perl_sv_2bool (sv.c:3125)
==31125== by 0x8170F01: Perl_pp_or (pp_hot.c:419)
==31125== by 0x8131F80: Perl_runops_debug (dump.c:2049)
==31125== by 0x808935E: Perl_call_sv (perl.c:2605)
==31125== by 0x8093B03: Perl_call_list (perl.c:4600)
==31125== by 0x8073D3C: S_process_special_blocks (op.c:5960)
==31125== by 0x8073AC3: Perl_newATTRSUB (op.c:5931)
==31125==
timethis 10: 0 wallclock secs (-0.02 usr + 0.00 sys = -0.02 CPU) @ -500.00/s
(n=10)
(warning: too few iterations for a reliable count)
==31125== Invalid read of size 1
==31125== at 0x461A244: DB_leave (NYTProf.xs:1524)
==31125== by 0x4625DC2: pp_leave_profiler (NYTProf.xs:2744)
==31125== by 0x8131F80: Perl_runops_debug (dump.c:2049)
==31125== by 0x808811D: S_run_body (perl.c:2308)
==31125== by 0x8087630: perl_run (perl.c:2233)
==31125== by 0x805F5AF: main (perlmain.c:117)
==31125== Address 0x4207278 is 0 bytes after a block of size 512 alloc'd
==31125== at 0x40235C4: malloc (vg_replace_malloc.c:236)
==31125== by 0x81327D7: Perl_safesysmalloc (util.c:94)
==31125== by 0x8164560: Perl_av_extend (av.c:183)
==31125== by 0x8218F43: Perl_new_stackinfo (scope.c:59)
==31125== by 0x809050E: Perl_init_stacks (perl.c:3817)
==31125== by 0x8082536: perl_construct (perl.c:282)
==31125== by 0x805F556: main (perlmain.c:111)
==31125==
==31125== Warning: bad signal number 0 in sigaction()
==31125==
==31125== HEAP SUMMARY:
==31125== in use at exit: 1,255,667 bytes in 20,182 blocks
==31125== total heap usage: 34,194 allocs, 14,012 frees, 22,482,438 bytes
allocated
==31125==
==31125== LEAK SUMMARY:
==31125== definitely lost: 0 bytes in 0 blocks
==31125== indirectly lost: 0 bytes in 0 blocks
==31125== possibly lost: 0 bytes in 0 blocks
==31125== still reachable: 1,255,667 bytes in 20,182 blocks
==31125== suppressed: 0 bytes in 0 blocks
==31125== Rerun with --leak-check=full to see details of leaked memory
==31125==
==31125== For counts of detected and suppressed errors, rerun with: -v
==31125== ERROR SUMMARY: 9 errors from 3 contexts (suppressed: 59 from 35)
Is that enough to go on? :-)
valgrind 3.6.0 supports OS X now, if that helps.
Nicholas Clark
--
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.
Group hosted at: http://groups.google.com/group/develnytprof-dev
Project hosted at: http://perl-devel-nytprof.googlecode.com
CPAN distribution: http://search.cpan.org/dist/Devel-NYTProf
To post, email: [email protected]
To unsubscribe, email: [email protected]