On Tue, Sep 07, 2010 at 08:24:34PM +0200, Anno Siegel wrote:
> I noticed a problem with Devel::NYTProf v4.04 with perl v5.12.1 (full
> credentials below) under darwin v10.4.0. It may be relevant that the
> program I'm trying to profile uses MooseX::Declare and has Inline::C
> components.
>
> The problem should be should be reproducible from this archive:
After installing some pre-reqs: MooseX::Declare Inline Dir::Self
The problem seems to be related to a BEGIN block inside the
MooseX::Declare 'class' block.
> Here is an edited session. I have marked program output with "|" in the left
> margin.
>
> radom:aux anno$ tar xzf Chem-Brutto-0.1.tar.gz
> radom:aux anno$ cd Chem-Brutto-0.1
> radom:Chem-Brutto-0.1 anno$ perl -d:NYTProf ttt_Solver
> Unable to determine line number in generated method (unknown origin)
> (ssix121)
> Unable to determine line number in generated method (unknown origin)
> (ssix121)
> Unable to determine line number in generated method (unknown origin)
> (ssix118)
> Unable to determine line number in generated method (unknown origin)
> (ssix118)
>
> [similar warnings snipped]
>
> | Startup took 4.28939 wallclock secs ( 3.08 usr 0.12 sys + 0.78 cusr
> 0.20 csys = 4.18 CPU)
> | Loading took 4.67904 wallclock secs ( 4.62 usr + 0.02 sys = 4.64 CPU)
> | Building took 1.8713 wallclock secs ( 1.87 usr + 0.00 sys = 1.87 CPU)
> Unable to determine line number in lib/String/Bag/Solver.pm (ssix8)
>
> [1000+ identical warnings snipped]
>
> Unable to determine line number in lib/String/Bag/Solver.pm (ssix8)
> | Priming took 2.28111 wallclock secs ( 2.25 usr + 0.01 sys = 2.26 CPU)
> | tot: 2761, skip: 1153
> | Solving took 0.368007 wallclock secs ( 0.37 usr + 0.00 sys = 0.37 CPU)
> | 264 solutions
> |
> Can't parse %DB::sub entry for
> String::Bag::Solver::__ANON__[lib/String/Bag/Solver.pm:12]
> 'lib/String/Bag/Solver.pm:-1-12'
> The run with -d:NYTProf produces many warnings. An attempt to evaluate
> the output with nytprofhtml appears to hang. Actually it's trying to
> loop over 2**32 - 1 lines in Devel::NYTProf::Reader::_generate_report,
> which is how far I've traced it back.
That was enough, thanks! The negative numbers were being stored in
unsigned values and so treated as very high line numbers.
(The underlying issue is how negative numbers got added to %DB::sub.
Possibly a bug in or below MooseX::Declare.)
NYTProf now says:
Negative first line number in %DB::sub entry
'lib/String/Bag/Solver.pm:-1--1' for String::Bag::Solver::BEGIN
Negative last line number in %DB::sub entry
'lib/String/Bag/Solver.pm:-1--1' for String::Bag::Solver::BEGIN
Negative first line number in %DB::sub entry
'lib/String/Bag/Solver.pm:-1--1' for String::Bag::Solver::be...@0
Negative last line number in %DB::sub entry
'lib/String/Bag/Solver.pm:-1--1' for String::Bag::Solver::be...@0
Negative first line number in %DB::sub entry
'lib/String/Bag/Solver.pm:-1-12' for
String::Bag::Solver::__ANON__[lib/String/Bag/Solver.pm:12]
and the bad line numbers are recorded as 0's.
There's still some bad line number data (eg -1 being treated as 4294967295)
in the sub-caller data but I've added some logic to detect and ignore
that in report generation.
Try r1341 in svn (http://perl-devel-nytprof.googlecode.com/svn/trunk)
or else wait for the next dev release, which I hope will be in a day or three.
Tim.
--
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]