8000 Calling include() on locked file on PHP 7.4 · Issue #36132 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Calling include() on locked file on PHP 7.4 #36132
Closed
@adampraszywka

Description

@adampraszywka

Symfony version(s) affected: 4.4.5
Description
On PHP 7.4 (Windows) first booting of container (HttpKernel) causing the following PHP Notice:
Issue looks similar to #35242 but in different place in the code.

PS C:\Users\praszywa\Downloads\test> php test.php
PHP Notice:  include(): read of 4096 bytes failed with errno=13 Permission denied in C:\Users\praszywa\Downloads\test\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php on line 566
PHP Stack trace:
PHP   1. {main}() C:\Users\praszywa\Downloads\test\test.php:0
PHP   2. MyKernel->boot() C:\Users\praszywa\Downloads\test\test.php:6
PHP   3. MyKernel->initializeContainer() C:\Users\praszywa\Downloads\test\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php:136

Notice: include(): read of 4096 bytes failed with errno=13 Permission denied in C:\Users\praszywa\Downloads\test\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php on line 566

Call Stack:
    0.0001     392400   1. {main}() C:\Users\praszywa\Downloads\test\test.php:0
    0.0054     723712   2. MyKernel->boot() C:\Users\praszywa\Downloads\test\test.php:6
    0.0054     727144   3. MyKernel->initializeContainer() C:\Users\praszywa\Downloads\test\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php:136

On PHP 7.3 (Windows) notice is not thrown.
For both versions of PHP error_reporting is set to E_ALL.

PHP Version:

PHP 7.4.4 (cli) (built: Mar 17 2020 13:49:13) ( NTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Xdebug v2.9.3, Copyright (c) 2002-2020, by Derick Rethans

It's calling include on cachePath which is locked and not released.

How to reproduce
Create empty project with "symfony/symfony" ^4.4

{
    "name": "test/test",
    "autoload": {
        "psr-4": { "": "src/" }
    },
    "require": {
        "symfony/symfony": "4.4"
    }
}

Create dummy kernel

<?php

class MyKernel extends \Symfony\Component\HttpKernel\Kernel
{
    /**
     * @inheritDoc
     */
    public function registerBundles()
    {
        return [];
    }

    /**
     * @inheritDoc
     */
    public function registerContainerConfiguration(\Symfony\Component\Config\Loader\LoaderInterface $loader)
    {
        // TODO: Implement registerContainerConfiguration() method.
    }
}

Callboot kernel

<?php

require_once 'vendor/autoload.php';

$kernel = new MyKernel('dev', true);
$kernel->boot();

During first start (when cache doesn't exist) the following note will be visible:

PHP Notice:  include(): read of 4096 bytes failed with errno=13 Permission denied in C:\Users\praszywa\Downloads\test\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php on line 566
PHP Stack trace:
PHP   1. {main}() C:\Users\praszywa\Downloads\test\test.php:0
PHP   2. MyKernel->boot() C:\Users\praszywa\Downloads\test\test.php:6
PHP   3. MyKernel->initializeContainer() C:\Users\praszywa\Downloads\test\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php:136

Notice: include(): read of 4096 bytes failed with errno=13 Permission denied in C:\Users\praszywa\Downloads\test\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php on line 566

Call Stack:
    0.0001     392400   1. {main}() C:\Users\praszywa\Downloads\test\test.php:0
    0.0054     723712   2. MyKernel->boot() C:\Users\praszywa\Downloads\test\test.php:6
    0.0054     727144   3. MyKernel->initializeContainer() C:\Users\praszywa\Downloads\test\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php:136

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0