From: [EMAIL PROTECTED]
Operating system:
PHP version: 6CVS-2006-03-24 (CVS)
PHP Bug Type: Scripting Engine problem
Bug description: Memory leak if cast operator throws an exception that is
caught
Description:
------------
If a cast operator inside try {} block throws an exception, the result of
casting is never destructed and, thus, a memory leak happens.
Reproduce code:
---------------
<?php
$u = "abc \udc00 def\n";
try {
echo (binary)$u;
} catch(UnicodeConversionException $e) {
}
?>
INI settings:
unicode_semantics = on
unicode.output_encoding = latin-1
unicode.runtime_encoding = latin-1
unicode.from_error_mode = U_CONV_ERROR_STOP | U_CONV_ERROR_EXCEPTION
Expected result:
----------------
no output
Actual result:
--------------
[Thu Mar 23 23:49:50 2006] Script: 't.php'
/homes/andrei/dev/php-src/Zend/zend_unicode.c(253) : Freeing 0x013EC764
(11 bytes), script=t.php
=== Total 1 memory leaks detected ===
--
Edit bug report at http://bugs.php.net/?id=36840&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36840&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36840&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36840&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36840&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36840&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36840&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36840&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36840&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36840&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36840&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36840&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36840&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36840&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36840&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36840&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36840&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36840&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36840&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36840&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36840&r=mysqlcfg