php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78620 Out of memory error
Submitted: 2019-10-01 17:21 UTC Modified: 2019-10-03 17:54 UTC
From: v-altruo at microsoft dot com Assigned: cmb (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 7.2.23 OS: Windows Server 2012 R2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: v-altruo at microsoft dot com
New email:
PHP Version: OS:

 

 [2019-10-01 17:21 UTC] v-altruo at microsoft dot com
Description:
------------
Test fails with x86 version for both nts/ts builds regardless of opcache on/off. Test also fails for 7.2.23. 

Failed test file location: ext\standard\tests\strings\wordwrap_memory_limit.phpt

Expected result:
----------------
Fatal error: Allowed memory size of 134217728 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d

Actual result:
--------------
VirtualAlloc() failed: [0x00000057] The parameter is incorrect.


VirtualAlloc() failed: [0x00000057] The parameter is incorrect.


Fatal error: Out of memory (allocated 2097152) (tried to allocate 4294901777 bytes) in C:\..\ext\standard\tests\strings\wordwrap_memory_limit.php on line 5

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-01 22:10 UTC] cmb@php.net
-Status: Open +Status: Verified -Package: Testing related +Package: Scripting Engine problem -PHP Version: 7.3.10 +PHP Version: 7.2.23
 [2019-10-01 22:10 UTC] cmb@php.net
Oh, indeed!

The problem is that ZEND_MM_ALIGNED_SIZE_EX evaluates to 0[1],
since (size + alignment -1) overflows (in this case size ==
4294901777 && alignment == 2097152), and we don't catch that.

[1] <https://github.com/php/php-src/blob/php-7.2.23/Zend/zend_alloc.c#L1458>
 [2019-10-02 14:25 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #78620: Out of memory error
On GitHub:  https://github.com/php/php-src/pull/4766
Patch:      https://github.com/php/php-src/pull/4766.patch
 [2019-10-02 16:23 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8ce04df7e0108a10f7b782a28204e9384ab1129c
Log: Fix #78620: Out of memory error
 [2019-10-02 16:23 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2019-10-02 16:24 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2019-10-02 17:04 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f2fb37a772908a9331e67f583fddcc4b1b186ccf
Log: Revert &quot;Fix #78620: Out of memory error&quot;
 [2019-10-02 17:05 UTC] cmb@php.net
-Status: Closed +Status: Re-Opened
 [2019-10-03 17:54 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #78620: Out of memory error
On GitHub:  https://github.com/php/php-src/pull/4776
Patch:      https://github.com/php/php-src/pull/4776.patch
 [2019-10-04 07:15 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=abaf9a76dc933f4d1f2ff3591ced81d4d6dcb652
Log: Fix #78620: Out of memory error
 [2019-10-04 07:15 UTC] cmb@php.net
-Status: Re-Opened +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC