Bug #81041 [Com]: Phpstan does not finish on Windows when opcache is enabled

From: Date: Mon, 17 May 2021 14:08:10 +0000
Subject: Bug #81041 [Com]: Phpstan does not finish on Windows when opcache is enabled
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233871@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81041&edit=1

 ID:                 81041
 Comment by:         m at m dot cz
 Reported by:        mvorisek at mvorisek dot cz
 Summary:            Phpstan does not finish on Windows when opcache is
                     enabled
 Status:             Feedback
 Type:               Bug
 Package:            opcache
 Operating System:   Windows
 PHP Version:        7.4.19
 Block user comment: N
 Private report:     N

 New Comment:

About "different script result when run with opcache".

Issue can be reproduced consistently on different PC, PHP version/TS.


Previous Comments:
------------------------------------------------------------------------
[2021-05-17 14:03:13] nikic@php.net

To be clear, when you say "does not finish" you are talking about this fatal error, not
about an infinite loop?

PHP Fatal error:  During class fetch: Uncaught PHPStan\Broker\ClassAutoloadingException: Class
Atk4\Core\ReadableCaptionTrait not found. in
D:\a\phpstan-src\phpstan-src\src\Reflection\Runtime\RuntimeReflectionProvider.php:186
Stack trace:
#0 [internal function]:
PHPStan\Reflection\Runtime\RuntimeReflectionProvider->PHPStan\Reflection\Runtime\{closure}()
#1 D:\a\phpstan-src\phpstan-src\repro\ui\vendor\atk4\data\src\Field.php(17): spl_autoload_call()
#2 D:\a\phpstan-src\phpstan-src\vendor\composer\ClassLoader.php(478):
include('D:\\a\\phpstan-sr...')
#3 D:\a\phpstan-src\phpstan-src\vendor\composer\ClassLoader.php(346):
Composer\Autoload\includeFile()
#4 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#5 [internal function]: spl_autoload_call()
#6 D:\a\phpstan-src\phpstan-src\src\Reflection\Runtime\RuntimeReflectionProvider.php(191):
class_exists()
#7
D:\a\phpstan-src\phpstan-src\src\Reflection\ReflectionProvider\ClassBlacklistReflectionProvider.php(49):
PHPStan\Reflection\Runtime\RuntimeReflectionProvider->hasCla in
D:\a\phpstan-src\phpstan-src\repro\ui\vendor\atk4\data\src\Field.php on line 17
Fatal error: During class fetch: Uncaught PHPStan\Broker\ClassAutoloadingException: Class
Atk4\Core\ReadableCaptionTrait not found. in
D:\a\phpstan-src\phpstan-src\src\Reflection\Runtime\RuntimeReflectionProvider.php:186
Stack trace:
#0 [internal function]:
PHPStan\Reflection\Runtime\RuntimeReflectionProvider->PHPStan\Reflection\Runtime\{closure}()
#1 D:\a\phpstan-src\phpstan-src\repro\ui\vendor\atk4\data\src\Field.php(17): spl_autoload_call()
#2 D:\a\phpstan-src\phpstan-src\vendor\composer\ClassLoader.php(478):
include('D:\\a\\phpstan-sr...')
#3 D:\a\phpstan-src\phpstan-src\vendor\composer\ClassLoader.php(346):
Composer\Autoload\includeFile()
#4 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#5 [internal function]: spl_autoload_call()
#6 D:\a\phpstan-src\phpstan-src\src\Reflection\Runtime\RuntimeReflectionProvider.php(191):
class_exists()
#7
D:\a\phpstan-src\phpstan-src\src\Reflection\ReflectionProvider\ClassBlacklistReflectionProvider.php(49):
PHPStan\Reflection\Runtime\RuntimeReflectionProvider->hasCla in
D:\a\phpstan-src\phpstan-src\repro\ui\vendor\atk4\data\src\Field.php on line 17

------------------------------------------------------------------------
[2021-05-17 08:46:33] m at m dot cz

> Use opcache.cache_id[1] to enforce different caches.

In CI, reproduced with no parallel processes, see https://github.com/mvorisek/phpstan-src/runs/2587303770

------------------------------------------------------------------------
[2021-05-17 08:12:14] cmb@php.net

> In CLI, opcache is always cold on start, […]

On Windows, different CLI processes share a single OPcache
instance when running in parallel.  Use opcache.cache_id[1] to
enforce different caches.

[1] <https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.cache-id>

------------------------------------------------------------------------
[2021-05-15 03:55:36] fjfjd at fjdjf dot fjf

opcache has a ton of optimization stages and so does far more than caching

------------------------------------------------------------------------
[2021-05-14 22:16:30] mvorisek at mvorisek dot cz

I understand your feedback, but can you please ping some core developer of opcache?

In CLI, opcache is always cold on start, so the script should never notice opcache enabled, is this
correct, or does opcache have some side effects?

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


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=81041


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


Thread (22 messages)

« previous php.bugs (#233871) next »