We have a few starman processes which we successfully profile with the
latest Devel::NYTProf (4.06) and Starman in Perl 5.10.1. However, on
moving to 5.14.0 the nytprofhtml program nearly always dies with:
$ nytprofhtml -f nytprof.out.2034 -o ~/public_html/p6
Reading nytprof.out.2034
Profile data incomplete, inflate error -5 ((null)) at end of input
file, perhaps the process didn't exit cleanly or the file has been
truncated (refer to TROUBLESHOOTING in the documentation)
Turning off compress with NYTPROF=compress=0 results in:
Profile format error whilst reading string at 54818: expected 45 got
41, end of file at /home/martin/perl5/perlbrew/perls/perl-5.14.0/lib/
site_perl/5.14.0/i686-linux/Devel/NYTProf/Data.pm line 84.
So I tried posix_exit=1 and sigexit=1 and the results are confusing as
some times it works and sometimes it does not and I'm struggling to
find a combination which always works. However,
compress=0:posix_exit=1 seems to produce the fewest failures. The test
code I'm using is:
my $app = sub {
return [200, ['Content-Type' => 'text/plain'], ["hello, world
\n"]];
}
and the command line:
NYTPROF='posix_exit=1:compress=0' perl -d:NYTProf /home/martin/perl5/
perlbrew/perls/perl-5.14.0/bin/starman --max_servers=1 --workers=1 --
port=9123 hello.psgi
I always actually put http:localhost:9123 in a browser to make sure
the child process under starman actually does something. I notice that
the nytprof.out.PID file does grow a little when ctrl/c is hit so
writing to it is happening on exit but more often than note it seems
incomplete.
I also notice if I run the above command in 5.10.1 and do nothing but
wait 5s and ctrl/c it the nytprof.out.PID file is around 535K and yet
when I repeat in 5.14.0/5.14.1/5.15.3 it is about 8.5K.
It seems 5.10.0 and 5.10.1 works but 5.14.0, 5.14.1, 5.12.4, 5.15.3
all fail most of the time regardless of use of compress/sigexit/
posix_exit.
Also I get a lot of the following when it does work in versions after
5.10.1 (can't remember which one it was now - sorry):
Use of uninitialized value in sprintf at /home/martin/perl5/perlbrew/
perls/perl-5.15.3/bin/nytprofhtml line 739.
Use of uninitialized value in division (/) at /home/martin/perl5/
perlbrew/perls/perl-5.15.3/lib/site_perl/5.15.3/i686-linux/Devel/
NYTProf/Data.pm line 110.
Use of uninitialized value in subtraction (-) at /home/martin/perl5/
perlbrew/perls/perl-5.15.3/lib/site_perl/5.15.3/i686-linux/Devel/
NYTProf/Data.pm line 111.
I also occasionally get
Unable to open '(eval 1)[/home/martin/perl5/perlbrew/perls/perl-5.10.1/
lib/site_perl/5.10.1/i686-linux/Devel/NYTProf/Core.pm:37]' for
reading: No such file or directory Try running /home/martin/perl5/
perlbrew/perls/perl-5.10.1/bin/nytprofhtml in the same directory as
you ran Devel::NYTProf, or ensure @INC is correct.
and yet immediately afterwards I can see that file does exist and I am
running in the same dir.
To recap, perl 5.10.0 and 5.10.1 work reliably every time with the
above test and no NYTPROF flags.
Any ideas what to try next?
Thanks
--
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]