Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ranguard (1858)

Ranguard
  (email not shown publicly)
http://leo.cuckoo.org/

Journal of Ranguard (1858)

Friday September 13, 2002
06:11 AM

PerlFreshRestart and Seg Faults

[ #7723 ]
I had a very nasty day last week. We're in testing of our complete recode of the site, mod_perl, TT, OO, the usual stuff. I'm comfortable with developing for mod_perl, now, but am always scared by the ever present pollution of data between processes.

We run our package tests, all is well, we install everything, all is well, we start the server (with -X, single user mode to cache any data contamination), all is well, we run through the entire site tailing error logs etc, all is well.

Someone makes a minor tweak and installs the code, restart the server, all is NOT well! My search prefs are now affecting someone else's. Nothing is appearing in the domain error logs. Another tweak and install, now we get segfaults when trying to do a search!

Panic sets in.

Install gdb, do a back trace, see lots of perl internal OPS that I haven't a clue about, then I check the main httpd_perl error log I see stuff about redefined subroutines, one of which is from my first CPAN module!

More panic, talk to LPM on IRC, get various suggestions, go check them out.... nothing...

Try running the code on another machine... it works...

Do some googleing... nothing...

Do some more googleing... ahhh... PerlFreshRestart can cause this sort of error...

Remove PerlFreshRestart... and life is good again....

Of course all of this took about 3 hours!

Moral, don't put stuff in your apache config just because it says so in the book and sounds like a good idea at the time. Only do it when you need it and have read up about it.

Someone mentions Apache::Reload as a good alternative, I've not tried it yet, and won't be unless I really need it and have time to test it out.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I mentioned that. But I was wrong. It's not quite the same thing. PerlFreshRestart reloads stuff in @INC when you give the server a HUP. Apache::Reload (and it's predecessor Apache::StatINC) do so on every request. They're more for development convenience (and boy, is it convenient!).

    I think that recommendation still stands that you stop and restart a mod_perl server, and don't give it a HUP/USR1.

    -Dom