Bug #74015 [Fbk->Csd]: ReflectionClass::getInterfaceNames wrong entry with random memory location

From: Date: Wed, 29 Mar 2017 12:20:31 +0000
Subject: Bug #74015 [Fbk->Csd]: ReflectionClass::getInterfaceNames wrong entry with random memory location
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208139@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74015&edit=1 ID: 74015 Updated by: ab@php.net Reported by: uli dot hecht at gmail dot com Summary: ReflectionClass::getInterfaceNames wrong entry with random memory location -Status: Feedback +Status: Closed Type: Bug Package: Reflection related Operating System: Windows PHP Version: 7.1.1 Assigned To: ab Block user comment: N Private report: N New Comment: The fix for this bug has been committed. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Please check master snapshots. Previous Comments: ------------------------------------------------------------------------ [2017-03-27 18:35:05] ab@php.net I was asking explicitly about master,something like here http://windows.php.net/downloads/snaps/master/r5096a42/ . Please note, that latest were also to fetch from the windows.php.net page. We've recently switched to vc15, so you should be aware to fetch some of the previous vc14 master snap after the date i've asked 2017-03-08. Thanks. ------------------------------------------------------------------------ [2017-03-27 05:42:19] uli dot hecht at gmail dot com I tried with the snapshot of March, 14th (7.1.4-dev) and can still reproduce this. I'm also using Apache benchmark now, thanks Jeffrey for the great hint - didn't even know about this tool. ------------------------------------------------------------------------ [2017-03-23 19:11:26] jeffrey dot haley at gmail dot com Was able to reproduce this issue running under 7.0.17 with Windows 7 and the latest 7.0 snapshot master as of today 3/23/17 (php-7.0-ts-windows-vc14-x64-r1517fdb. Environment - Windows 7 x64 - Apache 2.4.23 win64 VC14 (from apachelounge.com) - php-7.0.17-Win32-VC14-x64 (also tried 7.0-ts-windows-vc14-x64-r1517fdb) ------------------------------------------------------------------ test.php ------------------------------------------------------------------ // Test data class DUMMY implements \Serializable, \IteratorAggregate, \Countable, \ArrayAccess { public function serialize() {} public function unserialize($serialized) {} public function getIterator() {} public function offsetExists($offset) {} public function offsetGet($offset) {} public function offsetSet($offset, $value) {} public function offsetUnset($offset) {} public function count() {} } // Provoke error $cls = new \ReflectionClass('\DUMMY'); foreach ($cls->getInterfaceNames() as $interfaceName) { class_implements($interfaceName); // Failure here } Occurs under load as described, I simulated this with the Apache benchmark tool: ab -c 100 -n 10000 "http://localhost/test.php" Following error occurs in the error log: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 8318823012549873016 bytes) in D:\development\test.php on line 23 ------------------------------------------------------------------------ [2017-03-08 17:45:19] ab@php.net Could you please check the latest master snapshots? Thanks. ------------------------------------------------------------------------ [2017-02-02 10:31:25] uli dot hecht at gmail dot com Today I reproduced the error with opcache disabled. Therefore I changed the package to "Reflection related". Because of that I disabled all extensions, and against expectations the error still appears*. The strange thing is that today it already appears after less than 10 browser refreshs, while I had to refresh consistently for at least a minute yesterday. No matter, if opcache is enabled or not. I didn't even restart my system (it was in standby mode, though). *I had to replace the openssl_random_pseudo_bytes() call in the test script by uniqid(). ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=74015 -- Edit this bug report at https://bugs.php.net/bug.php?id=74015&edit=1

« previous php.bugs (#208139) next »