Bug #74380 [Com]: Reflexion try to allocate 8791646535632 bytes

From: Date: Thu, 06 Apr 2017 12:54:13 +0000
Subject: Bug #74380 [Com]: Reflexion try to allocate 8791646535632 bytes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208363@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74380&edit=1

 ID:                 74380
 Comment by:         nicolas dot gourdeau at orange dot com
 Reported by:        nicolas dot gourdeau at orange dot com
 Summary:            Reflexion try to allocate 8791646535632 bytes
 Status:             Feedback
 Type:               Bug
 Package:            Reflection related
 Operating System:   windows 7 Pro SP1
 PHP Version:        7.1.3
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[2017-04-06 10:13:31] 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 10:10:05] 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



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=74380&edit=1


Thread (4 messages)

« previous php.bugs (#208363) next »