php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37251 deadlock when custom error handler is to catch array type hint error
Submitted: 2006-04-30 17:34 UTC Modified: 2006-05-05 08:05 UTC
From: spam01 at pornel dot net Assigned: dmitry (profile)
Status: Closed Package: Reproducible crash
PHP Version: 6CVS-2006-04-30 (snap) OS: any? OS X tested
Private report: No CVE-ID: None
 [2006-04-30 17:34 UTC] spam01 at pornel dot net
Description:
------------
If I have custom error handler set and cause error by not giving arguments to function that expects array, PHP deadlocks (endless loop).

Without custom error handler same code outputs
"Catchable fatal error: Argument 1 passed to ... must be an array, called in ..."


Reproduce code:
---------------
<?php

function error_handler($errno, $errstr, $errfile, $errline, $context)
{
	echo 'OK';
}

set_error_handler('error_handler');


class Foo
{	
	function foo(array $foo)
	{
	}
}

$foo = new Foo();
$foo->foo();

Expected result:
----------------
'OK'

Actual result:
--------------
No output. 100% CPU usage.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-05 08:05 UTC] dmitry@php.net
Fixed in CVS HEAD.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 11:01:34 2024 UTC