Bug #73370 [Asn->Csd]: falsely exits with "Out of Memory" when using USE_ZEND_ALLOC=0
| From: | nikic@php.net | Date: | Thu, 09 Mar 2017 19:49:05 +0000 |
| Subject: | Bug #73370 [Asn->Csd]: falsely exits with "Out of Memory" when using USE_ZEND_ALLOC=0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207765@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73370&edit=1
ID: 73370
Updated by: nikic@php.net
Reported by: jim dot hofer at gmail dot com
Summary: falsely exits with "Out of Memory" when using
USE_ZEND_ALLOC=0
-Status: Assigned
+Status: Closed
Type: Bug
Package: MySQLi related
Operating System: Irrelevant
PHP Version: 7.0.12
Assigned To: laruence
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=177f87cf052179d22bab008aa13c69d4b0cdc0ef
Log: Fixed bug #73370
Previous Comments:
------------------------------------------------------------------------
[2017-01-14 18:00:34] cmb@php.net
Related To: Bug #73928
------------------------------------------------------------------------
[2017-01-06 16:00:47] cmb@php.net
> I'm not sure why the PHP Version was marked irrelevant either
> since this did not affect 7.0.11?
The malfunction is apparently caused by commit 5880428d[1]; before
that commit malloc() was called directly. So indeed, this affects
PHP 7.0.12 and later.
> Instead of increasing the size to 1 we could instead only
> trigger the OOM condition if both !tmp and !len. Not sure which
> is better.
I think it would be best if __zend_malloc(0) would never be called
in the first place. If it still was malloc(), the result would be
implementation-defined. To ease debugging it might be reasonable
to catch
len==0 and throw a warning (#if ZEND_DEBUG only).
[1] <https://github.com/php/php-src/commit/5880428d>
------------------------------------------------------------------------
[2016-11-02 09:31:25] laruence@php.net
#72736 is fixed now, and USE_ZEND_ALLOC=0 is only for developing purpose, so,, I think maybe we
could mark this as wont' fix.
------------------------------------------------------------------------
[2016-11-02 08:06:40] nikic@php.net
Probably same code needed for __zend_realloc.
Instead of increasing the size to 1 we could instead only trigger the OOM condition if both !tmp and
!len. Not sure which is better.
------------------------------------------------------------------------
[2016-11-02 02:49:00] jim dot hofer at gmail dot com
I've applied the patch manually and it does not appear to fix the issue.
I'm not sure why the PHP Version was marked irrelevant either since this did not affect 7.0.11?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=73370
--
Edit this bug report at https://bugs.php.net/bug.php?id=73370&edit=1