[Bug 1177345] Re: Segfault from array_walk modifying an array passed by reference
karpa
1177345 at bugs.launchpad.net
Wed May 8 04:13:28 UTC 2013
** Description changed:
upstream bug https://bugs.php.net/bug.php?id=61730
- with following code:
+
+ simple test case from upstream report:
+
<?php
$myArray = array_fill(0, 10000, md5('test'));
array_walk(
- $myArray,
- function($value, $key, $myArray)
- {
- if (rand(0, 1)) {
- unset($myArray[$key]);
- } else if (rand(0, 1)) {
- $myArray[$key] = md5(rand(0, 10000));
- }
- },
- &$myArray
+ $myArray,
+ function($value, $key, $myArray)
+ {
+ if (rand(0, 1)) {
+ unset($myArray[$key]);
+ } else if (rand(0, 1)) {
+ $myArray[$key] = md5(rand(0, 10000));
+ }
+ },
+ &$myArray
);
- produces sigfault in 5.3.10-1ubuntu3.6
+ php -v
+ PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli) (built: Mar 11 2013 14:31:48)
+ Copyright (c) 1997-2012 The PHP Group
+ Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
+
+ x86_64
+
+ lsb_release -a
+ No LSB modules are available.
+ Distributor ID: Ubuntu
+ Description: Ubuntu 12.04.2 LTS
+ Release: 12.04
+ Codename: precise
--
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to php5 in Ubuntu.
https://bugs.launchpad.net/bugs/1177345
Title:
Segfault from array_walk modifying an array passed by reference
To manage notifications about this bug go to:
https://bugs.launchpad.net/php/+bug/1177345/+subscriptions
More information about the Ubuntu-server-bugs
mailing list