ID: 27868 Updated by: [EMAIL PROTECTED] Reported By: blackei2k at gmx dot de -Status: Open +Status: Verified Bug Type: Zend Engine 2 problem -Operating System: Linux +Operating System: * -PHP Version: 5.0.0RC1 +PHP Version: 5CVS-2004-04-07 New Comment:
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 16384 (LWP 20934)] 0x082a972d in zend_std_get_method (object=0x40e420bc, method_name=0x40e4213c "zar", method_len=3) at /usr/src/web/php/php5/Zend/zend_object_handlers.c:673 673 if (zend_hash_find(&zobj->ce->function_table, lc_method_name, method_len+1, (void **)&fbc) == FAILURE) { (gdb) bt #0 0x082a972d in zend_std_get_method (object=0x40e420bc, method_name=0x40e4213c "zar", method_len=3) at /usr/src/web/php/php5/Zend/zend_object_handlers.c:673 #1 0x082b72c7 in zend_init_method_call_handler (execute_data=0xbfffd800, opline=0x40e40420, op_array=0x40e35e54) at /usr/src/web/php/php5/Zend/zend_execute.c:2505 #2 0x082b4a07 in execute (op_array=0x40e35e54) at /usr/src/web/php/php5/Zend/zend_execute.c:1391 #3 0x0829a699 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/web/php/php5/Zend/zend.c:1057 #4 0x082686f6 in php_execute_script (primary_file=0xbffffbd0) at /usr/src/web/php/php5/main/main.c:1630 #5 0x082c7a92 in main (argc=2, argv=0xbffffc54) at /usr/src/web/php/php5/sapi/cli/php_cli.c:943 Previous Comments: ------------------------------------------------------------------------ [2004-04-05 10:16:31] blackei2k at gmx dot de This is getting stranger and stranger: I wanted to submit a bt, so i recompiled php with the --enable-debug flag. But now the segfault does not occure annymore. I get (using the provided testcase): $a == 0 in foo::_constructor Fatal error: Call to a member function zar() on a non-object in /var/www/foo/crash.php on line 29 As i mentioned in my first post, i used var_dump() to get closer to the error source, and while using it did not get a segfault. Are var_dump() and --enable-debug somehow related, so this is automatically resolved? Maybe it would help if others try my testcase on 5.0.0RC1 using Linux (2.4.21 i686) ------------------------------------------------------------------------ [2004-04-05 08:59:53] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. ------------------------------------------------------------------------ [2004-04-05 07:47:01] blackei2k at gmx dot de I got a working (segfaulting) test-case here: <?php class foo { function __construct() { $a = 0 ; if ($a == 0) throw new Exception ('$a == 0 in foo::_constructor'); } function zar() { return 0; } } class bar extends foo { function __construct() { try { parent::__construct(); } catch (Exception $e) { echo $e->getMessage() . "\n"; } return true; } } $o = new bar; $o->zar(); ?> Hope that helps ------------------------------------------------------------------------ [2004-04-05 07:26:08] blackei2k at gmx dot de Description: ------------ I get a segfault while running a script of mine. Here what apache's error.log says: [Mon Apr 5 13:36:36 2004] [notice] child pid 2072 exit signal Segmentation fault (11) It happens when i call the function set_common_vars() which is a method of a class. If i run var_dump($o) ($o being an instance of the class set_common_vars is a member of) the script errors as it should withoot segfaulting. The function ist defined as: function sets_common_vars() { $this->strCat = (isset ($_GET['load']) ? $_GET['load'] : 'homepage'); $this->strGet = $_SERVER['PHP_SELF'] . '?' . 'load=' . $strCat; return true; } This is very strange. I tried to build up a test-case as i thought it was related to the try {} catch blocks in the contructor, but it wasn't. My test-case did it's work as it was supposed to. I'm not sure what i can do, as the provided information above will most likely not help much tracing the bug to its source. As the new object model is based on ZE2 i have classified this as an engine issue. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27868&edit=1