You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Sean Davis <sd...@mail.nih.gov> on 2004/12/17 13:59:19 UTC
Debugging for mod_perl
I am a new user to mod_perl. I have a module that does some
computation and has methods for generating png (using GD) and html. I
wrapped it in a thin content handler. It works as expected except that
when I include it in the httpd.conf file, I start noticing that the png
colors are altered on some requests. Furthermore, it also alters the
colors on another script (running under apache::registry) that generate
pngs dynamically. However, when I run the same second script under
plain cgi and under apache::registry without my handler included in
httpd.conf, it does not have these display the strange color behavior.
Running my calculation module with warnings and use strict results in
no warnings, etc.
I know I haven't given enough information to solve the problem, but I
feel like I have some issue with a global variable or a memory leak
somewhere that is causing a problem in the mod_perl setting.
Unfortunately, I am using multiple third-party modules, also, so
tracking this down by hand is a difficult proposition at best. What
tools/steps would folks suggest that I use to track down the issue?
Thanks,
Sean
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Debugging for mod_perl
Posted by Frank Wiles <fr...@wiles.org>.
On Fri, 17 Dec 2004 07:59:19 -0500
Sean Davis <sd...@mail.nih.gov> wrote:
> I am a new user to mod_perl. I have a module that does some
> computation and has methods for generating png (using GD) and html. I
>
> wrapped it in a thin content handler. It works as expected except
> that when I include it in the httpd.conf file, I start noticing that
> the png colors are altered on some requests. Furthermore, it also
> alters the colors on another script (running under apache::registry)
> that generate pngs dynamically. However, when I run the same second
> script under plain cgi and under apache::registry without my handler
> included in httpd.conf, it does not have these display the strange
> color behavior. Running my calculation module with warnings and use
> strict results in no warnings, etc.
>
> I know I haven't given enough information to solve the problem, but I
> feel like I have some issue with a global variable or a memory leak
> somewhere that is causing a problem in the mod_perl setting.
> Unfortunately, I am using multiple third-party modules, also, so
> tracking this down by hand is a difficult proposition at best. What
> tools/steps would folks suggest that I use to track down the issue?
You might check out Apache::DB from cpan, it will give you a Perl
debugger (much like gdb) so you can step through your code, and
the third-party modules code (if in Perl) and see where things are
going wrong.
You might also try running your httpd with only one process ( -X
I believe ) and see if it has the same behavior. I would also
check out:
http://perl.apache.org/docs/1.0/guide/porting.html#Sometimes_it_Works__Sometimes_it_Doesn_t
Hope this helps!
---------------------------------
Frank Wiles <fr...@wiles.org>
http://www.wiles.org
---------------------------------
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Debugging for mod_perl
Posted by Perrin Harkins <pe...@elem.com>.
On Fri, 2004-12-17 at 07:59 -0500, Sean Davis wrote:
> It works as expected except that
> when I include it in the httpd.conf file, I start noticing that the png
> colors are altered on some requests. Furthermore, it also alters the
> colors on another script (running under apache::registry) that generate
> pngs dynamically. However, when I run the same second script under
> plain cgi and under apache::registry without my handler included in
> httpd.conf, it does not have these display the strange color behavior.
I would debug this using a program like GET (from LWP) or lynx to
examine the headers and see if something is being set differently that
could cause this. I would also try diffing the output from the two to
see what's different.
Of course, you do know about the "TurnEverythingGreen" setting in
httpd.conf, right? (Kidding...)
- Perrin
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html