php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78297 Include unexistent file memory leak
Submitted: 2019-07-16 07:15 UTC Modified: 2019-07-16 09:06 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: a at ustimen dot co Assigned: nikic (profile)
Status: Closed Package: phpdbg
PHP Version: 7.2.20 OS: Linux
Private report: No CVE-ID: None
 [2019-07-16 07:15 UTC] a at ustimen dot co
Description:
------------
Under phpdbg 7.2.20 include unexistent file results to fatal error/memory exhausted.
Under phpdbg 7.2.19 include unexistent file works as expected.

Test script:
---------------
echo '<?php include "unexistent";' | docker run -i php:7.2.20 phpdbg -qrr -s ''
[PHP Warning:  include(unexistent): failed to open stream: No such file or directory in Standard input code on line 1]
[PHP Warning:  include(): Failed opening 'unexistent' for inclusion (include_path='.:/usr/local/lib/php') in Standard input code on line 1]
[PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 2305843009750564865 bytes) in Standard input code on line 1]

echo '<?php include "unexistent";' | docker run -i php:7.2.19 phpdbg -qrr -s ''
[PHP Warning:  include(unexistent): failed to open stream: No such file or directory in Standard input code on line 1]
[PHP Warning:  include(): Failed opening 'unexistent' for inclusion (include_path='.:/usr/local/lib/php') in Standard input code on line 1]

Expected result:
----------------
Just two warnings.

Actual result:
--------------
Two warnings and fatal about memory.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-07-16 09:06 UTC] nikic@php.net
-Assigned To: +Assigned To: nikic
 [2019-07-16 09:10 UTC] a at ustimen dot co
By bisecting I found breaking commit:

https://github.com/php/php-src/commit/a3e6b50442db106d354931ecaa0284a200609be6
 [2019-07-16 09:11 UTC] nikic@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8a19fe29de77d7477d59db472dd6aadabd5ac249
Log: Fixed bug #78297
 [2019-07-16 09:11 UTC] nikic@php.net
-Status: Assigned +Status: Closed
 [2019-07-16 09:17 UTC] a at ustimen dot co
????

When will 7.2.21 be released? I can't find anywhere any plans.
 [2019-07-16 10:59 UTC] remi@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1260de7749634863865dc1d6e0497f97fa7e59d5
Log: Fixed bug #78297
 [2019-07-16 11:36 UTC] cmb@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f3e71b3b730eabc2b12871b3a19dad815219bcb9
Log: Fixed bug #78297
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Aug 20 14:01:47 2019 UTC