(At this stage I don't have a lot of information to deliver on this one; I'll add further details as I track it down. I'd appreciate a note if this has already been addressed and I cant find it in bugzilla.) We have a web-application using apache/php3/postgresql (also python, but the python parts dont give us any trouble). Occasionally, but frequent enough that I can repeat it, an access to a page (in php3, with some postgresql queries) will cause the httpd process to segfault. When this happens, the rest of the httpd processes also segfault. As the processes die, the master process respawns then, and it appears that once this has happened with all the processes, its stable again for some time before the phenomenon happens again. This happens on a redhat-6.0 system as well, both 6.0 and 6.1 with the latest updates. (Will be doing what we can this end to isolate the problem, perhaps giving you a short segment of code that exhibits the fault. Any recommendations on debugging options to turn on, etc, in order to isolate the fault will be gratefully received). ------- Additional Comments From 10/20/99 18:16 ------- The effect of the bug was not quite like I described above: If I access a php3 page with the postgres queries, it will crash every /third/ time /after/ the script runs. The frequency might have something to do with the number of queries in the script. Also, I've managed to stop the crashes happening with judicious use of pg_free_result. The documententation indicates that using pg_free_result is optional, but it seems to stop the crashes. I believe now that the PostGreSQL connector for php3 is buggy, not freeing the result buffers properly when the script terminates.
The effect of the bug was not quite like I described above: If I access a php3 page with the postgres queries, it will crash every /third/ time /after/ the script runs. The frequency might have something to do with the number of queries in the script. Also, I've managed to stop the crashes happening with judicious use of pg_free_result. The documententation indicates that using pg_free_result is optional, but it seems to stop the crashes. I believe now that the PostGreSQL connector for php3 is buggy, not freeing the result buffers properly when the script terminates.
Okay... just did a bit more experimenting, and it seems to have nothing to do with postgresql, but simply the date function: If I do this: $thingy = 940739400; $return_time = date("M j G:i", $thingy); The httpd process will crash after the web page is serverd. If I comment out just the 'date' statement, it doesnt crash (doesnt display the date either :) If I wind the time back just a tad (in fact, before Sunday UTC), it works again. Different compiled versions of apache (the sample above was a compile from scratch), start crashing at different values. (The default redhat-6.1 shipment of apache crashes even before that Sunday; but its too late at night for me to figure out what date exactly... I don't think its that important anyway :)
Its a bug in PHP3 3.0.12. Viz: http://bugs.php.net/bugs.php3?id=2397 Sorry for filling up your disk, folks :)
not at all. you did very thorough research on this one and we are appreciative of your help.
fixed in next release (which will include 3.0.14)