php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24006 Segmentation fault - related possibly to error handling functions
Submitted: 2003-06-03 23:55 UTC Modified: 2003-06-09 08:42 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: mikemc-phpbug at contactdesigns dot com Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 4.3.2 OS: Linux 2.4.x
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-06-03 23:55 UTC] mikemc-phpbug at contactdesigns dot com
I have code that ran fine under 4.3.1 compiled with Apache like so:

'./configure' '--with-openssl' '--enable-memory-limit' '--with-mysql=/usr/local/mysql' '--with-zlib' '--with-apache=../apache_1.3.27' '--enable-inline-optimization' '--with-curl=/usr/local' '--with-mcrypt=/usr/local'

It was compiled the same exact way with 4.3.2 except with a newer version of curl.

This same code now causes a segmentation fault under 4.3.2:

[Tue Jun  3 21:25:51 2003] [notice] child pid 12107 exit signal Segmentation fault (11)

The offending code is related to a user defined error handler.  My current workaround: remove the error handling code.  I have isolated the problem to a single file and a function within that file.  When I comment out the code that loads this file and calls that function, the segfaults stop and the code runs as normal:

//include_once('lib/Error/Handler.php');
//CDS_Error_Handler_Init();

Furthermore, I have to call the function - loading the file alone does not cause the problem.  This error handler is a very old version of our current one which has changed significantly and has no problems in 4.3.2.  You can find the code here:

http://caffeine.contactdesigns.com/~jolt/Handler.phps

I hope this helps - I am in no way put in a bind because of this bug - it is old code and does nothing for us now.  Just hoping to help PHP out in any way possible.  I tried out RC1  on the developemntal servers, but as it is sometimes, you don't catch the bug until you go to production.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-04 01:10 UTC] sniper@php.net
I can not reproduce this, I only get this:

Fatal error: CDS_Error_Handler_Init() - Missing parameters in /home/jani/t.php on line 62

(I just took that handler.phps and pasted it to a file and added the CDS_Error_Handler_Init(); line)

Could you please try creating a SHORT example script
which can be just copied and run..?
And/Or generate a GDB backtrace of this crash..

 [2003-06-04 01:47 UTC] mikemc-phpbug at contactdesigns dot com
Here are the config parameters you will need to set prior to running the code (I only changed 4 from the original config where the crash was happening):

// Set environment - either production or development

$CDS_CONFIG['ENV_MODE'] = 'production';

// Semicolon delimited list of developers responsible

$CDS_CONFIG['ADMINS'] = 'some@email.com';

// Error log - be sure to specify full path

$CDS_CONFIG['ERROR_LOG'] = '/tmp/error.log';

// Template to be displayed to end users in production environment when an error
// occurs.  For example, "The web server has fallen and can't get up" ;-)

$CDS_CONFIG['ERROR_TEMPLATE'] = '/tmp/error_template.html';

// Error callback function that can alter the way the error handler behaves.
// Read lib/Error/Handler.php for more information.

$CDS_CONFIG['ERROR_CALLBACK'] = NULL;

// Set the error reporting level based on the environment

$CDS_CONFIG['ERROR_REPORTING'] = ($CDS_CONFIG['ENV_MODE'] == 'development')
                               ? (E_ERROR | E_WARNING | E_PARSE | E_NOTICE)
                               : (E_ALL & ~E_NOTICE);

// Log that debug messages are sent to (tail -f this file during debugging)

$CDS_CONFIG['DEBUG_LOG'] = '/tmp/debug.log';

// Specify where debug output goes ("browser" or "log")

$CDS_CONFIG['DEBUG_MODE'] = 'browser';

// Regular expression specifying which variables are not sent to debug output

$CDS_CONFIG['DEBUG_EXCLUSION'] = '/.*(?:HTTP|CDS)/s';
 [2003-06-04 05:19 UTC] 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

I can not reproduce this crash with latest stable CVS checkout..

 [2003-06-09 08:42 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 15:01:29 2024 UTC