Bug #72213 [NEW]: Finally leaks on nested exceptions
| From: | nikic@php.net | Date: | Fri, 13 May 2016 14:55:33 +0000 |
| Subject: | Bug #72213 [NEW]: Finally leaks on nested exceptions | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-201069@lists.php.net to get a copy of this message | ||
From: nikic
Operating system:
PHP version: master-Git-2016-05-13 (Git)
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Finally leaks on nested exceptions
Description:
------------
Attached script causes a leak:
caught b
[Fri May 13 16:51:34 2016] Script: '/home/nikic/php-src/t275.php'
/home/nikic/php-src/Zend/zend_objects.c(174) : Freeing 0x7F6FB46740C0
(152 bytes), script=/home/nikic/php-src/t275.php
=== Total 1 memory leaks detected ===
The leak is the exception backed up in the outer fast_call, which needs
to be discarded.
Test script:
---------------
<?php
function test() {
try {
throw new Exception('a');
} finally {
try {
throw new Exception('b');
} finally {
}
}
}
try {
test();
} catch (Exception $e) {
echo "caught {$e->getMessage()}\n";
}
--
Edit bug report at https://bugs.php.net/bug.php?id=72213&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72213&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72213&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72213&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72213&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72213&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72213&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72213&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72213&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72213&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72213&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72213&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72213&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72213&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72213&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72213&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72213&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72213&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72213&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72213&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72213&r=mysqlcfg