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: 43775
Status: resolved
Priority: 0/
Queue: devel-nytprof

People
Owner: Nobody in particular
Requestors: bohica [...] ntlworld.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.08
Fixed in: (no value)



Subject: Unable to open POSIX.pm during nytprofhtml
Since upgrading to 2.08 I seem to get an error during nytprofhtml which does not stop the output HTML generation: nytprofhtml -o nytprof Generating report... Reading nytprof.out Writing report to nytprof directory Unable to open '/home/martin/xxx/server/../../lib/POSIX.pm' for reading: No such file or directory. Try running /usr/bin/nytprofhtml in the same directory as you ran Devel::NYTProf, or ensure @INC is correct. I did run nytprofhtml in the same directory and INC is ok - it is set to the usual places plus: PERL5LIB=/home/martin/xxx/tools/modules/BET/lib:/home/martin/xxx/cgi in the environment. The -d:NYTProf was run in the same session as the nytprofhtml and INC is not touched in the perl code profiled. The code does however use POSIX. Martin -- Martin J. Evans Wetherby, UK
What path in @INC is POSIX.pm located via? Enable trace=1 and see what filename is given for POSIX.pm in the trace output during profiling.
On Tue Mar 03 17:17:20 2009, TIMB wrote: Show quoted text
> What path in @INC is POSIX.pm located via? > > Enable trace=1 and see what filename is given for POSIX.pm in the > trace output during > profiling.
All in the same session, the same dir, and I guarantee the program run does not change INC: cd /home/martin/xxx/server echo $PERL5LIB /home/martin/xxx/tools/modules/BET/lib:/home/martin/xxx/cgi locate POSIX.pm /usr/lib/perl5/5.8.8/i386-linux-thread-multi/POSIX.pm perl -MPOSIX -le 'print $POSIX::VERSION;' 1.09 perl -MLog::Log4perl -le 'print $Log::Log4perl::VERSION;' 1.13 Enabling trace provides a lot of output but nearly all of it is like the following repeated: start_cop_of_context: can't find next cop for LOOP line 65 at /usr/lib/perl5/site_perl/5.8.8/Log/Log4perl/Level.pm line 8 { 1106 TYPE = pushmark ===> 1107 FLAGS = (SCALAR,REF,MOD) } start_cop_of_context: can't find next cop for LOOP line 65 at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/POSIX.pm line 19 { 1106 TYPE = pushmark ===> 1107 FLAGS = (SCALAR,REF,MOD) } nytprofhtml -o nytprof Generating report... Reading nytprof.out Writing report to nytprof directory Unable to open '/home/martin/xxx/server/../../lib/POSIX.pm' for reading: No such file or directory. Try running /usr/bin/nytprofhtml in the same directory as you ran Devel::NYTProf, or ensure @INC is correct. BTW, I'm not the only one with this issue - when searching for the problem I saw someone has reported this as a debian bug. If you need more let me know. Martin -- Martin J. Evans Wetherby, UK
Subject: Re: [rt.cpan.org #43775] Unable to open POSIX.pm during nytprofhtml
Date: Wed, 4 Mar 2009 12:56:54 +0000
To: Martin J Evans via RT <bug-devel-nytprof [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
On Wed, Mar 04, 2009 at 03:59:32AM -0500, Martin J Evans via RT wrote: Show quoted text
> Queue: devel-nytprof > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=43775 > > > On Tue Mar 03 17:17:20 2009, TIMB wrote:
> > What path in @INC is POSIX.pm located via? > > > > Enable trace=1 and see what filename is given for POSIX.pm in the > > trace output during > > profiling.
> > All in the same session, the same dir, and I guarantee the program run > does not change INC:
Can you produce a small test case I can reproduce? Show quoted text
> Enabling trace provides a lot of output but nearly all of it is like the > following repeated: > > start_cop_of_context: can't find next cop for LOOP line 65
Setting the blocks=0 option should silence those. Also, you'd need trace=2 to see the lines I'm looking for: $ NYTPROF=trace=2:blocks=0 perl -d:NYTProf -e 'use POSIX;' # trace=2 # blocks=0 NYTProf init pid 37846, clock -1 Opened nytprof.out NYTProf enable_profile (previously disabled) to nytprof.out at /usr/local/perl58-i/lib/site_perl/5.8.6/darwin-thread-multi-2level/Devel/NYTProf.pm line 43. NYTProf pid 37846: first statement line 1 of -e at -e line 1. New fid 1 (after 0:1 ) 2 e0:0 -e , with src New fid 2 (after 1:7 ) 2 e0:0 /usr/local/perl58-i/lib/5.8.6/darwin-thread-multi-2level/POSIX.pm ... It's that "New fid" message for ../POSIX.pm I'd like to see. Also, later, try setting savesrc=1 - it might avoid the problem by storing the source of POSIX.pm into the profile data file. (Though I'm not sure it works for perl 5.8.8.) Tim.
On Wed Mar 04 07:59:01 2009, Tim.Bunce@pobox.com wrote: Show quoted text
> Can you produce a small test case I can reproduce?
I'll try. The program in question uses over 70 first-level perl modules (not sure how many dependencies these have). Actually, now I read on your example works - see below: Show quoted text
> > Enabling trace provides a lot of output but nearly all of it is like
> the
> > following repeated: > > > > start_cop_of_context: can't find next cop for LOOP line 65
> > Setting the blocks=0 option should silence those. > Also, you'd need trace=2 to see the lines I'm looking for:
cd /tmp mkdir p cd p mkdir nytprof NYTPROF=trace=2:blocks=0 perl -d:NYTProf -e 'use POSIX;' >x.x 2>&1 cat x.x: # trace=2 # blocks=0 NYTProf init pid 8902, clock 1 Opened nytprof.out NYTProf enable_profile (previously disabled) to nytprof.out at /usr/lib/perl5/si te_perl/5.8.8/i386-linux-thread-multi/Devel/NYTProf.pm line 43. NYTProf pid 8902: first statement line 1 of -e at -e line 1. New fid 1 (after 0:1 ) 2 e0:0 -e , with src New fid 2 (after 1:7 ) 2 e0:0 /usr/lib/perl5/5.8.8/i386-linux-thread-multi/P OSIX.pm New fid 3 (after 2:3 ) 2 e0:0 /usr/lib/perl5/5.8.8/AutoLoader.pm New fid 4 (after 3:3 ) 2 e0:0 /usr/lib/perl5/5.8.8/strict.pm New fid 5 (after 3:159 ) 2 e0:0 /usr/lib/perl5/5.8.8/i386-linux-thread-multi/a uto/POSIX/autosplit.ix New fid 6 (after 3:961 ) 2 e0:0 ../../lib/POSIX.pm /tmp/t/../../lib/POSIX.pm New fid 7 (after 6:3 ) 2 e0:0 /usr/lib/perl5/5.8.8/Exporter.pm finish_profile (last_pid 8902, getpid 8902, overhead 0.003677s, is_profiling 1) NYTProf disable_profile (previously enabled). writing sub line ranges New fid 8 (after 1:1 ) 4 e0:0 /usr/lib/perl5/5.8.8/i386-linux-thread-multi/X SLoader.pm Sub POSIX::__ANON__[/usr/lib/perl5/5.8.8/i386-linux-thread-multi/POSIX.pm:48] fi d 2 lines 48..48 Sub POSIX::load_imports fid 6 lines 743..958 Sub strict::unimport fid 4 lines 32..35 Sub POSIX::SigAction::new fid 2 lines 57..57 Sub Exporter::export fid 7 lines 25..27 Sub Exporter::export_ok_tags fid 7 lines 87..89 Sub Exporter::export_fail fid 7 lines 70..73 Sub AutoLoader::import fid 3 lines 119..168 Sub XSLoader::load fid 8 lines 22..100 Sub POSIX::BEGIN fid 2 lines 9..9 Sub POSIX::croak fid 2 lines 22..22 Sub Exporter::export_to_level fid 7 lines 79..81 Sub Exporter::as_heavy fid 7 lines 16..23 Sub AutoLoader::BEGIN fid 3 lines 173..173 Sub Exporter::export_tags fid 7 lines 83..85 Sub Exporter::require_version fid 7 lines 91..93 Sub POSIX::__ANON__[/usr/lib/perl5/5.8.8/i386-linux-thread-multi/POSIX.pm:44] fi d 2 lines 44..44 Sub POSIX::AUTOLOAD fid 2 lines 32..52 Sub POSIX::import fid 2 lines 14..20 Sub strict::bits fid 4 lines 11..23 Sub XSLoader::bootstrap_inherit fid 8 lines 103..112 Sub AutoLoader::__ANON__[/usr/lib/perl5/5.8.8/AutoLoader.pm:96] fid 3 lines 96.. 96 Sub AutoLoader::AUTOLOAD fid 3 lines 21..117 Sub Exporter::import fid 7 lines 29..66 Sub AutoLoader::unimport fid 3 lines 170..177 Sub Exporter::__ANON__[/usr/lib/perl5/5.8.8/Exporter.pm:63] fid 7 lines 63..63 Sub main::BEGIN fid 1 lines 1..1 Sub strict::import fid 4 lines 27..30 Sub POSIX::SigAction::BEGIN fid 2 lines 56..56 writing sub callers NOTE ls ../../lib/POSIX.pm ls: ../../lib/POSIX.pm: No such file or directory ls /tmp/t/../../lib/POSIX.pm ls: /tmp/t/../../lib/POSIX.pm: No such file or directory Show quoted text
> It's that "New fid" message for ../POSIX.pm I'd like to see.
Hopefully you have it. Show quoted text
> Also, later, try setting savesrc=1 - it might avoid the problem by > storing the source of POSIX.pm into the profile data file. (Though I'm > not sure it works for perl 5.8.8.) >
Still in /tmp/t unset PERL5LIB # just in case it is affecting anything NYTPROF=savesrc=1 perl -d:NYTProf -e 'use POSIX;' nytprofhtml -o nytprof Generating report... Reading nytprof.out Writing report to nytprof directory Unable to open '/tmp/t/../../lib/POSIX.pm' for reading: No such file or directory. Try running /usr/bin/nytprofhtml in the same directory as you ran Devel::NYTProf, or ensure @INC is correct. Unable to open '-e' for reading: No such file or directory. Martin -- Martin J. Evans Wetherby, UK
CC: develnytprof-dev [...] googlegroups.com
Subject: Re: [rt.cpan.org #43775] Unable to open POSIX.pm during nytprofhtml
Date: Wed, 4 Mar 2009 17:29:27 +0000
To: Martin J Evans via RT <bug-devel-nytprof [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
On Wed, Mar 04, 2009 at 08:37:18AM -0500, Martin J Evans via RT wrote: Show quoted text
> NYTPROF=trace=2:blocks=0 perl -d:NYTProf -e 'use POSIX;' >x.x 2>&1
Show quoted text
> NYTProf pid 8902: first statement line 1 of -e at -e line 1. > New fid 1 (after 0:1 ) 2 e0:0 -e , with src > New fid 2 (after 1:7 ) 2 e0:0 /usr/lib/perl5/5.8.8/i386-linux-thread-multi/POSIX.pm
There's POSIX.pm being loaded as fid 2. Show quoted text
> New fid 5 (after 3:159 ) 2 e0:0 /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/POSIX/autosplit.ix > New fid 6 (after 3:961 ) 2 e0:0 ../../lib/POSIX.pm /tmp/t/../../lib/POSIX.pm
Looks like those two are both artifacts of AutoLoader. Show quoted text
> Sub POSIX::__ANON__[/usr/lib/perl5/5.8.8/i386-linux-thread-multi/POSIX.pm:48] fid 2 lines 48..48 > Sub POSIX::load_imports fid 6 lines 743..958
I think that gives me enough to go on. The problem is the "#line ..." directive generated by AutoLoader. Here's errno.al, for example: # NOTE: Derived from ../../lib/POSIX.pm. # Changes made here will be lost when autosplit is run again. # See AutoSplit.pm. package POSIX; #line 120 "../../lib/POSIX.pm (autosplit into ../../lib/auto/POSIX/errno.al)" sub errno { usage "errno()" if @_ != 0; $! + 0; } # end of POSIX::errno 1; This is enough to reproduce it: perl -d:NYTProf -e 'use POSIX; errno()' nytprofhtml NYTProf needs to get smarter about noticing 'autosplit' and reverse engineering the appropriate path - which should match an already loaded fid (umm, maybe that fact can help simplify the implementation). Anyway, patches welcome! Tim.
Show quoted text
> Anyway, patches welcome
Have you ever tried editing a rt.cpan report from a mobile device like an iPod touch! I don't recommend it. In this case I'm afraid to say that even though I've had some small benefit from running nytprof (and I feel a bit guilty about it), I just cannot afford the extra time to provide a patch. I am so snowed under with work I am even having to sit on Dbd::odbc bug reports right now. Sorry. Martin -- Martin J. Evans Wetherby, UK
Subject: Re: [rt.cpan.org #43775] Unable to open POSIX.pm during nytprofhtml
Date: Thu, 5 Mar 2009 11:05:44 +0000
To: Martin J Evans via RT <bug-devel-nytprof [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
On Wed, Mar 04, 2009 at 05:00:01PM -0500, Martin J Evans via RT wrote: Show quoted text
> Queue: devel-nytprof > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=43775 > >
> > Anyway, patches welcome
> Have you ever tried editing a rt.cpan report from a > mobile device like an iPod touch! I don't recommend > it. In this case I'm afraid to say that even though I've > had some small benefit from running nytprof (and I > feel a bit guilty about it), I just cannot afford the extra > time to provide a patch. I am so snowed under with > work I am even having to sit on Dbd::odbc bug > reports right now. Sorry.
I understand Martin. No problem. (And thanks again for your excellent work with DBD::ODBC.) Tim.
Just saw a new Devel::NYTProf and it looked like you had addressed this rt. I confirm that release 2.08_91 of Devel::NYTProf fixes this bug. Martin -- Martin J. Evans Wetherby, UK
Fixed in 2.09