php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79094 Crashing when running recursion function
Submitted: 2020-01-10 11:56 UTC Modified: 2020-01-10 14:22 UTC
From: vinayrachapalli7 at gmail dot com Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 7.4Git-2020-01-10 (Git) OS: centos 7
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vinayrachapalli7 at gmail dot com
New email:
PHP Version: OS:

 

 [2020-01-10 11:56 UTC] vinayrachapalli7 at gmail dot com
Description:
------------
It crashes when we run the following script on PHP 7.4, but in 7.3, it'll through error like Fatal error: Allowed memory size of 134217728 bytes exhausted at ...

Test script:
---------------
<?php
function A(){
 A();
 }

A();
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-10 12:27 UTC] nikic@php.net
-Status: Open +Status: Verified -Package: PHP Language Specification +Package: Scripting Engine problem
 [2020-01-10 14:22 UTC] nikic@php.net
-Assigned To: +Assigned To: dmitry
 [2020-01-10 14:22 UTC] nikic@php.net
The problem here is that we don't SAVE_OPLINE in all places where an OOM condition might occur -- and I doubt we want to.

However, in 7.4 EX(opline) is no longer initialized at all (until a SAVE_OPLINE in a throwing opcode), which means that we may crash when trying to fetch the current line number on OOM.

I think that we should bring back EX(opline) initialization in init_func_execute_data. @dmitry: Do you see any other way?
 [2020-01-31 07:35 UTC] dmitry@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=db7193f31ea9d176214fc36cde0503864a75ab0d
Log: Fixed bug #79094 (Crashing when running recursion function)
 [2020-01-31 07:35 UTC] dmitry@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC