From: toolshed51 at yahoo dot com
Operating system: FreeBSD 4.9
PHP version: 4.3.3
PHP Bug Type: Reproducible crash
Bug description: Recursive function call crashes engine
Description:
------------
Engine crashes when passed buggy recursive function calling code.
PHP 4.3.3 (cli) (built: Sep 17 2003 22:54:17)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
with Zend Optimizer v2.1.0, Copyright (c) 1998-2003, by Zend
Technologies
Reproduce code:
---------------
<?php
function debug ($text='', $level=2, $file='', $line=0) {
if (is_writable ('/logs/error.log')) {
error_log ("$debug_string\n", 3, '/logs/error.log');
} else {
debug ('Error Log Not Writable', 2);
}
}
debug ('Test');
?>
Expected result:
----------------
I expect an out of memory error or something to be caught. Instead it
seems the engine gets caught in an infinite loop like my code and dies
painfully.
Actual result:
--------------
0x28ade8cb in zend_assign_to_variable_reference () from
/usr/local/libexec/apache/ZendOptimizer.so
Or! If I add a call to error_log to count function calls (in my case it
was 8976 before engine crashed)... then I get...
0x81a07c1 in zend_hash_quick_add_or_update () from
/usr/local/libexec/apache/ZendOptimizer.so
If I remove zend_optimzer.so from php.ini I get this error
0x819aa2e in zendi_smart_strcmp ()
Backtrace is thousands and thousands of any of the given above messages.
--
Edit bug report at http://bugs.php.net/?id=26306&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26306&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26306&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26306&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26306&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26306&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=26306&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26306&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26306&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26306&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26306&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26306&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26306&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26306&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26306&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26306&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26306&r=float