#43229 [Asn->WFx]: array_walk() crashes with a segmentation fault
| From: | jani@php.net | Date: | Wed, 06 Aug 2008 03:55:44 +0000 |
| Subject: | #43229 [Asn->WFx]: array_walk() crashes with a segmentation fault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-127650@lists.php.net to get a copy of this message | ||
ID: 43229
Updated by: jani@php.net
Reported By: tobsn@php.net
-Status: Assigned
+Status: Wont fix
Bug Type: Scripting Engine problem
Operating System: CentOS
PHP Version: 5.2CVS-2008-03-25 (CVS)
Assigned To: dmitry
Previous Comments:
------------------------------------------------------------------------
[2008-04-14 11:23:16] dmitry@php.net
The crash is not related to variable name. It occurs because the script
unset()s the element of array which is still referenced from the
array_walk() function. So later array_walk() tries to access freed
memory and may crash.
The array_walk() manual says:
Users may not change the array itself from the callback function. e.g.
Add/delete elements, unset elements, etc. If the array that array_walk()
is applied to is changed, the behavior of this function is undefined,
and unpredictable.
I think this bug shouldn't be fixed.
------------------------------------------------------------------------
[2008-04-12 14:54:09] jani@php.net
Dmitry, can you please check this out? It's pretty bad if just a
certain name of variable causes a crash.
------------------------------------------------------------------------
[2008-03-25 13:52:12] jani@php.net
Still crashes using latest 5.2 snapshot.
------------------------------------------------------------------------
[2008-02-09 01:10:05] stas@php.net
Still creashes for me in 5.3CVS. Please do not re-close without
ensuring a fix - UMRs or memory corruption can be elusive and not show
on some environments while existing on others.
------------------------------------------------------------------------
[2008-01-22 13:45:26] felipe@php.net
Works fine to me.
PHP 5.3.0-dev (cli) (built: Jan 18 2008 12:20:16)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/43229
--
Edit this bug report at http://bugs.php.net/?id=43229&edit=1