Bug #69887 [NEW]: yield leaks temporary variables when Generator is aborted

From: Date: Fri, 19 Jun 2015 21:34:01 +0000
Subject: Bug #69887 [NEW]: yield leaks temporary variables when Generator is aborted
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193706@lists.php.net to get a copy of this message
From: bwoebi Operating system: Irrelevant PHP version: 7.0Git-2015-06-19 (Git) Package: Scripting Engine problem Bug Type: Bug Bug description:yield leaks temporary variables when Generator is aborted Description: ------------ Temporary variables of an aborted vm stack are never freed and thus leak... Test script: --------------- $gen = (function(){ $tmp = 1; [$tmp] + yield; // temporary variable created, but never freed as it halts after yield })(); $gen->valid(); // run until first yield Expected result: ---------------- No memory leak Actual result: -------------- [Fri Jun 19 23:29:53 2015] Script: '/Users/Bob/Icicle/examples/repro2.php' Zend/zend_vm_execute.h(35171) : Freeing 0x103C5B480 (56 bytes), script=/Users/Bob/Icicle/examples/repro2.php [Fri Jun 19 23:29:53 2015] Script: '/Users/Bob/Icicle/examples/repro2.php' /Users/Bob/php-src-7.0x/Zend/zend_hash.c(128) : Freeing 0x103C61B40 (264 bytes), script=/Users/Bob/Icicle/examples/repro2.php === Total 2 memory leaks detected === -- Edit bug report at https://bugs.php.net/bug.php?id=69887&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69887&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69887&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69887&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69887&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69887&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69887&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69887&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69887&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69887&r=support Expected behavior: https://bugs.php.net/fix.php?id=69887&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69887&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69887&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69887&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69887&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69887&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69887&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69887&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69887&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69887&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69887&r=mysqlcfg

« previous php.bugs (#193706) next »