php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29980 Segfault
Submitted: 2004-09-04 19:33 UTC Modified: 2004-09-17 12:32 UTC
From: guth at fiifo dot u-psud dot fr Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.1 OS: linux (Mandrake 9.2)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: guth at fiifo dot u-psud dot fr
New email:
PHP Version: OS:

 

 [2004-09-04 19:33 UTC] guth at fiifo dot u-psud dot fr
Description:
------------
I am happy to show you my fourth segmentation fault in PHP 5.0.1.
Segmentation faults don't help me to debug my code...

Reproduce code:
---------------
<?
class Cowllectif { }

class CowllectifTest {

	private $boom;

	public function __construct() {
		$this->boom = new Cowllectif;
		$this->boom->jean_ai_marre_de_php();
	}

	public function __destruct() {
		$this->boom->jean_ai_marre_de_php();
	}

}


$test = new CowllectifTest();
unset($test);
?>

Expected result:
----------------
Fatal error - Call to undefined method Cowllectif::jean_ai_marre_de_php()

Actual result:
--------------
Two fatal errors (sic), then a segmentation fault...

Apache error log :

/www/haricow/0.4/test.php(10) : Fatal error - Call to undefined method Cowllectif::jean_ai_marre_de_php()
/www/haricow/0.4/test.php(14) : Fatal error - Call to undefined method Cowllectif::jean_ai_marre_de_php()
[Sat Sep  4 19:28:02 2004] [notice] child pid 9981 exit signal Segmentation fault (11)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-05 09:08 UTC] aidan@php.net
Running your reproducable code on the latest CVS version (PHP 5.1.0-dev-200409050430)

$ php demo.php
PHP Fatal error:  Call to undefined method Cowllectif::jean_ai_marre_de_php() in /home/aidan/demo.php on line 10
Fatal error: Call to undefined method Cowllectif::jean_ai_marre_de_php() in /home/aidan/demo.php on line 10
PHP Fatal error:  Call to undefined method Cowllectif::jean_ai_marre_de_php() in /home/aidan/demo.php on line 14
Fatal error: Call to undefined method Cowllectif::jean_ai_marre_de_php() in /home/aidan/demo.php on line 14

Running on PHP 5.0.2-dev
$ php demo.php
Fatal error: Call to undefined method Cowllectif::jean_ai_marre_de_php() in /home/aidan/demo.php on line 10
Fatal error: Call to undefined method Cowllectif::jean_ai_marre_de_php() in /home/aidan/demo.php on line 14


Looks fine to me. Perhaps it was fixed in CVS, perhaps it is Bogus.

Could you try the latest CVS version and tell me if this bug still exists?
 [2004-09-05 09:16 UTC] tony2001@php.net
I can reproduce it with HEAD:

#0  0x08191ee4 in zend_objects_destroy_object (object=0x8285434, handle=2) at /home/dev/php-src/Zend/zend_objects.c:37
#1  0x08194a6c in zend_objects_store_del_ref (zobject=0x827289c) at /home/dev/php-src/Zend/zend_objects_API.c:144
#2  0x0817b95e in _zval_dtor (zvalue=0x827289c, __zend_filename=0x81e3520 "/home/dev/php-src/Zend/zend_execute_API.c", __zend_lineno=390)
    at /home/dev/php-src/Zend/zend_variables.c:55
#3  0x08170431 in _zval_ptr_dtor (zval_ptr=0x82727e8, __zend_filename=0x81e4420 "/home/dev/php-src/Zend/zend_variables.c", __zend_lineno=179)
    at /home/dev/php-src/Zend/zend_execute_API.c:390
#4  0x0817bc63 in _zval_ptr_dtor_wrapper (zval_ptr=0x82727e8) at /home/dev/php-src/Zend/zend_variables.c:179
#5  0x08185224 in zend_hash_destroy (ht=0x82802ac) at /home/dev/php-src/Zend/zend_hash.c:519
#6  0x0819214a in zend_objects_free_object_storage (object=0x827279c) at /home/dev/php-src/Zend/zend_objects.c:88
#7  0x081947c9 in zend_objects_store_free_object_storage (objects=0x8201eac) at /home/dev/php-src/Zend/zend_objects_API.c:72
#8  0x0816ff60 in shutdown_executor () at /home/dev/php-src/Zend/zend_execute_API.c:271
#9  0x0817d3ad in zend_deactivate () at /home/dev/php-src/Zend/zend.c:826
#10 0x081376ce in php_request_shutdown (dummy=0x0) at /home/dev/php-src/main/main.c:1216
#11 0x081b07e0 in main (argc=3, argv=0xbffff8d4) at /home/dev/php-src/sapi/cli/php_cli.c:1046
 [2004-09-06 11:24 UTC] guth at fiifo dot u-psud dot fr
(sorry for english)

I can't reproduce it with other computers (redhat & mandrake) with both versions 5.0.0 and 5.0.1

I will try with my computer with 5.0.2-dev.
 [2004-09-06 18:56 UTC] guth at fiifo dot u-psud dot fr
Same segfault with last CVS (php5-STABLE-200409061430).

gdb backtrace :

(gdb) run /www/haricow/0.4/test.php
Starting program: /usr/local/bin/php /www/haricow/0.4/test.php

Fatal error: Call to undefined method Cowllectif::jean_ai_marre_de_php() in /www/haricow/0.4/test.php on line 10

Fatal error: Call to undefined method Cowllectif::jean_ai_marre_de_php() in /www/haricow/0.4/test.php on line 14

Program received signal SIGSEGV, Segmentation fault.
0x082043b8 in zend_objects_destroy_object (object=0x8305914, handle=2)
    at /usr/src/php5-STABLE-200409061430/Zend/zend_objects.c:37
37                      if (destructor->op_array.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED)) {
(gdb) backtrace
#0  0x082043b8 in zend_objects_destroy_object (object=0x8305914, handle=2)
    at /usr/src/php5-STABLE-200409061430/Zend/zend_objects.c:37
#1  0x08206edc in zend_objects_store_del_ref (zobject=0x831b5b4)
    at /usr/src/php5-STABLE-200409061430/Zend/zend_objects_API.c:144
#2  0x081ee116 in _zval_dtor (zvalue=0x831b5b4,
    __zend_filename=0x8262ea0 "/usr/src/php5-STABLE-200409061430/Zend/zend_execute_API.c", __zend_lineno=391) at /usr/src/php5-STABLE-200409061430/Zend/zend_variables.c:61
#3  0x081e2950 in _zval_ptr_dtor (zval_ptr=0x831be68,
    __zend_filename=0x8263de0 "/usr/src/php5-STABLE-200409061430/Zend/zend_variables.c", __zend_lineno=193) at /usr/src/php5-STABLE-200409061430/Zend/zend_execute_API.c:391
#4  0x081ee468 in _zval_ptr_dtor_wrapper (zval_ptr=0x831be68)
    at /usr/src/php5-STABLE-200409061430/Zend/zend_variables.c:193
#5  0x081f7a50 in zend_hash_destroy (ht=0x831593c)
    at /usr/src/php5-STABLE-200409061430/Zend/zend_hash.c:519
#6  0x0820461e in zend_objects_free_object_storage (object=0x831bd8c)
    at /usr/src/php5-STABLE-200409061430/Zend/zend_objects.c:88
#7  0x08206c39 in zend_objects_store_free_object_storage (objects=0x82873e4)
    at /usr/src/php5-STABLE-200409061430/Zend/zend_objects_API.c:72
#8  0x081e247f in shutdown_executor ()
    at /usr/src/php5-STABLE-200409061430/Zend/zend_execute_API.c:272
#9  0x081efab7 in zend_deactivate ()
    at /usr/src/php5-STABLE-200409061430/Zend/zend.c:819
#10 0x081a8660 in php_request_shutdown (dummy=0x0)
    at /usr/src/php5-STABLE-200409061430/main/main.c:1212
#11 0x08221800 in main (argc=2, argv=0xbffff6b4)
    at /usr/src/php5-STABLE-200409061430/sapi/cli/php_cli.c:1046
#12 0x402a2c57 in __libc_start_main () from /lib/i686/libc.so.6
 [2004-09-17 12:32 UTC] stas@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

I think it should be fixed now.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 22:01:33 2024 UTC