Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the devel-nytprof CPAN distribution.

Report information
The Basics
Id: 46981
Status: resolved
Priority: 0/
Queue: devel-nytprof

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.09
Fixed in: (no value)



Subject: Test::More & NYTProf problem
NYTProf is fooled by #line directives into looking for a file that does not exist. This is a general problem profiling anything using Test::More. $ cat ~/tmp/test.plx #!/usr/bin/perl -w use Test::More tests => 1; is 1, 1; $ perl -d:NYTProf ~/tmp/test.plx 1..1 ok 1 $ nytprofhtml Generating report... Reading nytprof.out Writing report to nytprof directory Unable to open '/Users/schwern/devel/Test-Simple/cmp_ok [from /Users/schwern/tmp/test.plx line 4]' for reading: No such file or directory. Try running /usr/local/bin/nytprofhtml in the same directory as you ran Devel::NYTProf, or ensure @INC is correct. Ignoring '#line 1 "cmp_ok [from $file line $line]"' directive at line 838 - profile data for /usr/local/perl/5.10.0/lib/5.10.0/Test/Builder.pm will be out of sync with source!
I can't reproduce this. (I've tried perl 5.8.6 and 5.10.0 with an old Test::Builder and the current Test::Builder from Test- Simple-0.88).
(using the current trunk trunk)
I'm using 5.10.0 and Test::More 0.88, though it should effect earlier versions as well. Using the trunk version of Devel::NYTProf, http://perl-devel-nytprof.googlecode.com/svn/trunk r771, I get: $ perl -Mblib -d:NYTProf ~/tmp/test.plx Unable to determine line number in /Users/schwern/tmp/test.plx. Unable to determine line number in /Users/schwern/tmp/test.plx. Unable to determine line number in /Users/schwern/tmp/test.plx. Unable to determine line number in /Users/schwern/tmp/test.plx. Unable to determine line number in /Users/schwern/tmp/test.plx. 1..1 ok 1 $ nytprofhtml Generating report... Reading nytprof.out Writing report to nytprof directory Unable to open '/Users/schwern/tmp/perl-devel-nytprof-read-only/cmp_ok [from /Users/schwern/tmp/test.plx line 4]' for reading: No such file or directory. Try running /usr/local/bin/nytprofhtml in the same directory as you ran Devel::NYTProf, or ensure @INC is correct. Ignoring '#line 1 "cmp_ok [from $file line $line]"' directive at line 838 - profile data for /usr/local/perl/5.10.0/lib/5.10.0/Test/Builder.pm will be out of sync with source! The code in question is inside an eval in Test::Builder::cmp_ok(). If you like you can ssh into guest@windhund.schwern.org and poke around. Its my laptop so it will be sporadically available. Send me an ssh key and I'll add you to the login.
Okay, I've reproduced it now. (I think I was doing something dumb before.) Try making this change: -#line 1 "cmp_ok [from $file line $line]" +#line 1 "(eval 0) cmp_ok [from $file line $line]" the leading (eval \d+) tells nytprof enough that it'll at least stop complaining and do something reasonably sane. Tim.
Now I come back to this I can't remember if I need to do, or did, anything to NYTProf, or if the change I proposed is a sufficient fix. Can you shed any light?
Subject: Re: [rt.cpan.org #46981] Test::More & NYTProf problem
Date: Tue, 01 Sep 2009 13:02:26 -0700
To: bug-devel-nytprof [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Tim_Bunce via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=46981 > > > Now I come back to this I can't remember if I need to do, or did, anything to NYTProf, or if the > change I proposed is a sufficient fix. > > Can you shed any light?
Both 2.10 and r858 still have the problem. Changing the file name to have "(eval 0) " at the front... $ perl -Ilib -d:NYTProf ~/tmp/test.plx 1..1 NYTProf unsupported filename syntax '(eval 0) cmp_ok [from /Users/schwern/tmp/test.plx line 4]' at (eval 0) cmp_ok [from /Users/schwern/tmp/test.plx line 4] line 1. ok 1 $ nytprofhtml Generating report... Reading nytprof.out Writing report to nytprof directory Ignoring '#line 1 "(eval 0) cmp_ok [from $file line $line]"' directive at line 1063 - profile data for /Users/schwern/devel/Test-Simple/lib/Test/Builder.pm will be out of sync with source! I'm not sure how to fix this unless NYTProf can somehow ignore the #line directive. I presume that changes the information in the ops from which NYTProf is drawing its information? Maybe I'm being too clever with the eval renaming. -- 191. Our Humvees cannot be assembled into a giant battle-robot. -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army http://skippyslist.com/list/
Subject: Re: [rt.cpan.org #46981] Test::More & NYTProf problem
Date: Tue, 01 Sep 2009 13:01:45 -0700
To: bug-devel-nytprof [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Tim_Bunce via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=46981 > > > Now I come back to this I can't remember if I need to do, or did, anything to NYTProf, or if the > change I proposed is a sufficient fix. > > Can you shed any light?
Both 2.10 and r858 still have the problem. Changing the file name to have "(eval 0) " at the front... $ perl -Ilib -d:NYTProf ~/tmp/test.plx 1..1 NYTProf unsupported filename syntax '(eval 0) cmp_ok [from /Users/schwern/tmp/test.plx line 4]' at (eval 0) cmp_ok [from /Users/schwern/tmp/test.plx line 4] line 1. ok 1 $ nytprofhtml Generating report... Reading nytprof.out Writing report to nytprof directory Ignoring '#line 1 "(eval 0) cmp_ok [from $file line $line]"' directive at line 1063 - profile data for /Users/schwern/devel/Test-Simple/lib/Test/Builder.pm will be out of sync with source! I'm not sure how to fix this unless NYTProf can somehow ignore the #line directive. I presume that changes the information in the ops from which NYTProf is drawing its information? Maybe I'm being too clever with the eval renaming. -- 191. Our Humvees cannot be assembled into a giant battle-robot. -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army http://skippyslist.com/list/
Subject: Re: [rt.cpan.org #46981] Test::More & NYTProf problem
Date: Tue, 01 Sep 2009 13:15:07 -0700
To: bug-devel-nytprof [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Tim_Bunce via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=46981 > > > Now I come back to this I can't remember if I need to do, or did, anything to NYTProf, or if the > change I proposed is a sufficient fix. > > Can you shed any light?
Both 2.10 and r858 still have the problem. Changing the file name to have "(eval 0) " at the front... $ perl -Ilib -d:NYTProf ~/tmp/test.plx 1..1 NYTProf unsupported filename syntax '(eval 0) cmp_ok [from /Users/schwern/tmp/test.plx line 4]' at (eval 0) cmp_ok [from /Users/schwern/tmp/test.plx line 4] line 1. ok 1 $ nytprofhtml Generating report... Reading nytprof.out Writing report to nytprof directory Ignoring '#line 1 "(eval 0) cmp_ok [from $file line $line]"' directive at line 1063 - profile data for /Users/schwern/devel/Test-Simple/lib/Test/Builder.pm will be out of sync with source! I'm not sure how to fix this unless NYTProf can somehow ignore the #line directive. I presume that changes the information in the ops from which NYTProf is drawing its information? Maybe I'm being too clever with the eval renaming. -- 191. Our Humvees cannot be assembled into a giant battle-robot. -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army http://skippyslist.com/list/
Subject: Re: [rt.cpan.org #46981] Test::More & NYTProf problem
Date: Tue, 1 Sep 2009 22:55:52 +0100
To: Michael G Schwern via RT <bug-devel-nytprof [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
On Tue, Sep 01, 2009 at 04:03:51PM -0400, Michael G Schwern via RT wrote: Show quoted text
> > Now I come back to this I can't remember if I need to do, or did, anything to NYTProf, or if the > > change I proposed is a sufficient fix. > > > > Can you shed any light?
> > Both 2.10 and r858 still have the problem. > > Changing the file name to have "(eval 0) " at the front... > > $ perl -Ilib -d:NYTProf ~/tmp/test.plx > 1..1 > NYTProf unsupported filename syntax '(eval 0) cmp_ok [from /Users/schwern/tmp/test.plx line 4]'
Show quoted text
> I'm not sure how to fix this unless NYTProf can somehow ignore the #line > directive. I presume that changes the information in the ops from which > NYTProf is drawing its information?
Yes. There's custom code to handle AutoLoader (used by POSIX etc) but I'm not keen to keep adding more custom code for each new use-case. Show quoted text
> Maybe I'm being too clever with the eval renaming.
I can see value in it. The underlying problem here is that NYTProf is using the contents of the string to a) notice that's it's a string eval, b) find the file and line number of the string eval call. Looking at the NYTProf code (in get_file_id) I can see a simple workaround: don't have "]" as the last character in the #line string! You still need to start with "(eval " though. Try "(eval 0) cmp_ok at $file line $line". Tim.
Any news? I'm marking the ticket stalled for now but will likely close it after v3 is released (in days I hope).
Subject: Re: [rt.cpan.org #46981] Test::More & NYTProf problem
Date: Wed, 11 Nov 2009 00:18:29 -0800
To: bug-devel-nytprof [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Tim_Bunce via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=46981 > > > Any news? > > I'm marking the ticket stalled for now but will likely close it after v3 is released (in days I hope).
I changed the message as suggested and tried it with Devel::NYTProf from trunk@895. Its still noisy, but it works and generates a complete report. $ nytprofhtml Generating report... Reading nytprof.out Writing report to nytprof directory Ignoring '#line 1 "(eval 0) cmp_ok at $file line $line"' directive at line 1064 - profile data for /Users/schwern/devel/Test-Simple/lib/Test/Builder.pm will be out of sync with source! -- Insulting our readers is part of our business model. http://somethingpositive.net/sp07122005.shtml
Subject: Re: [rt.cpan.org #46981] Test::More & NYTProf problem
Date: Wed, 11 Nov 2009 16:34:50 +0000
To: Michael G Schwern via RT <bug-devel-nytprof [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
On Wed, Nov 11, 2009 at 11:24:00AM -0500, Michael G Schwern via RT wrote: Show quoted text
> Queue: devel-nytprof > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=46981 > > > Tim_Bunce via RT wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=46981 > > > > > Any news? > > > > I'm marking the ticket stalled for now but will likely close it after v3 is released (in days I hope).
> > I changed the message as suggested and tried it with Devel::NYTProf from > trunk@895. Its still noisy, but it works and generates a complete report. > > $ nytprofhtml > Generating report... > Reading nytprof.out > Writing report to nytprof directory > Ignoring '#line 1 "(eval 0) cmp_ok at $file line $line"' directive at line > 1064 - profile data for /Users/schwern/devel/Test-Simple/lib/Test/Builder.pm > will be out of sync with source!
Noisy but true. Thanks for the update. Tim.
I think we can call this one closed. Shout if you'd rather not.