php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74380 Reflexion try to allocate 8791646535632 bytes
Submitted: 2017-04-06 10:10 UTC Modified: 2017-04-16 04:22 UTC
From: nicolas dot gourdeau at orange dot com Assigned:
Status: No Feedback Package: Reflection related
PHP Version: 7.1.3 OS: windows 7 Pro SP1
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-04-06 10:10 UTC] nicolas dot gourdeau at orange dot com
Description:
------------
Php Version:

PHP 7.1.3 (cli) (built: Mar 14 2017 23:33:39) ( ZTS MSVC14 (Visual C++ 2015) x64 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.3, Copyright (c) 1999-2017, by Zend Technologies

Contexte: Symfony3 - Mode: Dev

Symfony3 process php code with reflexion. During this process this error happend often but not everytime:

OutOfMemoryException in DebugClassLoader.php line 204:
Error: Allowed memory size of 8589934592 bytes exhausted (tried to allocate 8791646535632 bytes)

$refl = new \ReflectionClass($class);
foreach ($refl->getInterfaceNames() as $interface) {
 class_implements($interface); => generate the error
}



Test script:
---------------
I did not sucess to reproduce the bug out of symfony3 context


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-06 10:13 UTC] krakjoe@php.net
-Status: Open +Status: Feedback
 [2017-04-06 10:13 UTC] krakjoe@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2017-04-06 12:54 UTC] nicolas dot gourdeau at orange dot com
I have some debug, it is link to the same issue, sometimes when i ask for a class intarface name thru reflextion, I get a strange name: "#\s*\r?\n \* +#"

    object(ReflectionClass)#10 (1) {
      ["name"]=>
      string(45) "Symfony\Component\HttpFoundation\ParameterBag"
    }
    ["name"]=>
    string(45) "Symfony\Component\HttpFoundation\ParameterBag"
    ["notice"]=>
    array(0) {
    }
    ["len"]=>
    int(8)
    ["ns"]=>
    string(8) "Symfony\"
    ["parent"]=>
    bool(false)
    ["parentInterfaces"]=>
    array(1) {
      ["#\s*\r?\n \* +#"]=>
      int(1)
    }
    ["deprecatedInterfaces"]=>
    array(0) {
    }
    ["interface"]=>
    string(15) "#\s*\r?\n \* +#"
  }

I'm trying to do a simple reproducing script.
 [2017-04-16 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Nov 26 23:03:13 2021 UTC