php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29966 __destruct causes segmentation fault
Submitted: 2004-09-03 09:36 UTC Modified: 2004-09-03 10:45 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: grnick at mail dot ru Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.1 OS: Redhat Linux 9.0
Private report: No CVE-ID: None
 [2004-09-03 09:36 UTC] grnick at mail dot ru
Description:
------------
If class includes function __destruct() any error of script  makes segmentation fault.

Configure Command: './configure' '--with-pgsql' '--with-mysql' '--with-apxs' '--with-apxs=/usr/local/apache/bin/apxs' '--enable-sysvsem' '--enable-sockets'

Apache/1.3.24
Loaded Modules 	mod_php5, mod_setenvif, mod_so, mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core


Reproduce code:
---------------
class C1 {}

class C2 {

	public function __construct() {
		$v = new C();
//		throw new Exception("");
	}
	public function __destruct() {$id=0;}
}

$obj = new C2();

Expected result:
----------------
Fatal error: Class 'C' not found in test.php on line 7

Actual result:
--------------
Apache error_log
[notice] child pid 11402 exit signal Segmentation fault (11)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-03 10:26 UTC] derick@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip
 [2004-09-03 10:45 UTC] tony2001@php.net
Reproduce code isn't working, but changing "new C()" to "new C2()" leads to endless loop and quite expected segfault.
So, it's expected behaviour imo.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 23:01:29 2024 UTC