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

From: Date: Thu, 15 Jan 2015 00:59:08 +0000
Subject: Bug #68833 [NEW]: php --version exhausts entire memory by allocating over 2 GB
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189963@lists.php.net to get a copy of this message
From: j dot tvr at centrum dot cz Operating system: Windows 7 x64 PHP version: master-Git-2015-01-15 (snap) Package: Scripting Engine problem Bug Type: Bug Bug description:php --version exhausts entire memory by allocating over 2 GB 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 bug report at https://bugs.php.net/bug.php?id=68833&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68833&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68833&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68833&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=68833&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=68833&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=68833&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=68833&r=needscript Try newer version: https://bugs.php.net/fix.php?id=68833&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=68833&r=support Expected behavior: https://bugs.php.net/fix.php?id=68833&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=68833&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=68833&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=68833&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68833&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=68833&r=dst IIS Stability: https://bugs.php.net/fix.php?id=68833&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=68833&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=68833&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=68833&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=68833&r=mysqlcfg

« previous php.bugs (#189963) next »