#34353 [Fbk-Csd]: func_get_arg(s) leak
ID: 34353 User updated by: devik at cdi dot cz Reported By: devik at cdi dot cz -Status: Feedback +Status: Closed Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 5.1.0RC1 New Comment: Oh ok, sorry - I found it is already fixed in CVS. Previous Comments: [2005-09-02 23:29:40] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip I can not reproduce with latest CVS checkout of PHP_5_1 branch. [2005-09-02 22:55:29] devik at cdi dot cz Description: There is missing INIT_PZVAL(return_value); at end of zif_func_get_arg thus it is leaking data. Reproduce code: --- ?php function f() { echo func_get_arg(0); } $a=$b=2; f($a); ? Expected result: 2/copy/build/php-5.1.0RC1/Zend/zend_vm_execute.h(167) : Freeing 0x08466324 (16 bytes), script=tst.php === Total 1 memory leaks detected === Actual result: -- 2 -- Edit this bug report at http://bugs.php.net/?id=34353edit=1
#33282 [Fbk-Opn]: Reference is killed by unset but not by other =
ID: 33282 User updated by: devik at cdi dot cz Reported By: devik at cdi dot cz -Status: Feedback +Status: Open Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 5CVS-2005-06-13 New Comment: Sorry but I still see the problem. Regarding version, I used directory name as I found nothing like 5CVS-2005-06-13 in the downloaded package. Previous Comments: [2005-09-02 07:42:21] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip And DO NOT invent your own style for the PHP version field!! (Hint: PHP version string does NOT contain 'PHP' in it..) [2005-06-09 15:33:27] devik at cdi dot cz Description: This is variation on #15025. But I accept the bug is feature and I show other bug it triggers. Basic problem is that when you take ref of array item then the item will turn into reference (which will survive even array copy). I don't see it as too big problem as long as I can get rid of the reference. unset does the trick as expected: $r = $A[0]; unset($r); - $A[0] is not reference any more But something like: $r = $othervar; doesn't kill reference - you see zval with is_ref=1 and refcount=1. It prevents you from writing handy code: $c = $c[$i] when traversing complex structures. Reproduce code: --- ? $a = array(1,2); $b = $a[0]; echo Now a[0] is reference, no problem\n; debug_zval_dump($a); $b = $a[1]; echo Now a[0] has no reason to be reference any longer, but a[1] is\n; debug_zval_dump($a); unset($b); echo Now a[1] reference is gone too BUT WAIT, a[0] is still a ref !\n; debug_zval_dump($a); ? Expected result: I expect $a without references. Actual result: -- $a[0] is reference with refcount(1). -- Edit this bug report at http://bugs.php.net/?id=33282edit=1
#34353 [NEW]: func_get_arg(s) leak
From: devik at cdi dot cz Operating system: Linux PHP version: 5.1.0RC1 PHP Bug Type: Scripting Engine problem Bug description: func_get_arg(s) leak Description: There is missing INIT_PZVAL(return_value); at end of zif_func_get_arg thus it is leaking data. Reproduce code: --- ?php function f() { echo func_get_arg(0); } $a=$b=2; f($a); ? Expected result: 2/copy/build/php-5.1.0RC1/Zend/zend_vm_execute.h(167) : Freeing 0x08466324 (16 bytes), script=tst.php === Total 1 memory leaks detected === Actual result: -- 2 -- Edit bug report at http://bugs.php.net/?id=34353edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34353r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34353r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34353r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=34353r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=34353r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34353r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34353r=needscript Try newer version: http://bugs.php.net/fix.php?id=34353r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34353r=support Expected behavior: http://bugs.php.net/fix.php?id=34353r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34353r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34353r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=34353r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34353r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=34353r=dst IIS Stability: http://bugs.php.net/fix.php?id=34353r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34353r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34353r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34353r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34353r=mysqlcfg
#33282 [Fbk-Opn]: Reference is killed by unset but not by other =
ID: 33282 User updated by: devik at cdi dot cz Reported By: devik at cdi dot cz -Status: Feedback +Status: Open Bug Type: Zend Engine 2 problem Operating System: Linux -PHP Version: 5.0.4 +PHP Version: php5-STABLE-200506131036 New Comment: The same - still exhibits the behaviour. Previous Comments: [2005-06-13 10:49:48] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.0-win32-latest.zip [2005-06-09 15:33:27] devik at cdi dot cz Description: This is variation on #15025. But I accept the bug is feature and I show other bug it triggers. Basic problem is that when you take ref of array item then the item will turn into reference (which will survive even array copy). I don't see it as too big problem as long as I can get rid of the reference. unset does the trick as expected: $r = $A[0]; unset($r); - $A[0] is not reference any more But something like: $r = $othervar; doesn't kill reference - you see zval with is_ref=1 and refcount=1. It prevents you from writing handy code: $c = $c[$i] when traversing complex structures. Reproduce code: --- ? $a = array(1,2); $b = $a[0]; echo Now a[0] is reference, no problem\n; debug_zval_dump($a); $b = $a[1]; echo Now a[0] has no reason to be reference any longer, but a[1] is\n; debug_zval_dump($a); unset($b); echo Now a[1] reference is gone too BUT WAIT, a[0] is still a ref !\n; debug_zval_dump($a); ? Expected result: I expect $a without references. Actual result: -- $a[0] is reference with refcount(1). -- Edit this bug report at http://bugs.php.net/?id=33282edit=1
#33282 [NEW]: Reference is killed by unset but not by other =
From: devik at cdi dot cz Operating system: Linux PHP version: 5.0.4 PHP Bug Type: Scripting Engine problem Bug description: Reference is killed by unset but not by other = Description: This is variation on #15025. But I accept the bug is feature and I show other bug it triggers. Basic problem is that when you take ref of array item then the item will turn into reference (which will survive even array copy). I don't see it as too big problem as long as I can get rid of the reference. unset does the trick as expected: $r = $A[0]; unset($r); - $A[0] is not reference any more But something like: $r = $othervar; doesn't kill reference - you see zval with is_ref=1 and refcount=1. It prevents you from writing handy code: $c = $c[$i] when traversing complex structures. Reproduce code: --- ? $a = array(1,2); $b = $a[0]; echo Now a[0] is reference, no problem\n; debug_zval_dump($a); $b = $a[1]; echo Now a[0] has no reason to be reference any longer, but a[1] is\n; debug_zval_dump($a); unset($b); echo Now a[1] reference is gone too BUT WAIT, a[0] is still a ref !\n; debug_zval_dump($a); ? Expected result: I expect $a without references. Actual result: -- $a[0] is reference with refcount(1). -- Edit bug report at http://bugs.php.net/?id=33282edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33282r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33282r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33282r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=33282r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=33282r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33282r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33282r=needscript Try newer version: http://bugs.php.net/fix.php?id=33282r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33282r=support Expected behavior: http://bugs.php.net/fix.php?id=33282r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33282r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33282r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=33282r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33282r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=33282r=dst IIS Stability: http://bugs.php.net/fix.php?id=33282r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33282r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33282r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33282r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33282r=mysqlcfg
#25429 [NEW]: copy() of stdin doesn't work any longer
From: devik at cdi dot cz Operating system: linux PHP version: 4.3.3 PHP Bug Type: Filesystem function related Bug description: copy() of stdin doesn't work any longer Description: copy(/dev/stdin,/tmp/xx); was working in 4.0.6 but in 4.3.3 it results in empty file. When I ran strace then I see fstat64(2) used on handle 4 which is dup(2)ed from handle 0. It results to fs_size==0 and code in php_stream_copy_to_stream (IIRC) hapily creates zero-sized file (immeditely - no wait for EOF). With PHP fopen() it works as expected (it waits). Reproduce code: --- copy(/dev/stdin,/tmp/xx); Expected result: to stop on copy() and wait to EOF and then have input in /tmp/xx Actual result: -- copy() passes and /tmp/xx is zero-length file -- Edit bug report at http://bugs.php.net/?id=25429edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25429r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25429r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25429r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25429r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25429r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25429r=oldversion Not developer issue:http://bugs.php.net/fix.php?id=25429r=support Expected behavior: http://bugs.php.net/fix.php?id=25429r=notwrong Not enough info:http://bugs.php.net/fix.php?id=25429r=notenoughinfo Submitted twice:http://bugs.php.net/fix.php?id=25429r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25429r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25429r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25429r=dst IIS Stability: http://bugs.php.net/fix.php?id=25429r=isapi Install GNU Sed:http://bugs.php.net/fix.php?id=25429r=gnused