php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72762 Infinite loop while parsing a file with opcache enabled
Submitted: 2016-08-05 11:54 UTC Modified: 2016-08-05 13:59 UTC
From: nicolas dot grekas+php at gmail dot com Assigned: nikic
Status: Closed Package: Scripting Engine problem
PHP Version: 7.1.0beta1 OS: Linux
Private report: No CVE-ID:
 [2016-08-05 11:54 UTC] nicolas dot grekas+php at gmail dot com
Description:
------------
Run the test script below with:
php -n -d zend_extension=opcache.so -d opcache.enable_cli=1 test.php

and see php (opcache) enter an infinite loop that only kill -9 can break

(note that the script is meaningless but it triggers the behavior I also had with a real longer script)

Test script:
---------------
<?php

class foo
{
    function bar()
    {
        $b = array();

        foreach ($a as $a) {
            foreach ($b as $k => $v) {
            }
            $b[$k] = $v;
        }
    }
}


Expected result:
----------------
-

Actual result:
--------------
php enters an infinite loop that only kill -9 can break

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-05 13:59 UTC] nikic@php.net
-Assigned To: +Assigned To: nikic
 [2016-08-05 13:59 UTC] nikic@php.net
Looks like an infinite loop in type inference.
 [2016-08-05 14:33 UTC] nikic@php.net
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fc7c81ff5484f28221c89be0847ea521b707aa8c
Log: Fixed bug #72762
 [2016-08-05 14:33 UTC] nikic@php.net
-Status: Assigned +Status: Closed
 [2016-10-17 10:10 UTC] bwoebi@php.net
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fc7c81ff5484f28221c89be0847ea521b707aa8c
Log: Fixed bug #72762
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue May 30 09:02:04 2017 UTC