#46156 [Asn]: Infinite recursion in class destructor causes crash

From: Date: Fri, 05 Dec 2008 07:28:29 +0000
Subject: #46156 [Asn]: Infinite recursion in class destructor causes crash
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-131611@lists.php.net to get a copy of this message
 ID:               46156
 Updated by:       kalle@php.net
 Reported By:      kalle@php.net
 Status:           Assigned
 Bug Type:         Reproducible crash
 Operating System: *
 PHP Version:      5CVS-2008-11-11
 Assigned To:      dmitry
 New Comment:

I've discovered one more crash and reported here of the same type:
http://bugs.php.net/bug.php?id=46754


Previous Comments:
------------------------------------------------------------------------

[2008-09-23 10:00:25] kalle@php.net

Description:
------------
Creating a new instance of the same class in a class destructor which
causes infinite recursion will cause PHP to crash, instead of throwing a
memory_limit error.

Dmitry told me to report this so it wouldn't be forgotten.

Reproduce code:
---------------
<?php
	class Crash
	{
		public function __destruct()
		{
			new self;
		}
	}

	new Crash;
?>

Expected result:
----------------
memory_limit error

Actual result:
--------------
Crash


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46156&edit=1



Thread (6 messages)

« previous php.bugs (#131611) next »