|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-04-13 12:39 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 15:00:01 2026 UTC |
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