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
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: 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 02:01:28 2024 UTC