#32692 [NEW]: Segfault with foreach

From: Date: Wed, 13 Apr 2005 09:50:40 +0000
Subject: #32692 [NEW]: Segfault with foreach
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-77458@lists.php.net to get a copy of this message
From: koyama at hoge dot org Operating system: Debian GNU/Linux (kernel-2.4.18) PHP version: 4.3.11 PHP Bug Type: Reproducible crash Bug description: Segfault with foreach Description: ------------ Over 32768 count with foreach loop, some code cause the Segmentation Fault. Reproduce code: --------------- <?php $loop_count = 32768; $a = array_fill(0, $loop_count, 'foobar'); foreach ($a as $key => $val) { $other[$key] = $val; } ?> Actual result: -------------- (gdb) run ~/tmp/php/dbg_loop.php Starting program: /usr/local/bin/php ~/tmp/php/dbg_loop.php [New Thread 1024 (LWP 10611)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1024 (LWP 10611)] 0x407cfb00 in free () from /lib/libc.so.6 (gdb) bt #0 0x407cfb00 in free () from /lib/libc.so.6 #1 0x407cfaa3 in free () from /lib/libc.so.6 #2 0x0816618c in shutdown_memory_manager (silent=0, clean_cache=0) at /var/src/php-4.3.11/Zend/zend_alloc.c:492 #3 0x0814dfd7 in php_request_shutdown (dummy=0x0) at /var/src/php-4.3.11/main/main.c:1004 #4 0x0818bb07 in main (argc=2, argv=0xbffff6e4) at /var/src/php-4.3.11/sapi/cli/php_cli.c:879 -- Edit bug report at http://bugs.php.net/?id=32692&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32692&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32692&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32692&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32692&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32692&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32692&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32692&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32692&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32692&r=support Expected behavior: http://bugs.php.net/fix.php?id=32692&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32692&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32692&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32692&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32692&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32692&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32692&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32692&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32692&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32692&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32692&r=mysqlcfg

« previous php.bugs (#77458) next »