BlueWlvrn has asked for the wisdom of the Perl Monks concerning the following question:

Okay, lets get the details out of the way first

This is perl, v5.8.0 built for i386-linux-thread-multi All of the modules used:

CGI qw(:standard ); CGI::Carp; CGI::Widget::Tabs; Carp; DBI; Data::Dumper; Dumpvalue; Exporter; File::Basename; FileHandle; HTML::Entities; HTML::Parser; HTTP::Date qw(parse_date); URI::Escape(); base qw(Exporter); vars qw($VERSION @ISA); vars qw/$VERSION/;

They aren't all in the same package.

The problem.

When I profile, I get a tmon.out file that causes dprofpp to spew garbage no matter what switches are used w/dprofpp.

Using a different program, but one that uses the same module developed by me, I get DB sub errors when trying to run w/ -d:DProf.

Here are those errors:

[Thu Sep 25 11:13:54 2003] DB.pm: Subroutine sub redefined at /usr/lib +/perl5/5.8.0/DB.pm line 62. Undefined subroutine &main:: called at /usr/lib/perl5/5.8.0/DB.pm line + 73. Compilation failed in require at ./scripts/autorun.pl line 13. BEGIN failed--compilation aborted at ./scripts/autorun.pl line 13. Undefined subroutine &main:: called at /usr/lib/perl5/5.8.0/DB.pm line + 78. END failed--call queue aborted at ./scripts/autorun.pl line 13. Undefined subroutine &main:: called at /usr/lib/perl5/5.8.0/DB.pm line + 78. END failed--call queue aborted at ./scripts/autorun.pl line 13.

It should be noted of course, that both scripts work perfectly fine outside of the DProf environment. The first one runs fine both under CGI and command line, the second one is a command line only script.

If anyone knows of conflicts with DProf and any of the modules I've listed, please let me know. I figured I'd try and ask before I went on the peal the onion crusade to identify the culprit.

Thanks in advance,

Bruce

Replies are listed 'Best First'.
Re: Devel::DProf and persistant crashing
by BrowserUk (Patriarch) on Sep 25, 2003 at 19:48 UTC

    This sounds eerily like a problem I encountered with dprof at DProf problem. At that time, there was no known cure (other than if you could track down where to add a commented out print statement with the right parameters:).

    The best alternative was to use either Devel::SmallProf or Devel::Profiler.

    I have had good results using the former and usually use it as a second pass after I have used DProf as it gives a line-by-line profile of the code rather than sub-by-sub which can be immensely useful.

    I haven't managed to get Devel::Profiler to work for me, but it apparently has the advantage of not using the debugger interface (which the other 2 do) and so is less prone to 'upsetting' perl.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
    If I understand your problem, I can solve it! Of course, the same can be said for you.

      Well both of those packages worked for me.

      Thanks for the help.

      -Bruce