Bug #54013 [Opn->Csd]: ReflectionParam for duplicate parameter contains garbage
| From: | felipe@php.net | Date: | Thu, 17 Feb 2011 23:25:32 +0000 |
| Subject: | Bug #54013 [Opn->Csd]: ReflectionParam for duplicate parameter contains garbage | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-158843@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54013&edit=1
ID: 54013
Updated by: felipe@php.net
Reported by: arjen at react dot nl
Summary: ReflectionParam for duplicate parameter contains
garbage
-Status: Open
+Status: Closed
Type: Bug
Package: Scripting Engine problem
PHP Version: 5.3.5
-Assigned To:
+Assigned To: felipe
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2011-02-14 15:52:37] cataphract@php.net
This appears to be unrelated to reflection. Omitting the reflection
part, valgrind says:
==6643== Invalid read of size 1
==6643== at 0x4C25FF8: memcpy (mc_replace_strmem.c:497)
==6643== by 0x6A8717: _estrndup (zend_alloc.c:2497)
==6643== by 0x6B5D18: zend_do_receive_arg (zend_compile.c:1512)
==6643== by 0x696369: zendparse (zend_language_parser.y:457)
==6643== by 0x6A04F1: compile_file (zend_language_scanner.l:364)
==6643== by 0x566250: phar_compile_file (phar.c:3393)
==6643== by 0x6C43D8: zend_execute_scripts (zend.c:1186)
==6643== by 0x671DC6: php_execute_script (main.c:2268)
==6643== by 0x74EA6A: main (php_cli.c:1193)
==6643== Address 0x6fe0470 is 0 bytes inside a block of size 2 free'd
==6643== at 0x4C240FD: free (vg_replace_malloc.c:366)
==6643== by 0x6ACD95: lookup_cv (zend_compile.c:273)
==6643== by 0x6AED32: fetch_simple_variable_ex (zend_compile.c:388)
==6643== by 0x69632B: zendparse (zend_language_parser.y:457)
==6643== by 0x6A04F1: compile_file (zend_language_scanner.l:364)
==6643== by 0x566250: phar_compile_file (phar.c:3393)
==6643== by 0x6C43D8: zend_execute_scripts (zend.c:1186)
==6643== by 0x671DC6: php_execute_script (main.c:2268)
==6643== by 0x74EA6A: main (php_cli.c:1193)
==6643==
------------------------------------------------------------------------
[2011-02-14 14:52:45] arjen at react dot nl
Related to http://bugs.php.net/bug.php?id=43512
------------------------------------------------------------------------
[2011-02-14 14:52:23] arjen at react dot nl
Description:
------------
ReflectionParam object for 2nd parameter contains random value for name
property.
Test script:
---------------
<?php
class a
{
function b($a, $a)
{
$params = func_get_args();
var_dump($params, $a);
}
}
$c = new a;
$c->b('waa?', 'meukee!');
$reflectionClass = new ReflectionClass($c);
$params = $reflectionClass->getMethod('b')->getParameters();
var_dump($params);
Expected result:
----------------
array
0 => string 'waa?' (length=4)
1 => string 'meukee!' (length=7)
string 'meukee!' (length=7)
array
0 => &
object(ReflectionParameter)[4]
public 'name' => string 'a' (length=1)
1 => &
object(ReflectionParameter)[5]
public 'name' => string 'a' (length=1)
or exception/error..
Actual result:
--------------
array
0 => string 'waa?' (length=4)
1 => string 'meukee!' (length=7)
string 'meukee!' (length=7)
array
0 => &
object(ReflectionParameter)[4]
public 'name' => string 'a' (length=1)
1 => &
object(ReflectionParameter)[5]
public 'name' => string '<<insert random byte here>>'
(length=1)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54013&edit=1