develooper Front page | perl.perl5.porters | Postings from August 2009

Re: Looking for help with with perl <5.8.8 problem blocking NYTProf

Thread Previous
From:
Tim Bunce
Date:
August 6, 2009 14:01
Subject:
Re: Looking for help with with perl <5.8.8 problem blocking NYTProf
Message ID:
20090806210136.GA2623@timac.local
Wonderful!  That was just what I needed.
Adding a DB::sub subroutine has fixed it.

Many thanks Bram!

Tim.

On Thu, Aug 06, 2009 at 03:13:52PM +0200, Bram wrote:
> Citeren Tim Bunce <Tim.Bunce@pobox.com>:
>
>> The problem is summarised here:
>> http://code.google.com/p/perl-devel-nytprof/source/browse/trunk/gotobug/README
>>
>> The .../gotobug directory contains a very small test case that
>> reproduces the problem.
>>
>> I'd appreciate any insight into the cause and/or how to workaround it.
>>
>> If I can't find a solution in the next few days then I'll bump the
>> minimum perl version required for NYTProf to 5.8.8. I don't feel bad
>> about that, but it would be nice to avoid it if possible.
>>
>> Tim.
>>
>
> perl-5.8.7 seems to work as well.
>
> $ perl-5.8.6 test.pl
> ok 1
> ok 2
> (eval) at E.pm line 5
>         E::as_heavy() called at E.pm line 10
>         require A.pm called at -e line 1
> Compilation failed in require at -e line 1.
> not ok 3
>
> $ perl-5.8.7 test.pl
> ok 1
> ok 2
> ok 3
>
> $ perl-5.8.8 test.pl
> ok 1
> ok 2
> ok 3
>
>
> Doing a binary search:
>
> ----Program----
> #!/usr/bin/perl -l
>
>
> my $do = "require A";
>
> system("$^X -I/tmp/gotobug -e '$do'");
> if ($?) { print "not ok 1"; }
> else { print "ok 1"; }
>
> $ENV{PERLDB_OPTS} = "NonStop";
> system("$^X -I/tmp/gotobug -d -e '$do'");
> if ($?) { print "not ok 2"; }
> else { print "ok 2"; }
>
> system("$^X -I/tmp/gotobug -d:stub -e '$do'");
> if ($?) { print "not ok 3"; }
> else { print "ok 3"; }
>
>
>
> ----Output of .../pecunDs/perl-5.9.2@24264/bin/perl----
> ok 1
> ok 2
> (eval) at /tmp/gotobug/E.pm line 5
>         E::as_heavy() called at /tmp/gotobug/E.pm line 10
>         require A.pm called at -e line 1
> Compilation failed in require at -e line 1.
> not ok 3
>
> ----EOF ($?='0')----
> ----Output of .../pcejYPj/perl-5.9.2@24265/bin/perl----
> ok 1
> ok 2
> ok 3
>
> ----EOF ($?='0')----
>
>
> http://perl5.git.perl.org/perl.git/commit/f2a7f2982c10dbcfc2084d281af6ad8b959d5fb9
>
> [perl #35059] [PATCH] caller() skips frames (such as eval() frames) if $^P set
> From:  glasser@tang-eleven-seventy-nine.mit.edu (via RT) 
> <perlbug-followup@perl.org>
> Message-Id:  <rt-3.0.11-35059-111134.0.304511316819145@perl.org>
>
> improved version of change 21842 that copes with glob DB::sub
> existing but &DB::sub not existing.
>
> p4raw-id: //depot/perl@24265
>
> From the RT ticket:
>
> 'If the glob DB::sub exists but the subroutine &DB::sub does not, caller() can
> get confused and skip certain frames -- especially frames created by eval.
> This situation will occur if $^P is set and the debugger has not been loaded.
> A patch is provided, including some test cases.'
>
>
>
> It did succeed in getting it to work on perl-5.8.6 (and on perl-5.6.0) but 
> I'm not .
>
> To get it working on I used for stub.pm:
>
> package Devel::stub;
>
> package DB;
> sub DB {}
> sub sub {
>   &$sub;
> }
>
> 1;
> __END__
>
> (  goto &sub;  and  eval { &$sub; }  and eval { goto &sub; };  work as well.)
>
> I'm not really familiar with the code of NYTProf: does it define DB::sub ? 
> (And/or is it possible to add it?)
>
>
> Best regards,
>
> Bram
>
>

Thread Previous


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