Apache gives white screens using perl

I was recently having a problem where every so often (6 or 7 clicks) navigating around my web app it would return a white screen. restarting apache would temporarily fix the problem but then something would happen which triggered it and it would happen constantly from that point. more frustratingly it didnt seem to leave anything in the error log.

I tried a number of things to diagnose the problem. Eventually I wrote a script which took the pid of the apache thread serving the request. turns out it was always the same pids that served up the empty pages. the problem was bad programming on my part. i was creating large perl objects and not disposing of them. im guessing something like a perl stack overflow happened killing mod perl. apache hands off to mod_perl ,which is now dead, so returns 0 which apache serves and the web browser interprets as an empty response.

i removed the offending package and was unable to repoduce the problem. moral of the story: cyclic references break garabage collection and mod perl doesnt croak when it dies…

Leave a Reply

Your email address will not be published. Required fields are marked *

*