Bug #68833 [Opn->Fbk]: php --version exhausts entire memory by allocating over 2 GB

From: Date: Thu, 15 Jan 2015 05:38:02 +0000
Subject: Bug #68833 [Opn->Fbk]: php --version exhausts entire memory by allocating over 2 GB
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189964@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68833&edit=1 ID: 68833 Updated by: pajoye@php.net Reported by: j dot tvr at centrum dot cz Summary: php --version exhausts entire memory by allocating over 2 GB -Status: Open +Status: Feedback Type: Bug Package: Scripting Engine problem Operating System: Windows 7 x64 PHP Version: master-Git-2015-01-15 (snap) Block user comment: N Private report: N New Comment: Please try the next snapshot, it has been fixed yesterday. Previous Comments: ------------------------------------------------------------------------ [2015-01-15 00:59:06] j dot tvr at centrum dot cz Description: ------------ PHP 7 snapshots after 2014-10-16 (i.e. the last working snapshot I have is from 2014-10-16) always returns in "Out of memory" even for very things like php --version. It does not matter whether it is a TS, NTS, x86 or x64. The result is always the same. Today I tried to look into it to determine the cause. Note that I've never debugged a PHP binary before and I may have done something entirely wrong. Here is what I have found out: "Out of memory" is a message from https://github.com/php/php-src/blob/e9068cefb4d97483823f8ee4dc384da7adf0c124/Zend/zend_alloc.h#L173, meaning that malloc call failed because PHP has exhausted all available memory (8 GB installed). This is a callstack from one of the exhausting allocation call: php7.dll!_safe_malloc(unsigned __int64 nmemb=8791237589792, unsigned __int64 size=8791237761384, unsigned __int64 offset=2008765488) php7.dll!_zend_hash_str_add(_HashTable * ht=0x0000000000000000, const char * str=0x0000000000000000, unsigned __int64 len=8791237589792, _zval_struct * pData=0x0000000000000000) php7.dll!sapi_register_post_entries(_sapi_post_entry * post_entries=0x0000000000000000) php7.dll!php_setup_sapi_content_types() php7.dll!sapi_startup(_sapi_module_struct * sf=0x0000000000000002) php.exe!main(int argc=0, char * * argv=0x01d030500c41b2c3) php.exe!__tmainCRTStartup() Screenshot showing that php.exe --version has allocated over 2 GB: http://screencast.com/t/AdxbuA8o6i ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68833&edit=1

« previous php.bugs (#189964) next »