[imp] Apache segfaults due to error in Horde.php logMessage()

Gary Smith gary at primeexalia.com
Fri Aug 1 17:21:10 PDT 2003


This might be a dumb question and a little off topic but I have been hearing a lot about segment faults in apache lately due to bad php scripts.  Shouldn't this be fixed at the PHP core level?  Granted we need to fix the bad code but I have been observing this more and more lately.

I would suggest that when people post issue like segment faults they should also post the apache and php version so we can look at those root causes as well and start fixing those bugs to (which applies to a different list but you got to start somewhere).

Gary Smith





 -----Original Message-----
From: 	Magnus Nordseth [mailto:magnun at stud.ntnu.no] 
Sent:	Friday, August 01, 2003 5:15 PM
To:	imp at lists.horde.org
Subject:	[imp] Apache segfaults due to error in Horde.php logMessage()

 << File: Horde.patch >> << File: ATT537712.txt >> While investigating problems with apache childs segfaulting I came across
this posting:

  http://lists.horde.org/archives/imp/Week-of-Mon-20030526/032986.html 

Looking at Log.php (from the pear library) I found this comment:
/*
 * <b>You MUST call this method with the $var = &Log::singleton() syntax.
 * Without the ampersand (&) in front of the method name, you will not get
 * a reference, you will get a copy.</b>
*/

However, in Horde.php, the logger is instanciated like this:
$logger = Log::singleton($conf['log']['type'], $conf['log']['name'],
                         $conf['log']['ident'],$conf['log']['params']);

If I made the logMessage function return right before that instance got
used (the function returns right afterwards), ie before:
  
  $logger->log($message, $priority);

Then no segfaults occured. Problem area detected and confirmed :)

The minimal patch attatched seems to correct the problem.


-- 
Magnus Nordseth
Have spacesuit, will travel




More information about the imp mailing list