Bug #73370 [Asn]: falsely exits with "Out of Memory" when using USE_ZEND_ALLOC=0
| From: | cmb@php.net | Date: | Fri, 06 Jan 2017 16:00:49 +0000 |
| Subject: | Bug #73370 [Asn]: 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-206321@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: cmb@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
Type: Bug
Package: MySQLi related
Operating System: Irrelevant
-PHP Version: Irrelevant
+PHP Version: 7.0.12
Assigned To: laruence
Block user comment: N
Private report: N
New Comment:
> 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>
Previous Comments:
------------------------------------------------------------------------
[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?
------------------------------------------------------------------------
[2016-10-25 19:51:20] jim dot hofer at gmail dot com
The source in the srpm i'm applying it to is
md5sum php-7.0.12.tar.xz
bdcc4dbdac90c2a39422786653059f70 php-7.0.12.tar.xz
which is the same checksum as the source on the downloads page.
what version is this patch supposed to be applied to?
------------------------------------------------------------------------
[2016-10-25 19:42:42] yohgaki@php.net
You should use plain source as we aren't responsible for packaging bug.
------------------------------------------------------------------------
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