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

From: Date: Mon, 17 May 2021 08:12:14 +0000
Subject: Bug #81041 [Fbk]: Phpstan does not finish on Windows when opcache is enabled
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233853@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
 Type:               Bug
 Package:            opcache
 Operating System:   Windows
 PHP Version:        7.4.19
 Block user comment: N
 Private report:     N

 New Comment:

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


Previous Comments:
------------------------------------------------------------------------
[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?

------------------------------------------------------------------------
[2021-05-14 21:44:05] daverandom@php.net

Unfortunately this issue cannot currently be regarded as a PHP bug with the information presented.
While it may be a fault in the engine that causes the problem, the PHP development team cannot debug
applications as it is a long way outside their scope.

If you undertake further diagnostics which indicate a specific problem with PHP, please open a new
bug report.

------------------------------------------------------------------------
[2021-05-14 21:19:20] mvorisek at mvorisek dot cz

Description:
------------
see https://github.com/mvorisek/phpstan-src/compare/00ff86b2eab4f8e67170394ca105ad65ba4b1104...13fb7e5f85cc7f053655d5e6529767da8b98bd26

Phpstan does not finish when opcache is enabled on Windows. I belive this is a bug in PHP, as
opcache should not affect script execution and also because this bug is present on Windows OS only
(NOT on Ubuntu).

Test script:
---------------
Github Actions workflow to reproduce on https://github.com/phpstan/phpstan-src repo.

on:
  push:

jobs:
  build:
    runs-on: "${{ matrix.runs-on }}"
    strategy:
      fail-fast: false
      matrix:
        runs-on:
          - "ubuntu-latest"
          - "windows-latest"
        php-version:
          - "7.4"
          - "8.0"
        ts:
          - "ts"
          - "nts"
        exclude:
          - runs-on: "ubuntu-latest"
            ts: ts
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: "${{ matrix.php-version }}"
          extensions: intl
        env:
          phpts: "${{ matrix.ts }}"

      - name: "Install phpstan deps"
        env:
          COMPOSER_ROOT_VERSION: "0.12.x-dev"
        run: |
          composer install

      - name: "Clone & install test repo"
        run: |
          cd repro
          git clone https://github.com/atk4/ui.git
&& cd ui
          composer install

      - name: "Run PHPStan"
        run: |
          cd repro/ui
          php --version
          php ../../bin/phpstan clear-result-cache
          php -d memory_limit=2G ../../bin/phpstan analyse --ansi --debug --verbose

      - name: "Run PHPStan /w opcache enabled for CLI"
        run: |
          cd repro/ui
          php --version
          php ../../bin/phpstan clear-result-cache
          php -d memory_limit=2G -d opcache.enable=1 -d opcache.enable_cli=1 ../../bin/phpstan
analyse --ansi --debug --verbose

Expected result:
----------------
phpstan finish on Windows (like it does on Ubuntu)

Actual result:
--------------
error during class fetch


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



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


Thread (22 messages)

« previous php.bugs (#233853) next »