|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 Patchesbug55509.diff (last revision 2011-09-06 15:11 UTC by laruence@php.net)bug55509.phpt (last revision 2011-09-06 14:01 UTC by laruence@php.net) Pull RequestsHistoryAllCommentsChangesGit/SVN commits              [2011-09-06 13:42 UTC] laruence@php.net
  [2011-09-06 13:50 UTC] laruence@php.net
  [2011-09-06 13:51 UTC] laruence@php.net
 
-Status: Open
+Status: Verified
  [2011-09-06 13:52 UTC] laruence@php.net
 
-Package: Streams related
+Package: Reproducible crash
  [2011-09-06 14:01 UTC] laruence@php.net
  [2011-09-06 14:10 UTC] laruence@php.net
  [2011-09-06 14:48 UTC] laruence@php.net
  [2011-09-06 15:11 UTC] laruence@php.net
  [2011-09-07 08:43 UTC] laruence@php.net
 
-Assigned To:
+Assigned To: dmitry
  [2011-09-07 08:43 UTC] laruence@php.net
  [2011-09-13 07:01 UTC] dmitry@php.net
  [2011-09-13 07:01 UTC] dmitry@php.net
 
-Status: Verified
+Status: Closed
  [2011-09-13 07:01 UTC] dmitry@php.net
  [2012-01-29 13:59 UTC] simon at wakecodesleep dot com
  [2012-02-04 20:48 UTC] bobwei9 at hotmail dot com
  [2012-04-18 09:48 UTC] laruence@php.net
  [2012-07-24 23:40 UTC] rasmus@php.net
  [2013-11-17 09:36 UTC] laruence@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 21:00:02 2025 UTC | 
Description: ------------ I get a segfault if I use much memory on a x86_64. It works up to 2G and doesn't work beyond it. I first encountered it using streams, but it seems that it happens always using more memory. Test script: --------------- <?php $a=file_get_contents('/dev/zero'); ?> Expected result: ---------------- getting fatal error telling me that memory_limit is exhausted like 'Fatal error: Allowed memory size of 2147483648 bytes exhausted at /home/rgr/php- 5.3.8/main/streams/streams.c:1331 (tried to allocate 2146697216 bytes) in fillMemory.php on line 3' Actual result: -------------- rgr@rgrVM1:~/php-5.3.8/sapi/cli$ ./php -d memory_limit=3G fillMemory.php Speicherzugriffsfehler (Speicherabzug geschrieben) rgr@rgrVM1:~/php-5.3.8/sapi/cli$ ./php --version PHP 5.3.8 (cli) (built: Aug 25 2011 18:37:32) (DEBUG) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies (gdb) bt #0 0x00000000007c1d18 in _zend_mm_realloc_int (heap=0x2db82c0, p=0x7fe31c8a7070, size=2147491840, __zend_filename=0xba5468 "/home/rgr/php-5.3.8/main/streams/streams.c", __zend_lineno=1331, __zend_orig_filename=0xb85bf8 "/home/rgr/php-5.3.8/ext/standard/file.c", __zend_orig_lineno=570) at /home/rgr/php-5.3.8/Zend/zend_alloc.c:2143 #1 0x00000000007c2a36 in _erealloc (ptr=0x7fe31c8a7070, size=2147491840, allow_failure=0, __zend_filename=0xba5468 "/home/rgr/php-5.3.8/main/streams/streams.c", __zend_lineno=1331, __zend_orig_filename=0xb85bf8 "/home/rgr/php-5.3.8/ext/standard/file.c", __zend_orig_lineno=570) at /home/rgr/php-5.3.8/Zend/zend_alloc.c:2371 #2 0x000000000078c1a0 in _php_stream_copy_to_mem (src=0x2f58498, buf=0x7fff9b3155e8, maxlen=0, persistent=0, __php_stream_call_depth=0, __zend_filename=0xb85bf8 "/home/rgr/php- 5.3.8/ext/standard/file.c", __zend_lineno=570, __zend_orig_filename=0x0, __zend_orig_lineno=0) at /home/rgr/php- 5.3.8/main/streams/streams.c:1331 #3 0x00000000006e615d in zif_file_get_contents (ht=1, return_value=0x2f56d70, return_value_ptr=0x0, this_ptr=0x0, return_value_used=0) at /home/rgr/php-5.3.8/ext/standard/file.c:570 #4 0x00000000005e9c2c in phar_file_get_contents (ht=1, return_value=0x2f56d70, return_value_ptr=0x0, this_ptr=0x0, return_value_used=0) at /home/rgr/php-5.3.8/ext/phar/func_interceptors.c:225 #5 0x000000000081cfbf in zend_do_fcall_common_helper_SPEC (execute_data=0x7fe3dc874090) at /home/rgr/php-5.3.8/Zend/zend_vm_execute.h:320 #6 0x00000000008215f3 in ZEND_DO_FCALL_SPEC_CONST_HANDLER (execute_data=0x7fe3dc874090) at /home/rgr/php-5.3.8/Zend/zend_vm_execute.h:1640 #7 0x000000000081c47c in execute (op_array=0x2f57a30) at /home/rgr/php- 5.3.8/Zend/zend_vm_execute.h:107 #8 0x00000000007e82d5 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/rgr/php-5.3.8/Zend/zend.c:1236 #9 0x0000000000770cf7 in php_execute_script (primary_file=0x7fff9b317e30) at /home/rgr/php-5.3.8/main/main.c:2284 #10 0x00000000008d27dc in main (argc=4, argv=0x7fff9b318088) at /home/rgr/php- 5.3.8/sapi/cli/php_cli.c:1184 also reproduced it with rgr@rgrVM1:~/php-5.3.8/sapi/cli$ php --version PHP 5.3.3-7+squeeze3 with Suhosin-Patch (cli) (built: Jun 28 2011 08:24:40) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH root@develop:/mnt/webdav/web/public/rgr/streamTest# php --version PHP 5.2.6-1+lenny13 with Suhosin-Patch 0.9.6.2 (cli) (built: Jul 1 2011 16:01:01) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator with Suhosin v0.9.27, Copyright (c) 2007, by SektionEins GmbH cli and apache-module as well.