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

From: Date: Tue, 18 May 2021 21:43:43 +0000
Subject: Bug #81041 [Asn->Ver]: Phpstan does not finish on Windows when opcache is enabled
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233889@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:             Assigned
+Status:             Verified
 Type:               Bug
 Package:            opcache
 Operating System:   Windows
 PHP Version:        7.4.19
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

I'm able reliably reproduce the issue (with SHM or file cache),
and it is definitely a Windows only thing (on Linux, there are no
problems even with file cache only[1]).  Debugging this on Windows
is a bit hard, due to missing helpers (like .gdbinit), but I hope
to make some real progress tomorrow.

[1] <https://github.com/cmb69/phpstan-src/runs/2611756608>


Previous Comments:
------------------------------------------------------------------------
[2021-05-18 13:42:41] m at m dot cz

@cmb I collected more than 100 GBs of xdebug trace logs and isolated the issue. The logs started to
be different (after I removed randomness from time() and simillar func calls) on line 210 362 792.

Here are relevant short logs:
https://github.com/mvorisek/phpstan-src/commit/f9e1b786f6a210fd8573fd8d5caf1b9cd4815e45

They differ on line 121, with opcache disabled "include" calls spl_autoload_call, with
opcache disabled, "include" returns true.

------------------------------------------------------------------------
[2021-05-17 22:12:29] cmb@php.net

I shall have a closer look at this.

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

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


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