Bug #81041 [Fbk->Opn]: Phpstan does not finish on Windows when opcache is enabled

From: Date: Mon, 17 May 2021 22:12:29 +0000
Subject: Bug #81041 [Fbk->Opn]: Phpstan does not finish on Windows when opcache is enabled
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233876@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
 Updated by:         cmb@php.net
 Reported by:        mvorisek at mvorisek dot cz
 Summary:            Phpstan does not finish on Windows when opcache is
                     enabled
-Status:             Feedback
+Status:             Open
 Type:               Bug
 Package:            opcache
 Operating System:   Windows
 PHP Version:        7.4.19
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

I shall have a closer look at this.


Previous Comments:
------------------------------------------------------------------------
[2021-05-17 14:08:10] m at m dot cz

About "different script result when run with opcache".

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

------------------------------------------------------------------------
[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

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


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 (#233876) next »