#49908 [Opn->Ver]: throwing exception in __autoload crashes when interface is not defined

From: Date: Mon, 19 Oct 2009 10:06:21 +0000
Subject: #49908 [Opn->Ver]: throwing exception in __autoload crashes when interface is not defined
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-143664@lists.php.net to get a copy of this message
 ID:               49908
 Updated by:       jani@php.net
-Summary:          php crashes when exception thrown in autoload
 Reported By:      fqqdk at freemail dot hu
-Status:           Open
+Status:           Verified
 Bug Type:         Reproducible crash
 Operating System: *
-PHP Version:      5.3.0
+PHP Version:      5.3, 6 (2009-10-19)
 New Comment:

Only crashes when the interface "Bar" is no defined.



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

[2009-10-18 10:19:51] sjoerd@php.net

Could reproduce with php 5.3-head.
Backtrace: http://pastebin.com/f35c15146

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

[2009-10-17 13:31:30] fqqdk at freemail dot hu

Description:
------------
PHP crashes with the below code:

Reproduce code:
---------------
function __autoload($className) {
	if($className == 'Foo') {
		class Foo implements Bar {};
	} else {
		throw new Exception;
	}
}

new Foo;

Expected result:
----------------
I don't know what to expect. The manual says, that you can't catch an 
exeption thrown in an autoload function, but the crash only happens
when 
the autoload function gets called the second time. Below code doesn't 
crash, but instead produces a Fatal error:
function __autoload($className) {
  throw new Exception;
}
new Foo;

Actual result:
--------------
Faulting application php.exe, version 5.3.0.0, faulting module 
php5ts.dll, version 5.3.0.0, fault address 0x0002358a.


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


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



Thread (5 messages)

« previous php.bugs (#143664) next »