#12776 [Sus->Csd]: 4.0.7RC1: array_walk crash

From: Date: Wed, 04 Dec 2002 16:50:25 +0000
Subject: #12776 [Sus->Csd]: 4.0.7RC1: array_walk crash
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-26634@lists.php.net to get a copy of this message
ID: 12776 Updated by: moriyoshi@php.net Reported By: troels@arvin.dk -Status: Suspended +Status: Closed Bug Type: Reproducible crash Operating System: Linux PHP Version: 4.0.6 New Comment: This bug has been fixed in CVS. In case this was a PHP problem, 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/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2002-01-27 05:25:51] yohgaki@php.net Hi sander, I know this problem exists and this bug cannot be fixed easily.... Status = SUSPENDED TO PHP USERS: *ONLY* change parameter passed! *Never* change array or array elements in walk funciton. ------------------------------------------------------------------------ [2002-01-27 05:19:57] sander@php.net No feedback. ------------------------------------------------------------------------ [2002-01-06 07:37:36] sander@php.net Does this problem still occur with 4.1.1? ------------------------------------------------------------------------ [2001-08-16 17:25:58] rasmus@php.net On my machine, this will crash it: function test($val,$key) { global $globalArray; $globalArray[]=$key; } $arr=array('k'=>'v'); array_walk($arr,'test'); echo "testing".$globalArray[0]; Changing the last line to: echo "test".$globalArray[0]; makes it work. Uh? bt: #0 0x4013913e in memcpy () from /lib/i686/libc.so.6 #1 0xbfffe3b0 in ?? () #2 0x080f2550 in execute (op_array=0x816c334) at ./zend_execute.c:1105 #3 0x080da832 in zend_execute_scripts (type=8, file_count=3) at zend.c:806 #4 0x0805faab in php_execute_script (primary_file=0xbffff8d0) at main.c:1310 ------------------------------------------------------------------------ [2001-08-16 17:22:29] rasmus@php.net Oops, never mind, it is not fixed in CVS. It just morphed slightly. ------------------------------------------------------------------------ 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/12776 -- Edit this bug report at http://bugs.php.net/?id=12776&edit=1

« previous php.bugs (#26634) next »