#23040 [Bgs->Opn]: Periodic Segmentation Faults

From: Date: Fri, 11 Apr 2003 19:28:02 +0000
Subject: #23040 [Bgs->Opn]: Periodic Segmentation Faults
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37578@lists.php.net to get a copy of this message
ID: 23040 Updated by: philip@php.net Reported By: tim at danan dot com -Status: Bogus +Status: Open Bug Type: Apache related Operating System: Redhat 8 PHP Version: 4.3.1 New Comment: After some discussion with Tim it appears this bug is still open. His original conclusion changed one hour later but this report remained untouched/closed. In summary: The origin of this bug has not been confirmed. Previous Comments: ------------------------------------------------------------------------ [2003-04-05 11:28:09] sniper@php.net Not bug in PHP -> bogus. ------------------------------------------------------------------------ [2003-04-05 07:29:45] tim at danan dot com I'm marking this one as closed. It appears that the problem was in apache, not php. It looks like a couple of recent glibc rpm updates were the source of the problem. After rebuilding apache and php I haven't seen a seg faults in over 16 hours. Perviously I was seeing 5-10 per hour. Thank you to those of you who took the time to help me with this problem. ------------------------------------------------------------------------ [2003-04-04 08:38:14] tim at danan dot com AHA! I just checked the script (and all of it's includes). There is only one putenv call in the entire forum system. Perhaps these code snippets can provide some insight (I'm going to see if I can crash the server with a short script containing these functions). //included from a conf file $SERVER_TZ = "America/New_York"; // the potential offending code function set_tz($timezone) { if( $timezone ) @putenv("TZ=".$timezone); } // one of the fields in users is time_zone. All users are currently set to "America/New_York" function get_user_by_id($id) { qobj("SELECT * FROM fud2_users WHERE id=".$id, $this); if( empty($this->id) ) return; return $this->id; } // within this init function the set_tz function is called function init_user() { $s = new fud_session; $u = new fud_user; $s->cookie_get_session(); if ( $s->user_id && $s->user_id<2000000000 ) { if ( !$u->get_user_by_id($s->user_id) ) { $u=NULL; $s->delete_session(); } /* else NOP */ } else $u = NULL; if ( empty($u) && empty($s->id) ) $s->save_session(); $rv[0] = $s; if( !empty($u) ) { set_tz($u->time_zone); define('d_thread_view', (($GLOBALS['TREE_THREADS_ENABLE']=='N'||$u->default_view=='msg'||$u->default_view=='tree_msg')?'msg':'tree')); define('t_thread_view', (($GLOBALS['TREE_THREADS_ENABLE']=='N'||$u->default_view=='msg'||$u->default_view=='msg_tree')?'thread':'threadt')); q("UPDATE fud2_users SET last_visit=".__request_timestamp__." WHERE id=".$u->id); $rv[1] = $u; }else { set_tz($GLOBALS["SERVER_TZ"]); define('d_thread_view', (($GLOBALS['TREE_THREADS_ENABLE']=='N'||$GLOBALS['DEFAULT_THREAD_VIEW']=='msg'||$GLOBALS['DEFAULT_THREAD_VIEW']=='tree_msg')?'msg':'tree')); define('t_thread_view', (($GLOBALS['TREE_THREADS_ENABLE']=='N'||$GLOBALS['DEFAULT_THREAD_VIEW']=='msg'||$GLOBALS['DEFAULT_THREAD_VIEW']=='msg_tree')?'thread':'threadt')); $rv[1] = NULL; if( !empty($GLOBALS["rid"]) && empty($GLOBALS["HTTP_COOKIE_VARS"]["frm_referer_id"]) ) set_referer_cookie($GLOBALS["rid"]); } define('s', $s->ses_id); define('_rsid', 'rid='.$u->id.'&amp;S='.s); define('_rsidl', 'rid='.$u->id.'&S='.s); define('_hs', '<input type="hidden" name="S" value="'.s.'">'); define('_uid', (($u->email_conf == 'Y')?$u->id:0)); return $rv; } ------------------------------------------------------------------------ [2003-04-04 08:13:21] tim at danan dot com I tried the cvs snapshot and I'm still seeing the seg faults. Is it possible that Apache is the problem here and not PHP? In other words, is the putenv setting with an enviroment variable for PHP or all of httpd? ------------------------------------------------------------------------ [2003-04-03 19:38:16] sniper@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip There have been couple of dozen fixes that might have also fixed this. So please give the snapshot a go. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/23040 -- Edit this bug report at http://bugs.php.net/?id=23040&edit=1

« previous php.bugs (#37578) next »