Bug #71196 [NEW]: Memory leak with out-of-order live ranges

From: Date: Tue, 22 Dec 2015 12:36:35 +0000
Subject: Bug #71196 [NEW]: Memory leak with out-of-order live ranges
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198136@lists.php.net to get a copy of this message
From:             bwoebi
Operating system: Irrelevant
PHP version:      master-Git-2015-12-22 (Git)
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:Memory leak with out-of-order live ranges

Description:
------------
Outputting live ranges gives me:

LIVE RANGES:
        6: L6 - L7
(tmp/var)
        3: L2 - L9

Now, if there is an exception thrown between opline 2 and 5,
http://lxr.php.net/xref/PHP_MASTER/Zend/zend_execute.c#2586
has a
condition with a break;, hence cleanup won't be done for temporary 3
(the array).

Removing that break; fixes it, but maybe there is a better fix?

Test script:
---------------
try  {
        $a = "1";
        [1, (y().$a.$a) . ($a.$a)];
} catch (Error $e) {
        var_dump($e->getMessage());
}

Actual result:
--------------
HashTable leaks:

[Tue Dec 22 13:21:38 2015]  Script:  '/Users/Bob/php-src-X/_'
Zend/zend_vm_execute.h(7076) :  Freeing 0x10BC5A360 (56 bytes),
script=/Users/Bob/php-src-X/_
[Tue Dec 22 13:21:38 2015]  Script:  '/Users/Bob/php-src-X/_'
/Users/Bob/php-src-X/Zend/zend_hash.c(133) :  Freeing 0x10BC60A00 (264
bytes), script=/Users/Bob/php-src-X/_
=== Total 2 memory leaks detected ===


-- 
Edit bug report at https://bugs.php.net/bug.php?id=71196&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=71196&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=71196&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=71196&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=71196&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=71196&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=71196&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=71196&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=71196&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=71196&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=71196&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=71196&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=71196&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=71196&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71196&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=71196&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=71196&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=71196&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71196&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=71196&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=71196&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#198136) next »