[Classiccity-pm] My segfault issue under mod_perl

Mark Hazen markh at markh.com
Fri Feb 13 12:18:36 CST 2004


Talked to Andy Lester this morning, and he'd had the same problem I had with
mod_perl (not TT2 specifically) segfaulting. Turns out it's a problem he got
one of the other #perl regulars to get interested in figuring out with him:

http://use.perl.org/~petdance/journal/14723

The crux: using mod_perl and mod_php at the same time can cause this to
happen, due to a workaround in perl for putenv() functions in libc which
suffered from memory leaks. From the above URL:


"The malbehavior is caused by Perl's handling of the pointer to the process
environment (usually accessed via the global variable environ). Some  
implementations of putenv(3) leak memory (or, to be fair, used to leak
memory, but have been fixed), and perl has code that works around this. To
do so, perl allocates its own memory for the environment, copies the
original environment to the new memory block, frees the original pointer,
and assigns the new pointer to environ.

A call to PHP's putenv routine results in a call to the C library, which
will use an internal pointer, one that points to memory that was already
freed by perl, to reallocate memory for environ. This results in a
segmentation fault."

Solution is listed on the page as well, but involves recompiling perl,
and therefore apache, php4, and all the perl modules. Fun!

My solution: comment out the php4 segments, since I'm not using it. :)


-mh.
----
   . _+m"m+_"+_    Mark Hazen
 d' Jp     qh qh
Jp  O       O  O
Yb  Yb     dY dY
 O   "Y5m2Y"  "  even the mightiest wave starts out as a ripple.
  "Y_            why make waves when it's easier to nurture ripples?



More information about the Classiccity-pm mailing list