Bug #70258 [Opn->Csd]: Segfault if do_resize fails to allocated memory

From: Date: Thu, 13 Aug 2015 04:15:54 +0000
Subject: Bug #70258 [Opn->Csd]: Segfault if do_resize fails to allocated memory
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195176@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70258&edit=1 ID: 70258 Updated by: laruence@php.net Reported by: laruence@php.net Summary: Segfault if do_resize fails to allocated memory -Status: Open +Status: Closed Type: Bug Package: Scripting Engine problem PHP Version: 7.0.0beta3 Block user comment: N Private report: N New Comment: Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=a089ce0cc6e0bade9bf94399a13bbd63448874b0 Log: Fixed bug #70258 and #70253 Previous Comments: ------------------------------------------------------------------------ [2015-08-13 03:57:55] laruence@php.net Description: ------------ none Test script: --------------- <?php class A { public $arr; public function core() { $i = 0; while (1) { $this->arr[$i++ . "xxx"] = 1; } } } $a = new A; $a->core(); Expected result: ---------------- non segfault Actual result: -------------- $ sapi/cli/php /tmp/1.php PHP Fatal error: Allowed memory size of 134217728 bytes exhausted at /home/huixinchen/opensource/trunk/Zend/zend_hash.c:804 (tried to allocate 75497472 bytes) in /tmp/1.php on line 7 Fatal error: Allowed memory size of 134217728 bytes exhausted at /home/huixinchen/opensource/trunk/Zend/zend_hash.c:804 (tried to allocate 75497472 bytes) in /tmp/1.php on line 7 zend_mm_heap corrupted Segmentation fault (core dumped) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70258&edit=1

« previous php.bugs (#195176) next »