in reply to Re^2: mod_perl debugging help
in thread mod_perl debugging help

Can you post the exact error message and the code of the subroutine that's supposed to be there? Any diagnostic is better than nothing if you're trying to locate a bug :-)

Replies are listed 'Best First'.
Re^4: mod_perl debugging help
by MiggyMan (Sexton) on Jun 22, 2006 at 19:47 UTC
    [error] Undefined subroutine &FormGenerator::handler called


    Originaly I did think this was a globals issue, it seems to be the most common cause of it, however i've gone through and removed any globals (running in strict).

    As for the code, I know it's not terribly helpfull but I cant really put it up, a) it's work b) it's about 680 lines :)

    What I really need at this point is new ideas on how to actualy locate the bug, much easier to fix when I actualy know what im looking for :)
      Hmm... are you using funky stuff like INIT handlers to load the FormGenerator module, or is the handler generated at runtime somewhere?

      My first guess would be that a new apache child gets started that doesn't load all required modules, (in other words, you're not sharing all the modules you think you do).

      Ofcourse, it's possible you're deleting the method somewhere, or it might be a nasty bug in some other method. Any special modules (especially C/XS) you're using?

        Nope, it's just a standard module, the usual "package Blah" and the subroutines below!

        As for the modules, I am using quite a few, have a gander and see if you see anything suspect!

        Data::Dumper
        Apache
        DBI
        HTML::EasyTags
        Apache::Reload
        XML::TreePP
        Apache::Request
        Apache::Constants qw(:response)
        Sort::Naturally

        Im also using 2 other modules which exist soley to service the 2 main FormGenerator modules.
        FormGenerator::Common
        FormGenerator::FormSubs
        Also it doesnt happen just on the first load, it's quite inconsistant, I can go hours without seeing it and then get it over and over!

      Is there anything else on the server that uses the 'FormGenerator' namespace?

      It's WAY too generic. If some other CGI running under mod_perl uses that namespace, when your script runs, it'll see that a module with that name is loaded, and not bother loading anything. You'll then get strange error messages about functions not found.

      (or worse, they both use the same subroutines names, and you end up with odd behaviour that is almost impossible to track down on larger systems)

        The only other thing in that namespace are the subordinate modules.

        And as for the name, I do plan to devise a less generic name for it however for the time being FormGenerator fits, tis one of those "does what it says on the tin" names, consider it a development name :)