Skip to content

StopwatchPeriod::$isFinder #29347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Nov 27, 2018 · 12 comments
Closed

StopwatchPeriod::$isFinder #29347

ghost opened this issue Nov 27, 2018 · 12 comments

Comments

@ghost
Copy link

ghost commented Nov 27, 2018

Symfony version(s) affected: 4.1.8

Description
Uncaught ErrorException when trying to output a simple template with encore installed

How to reproduce

composer require symfony/maker-bundle symfony/profiler-pack --dev
composer require annotations symfony/twig-bundle
php bin/console make:controller DefaultController
composer require encore
yarn install
yarn encore dev
<?php

namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;

class DefaultController extends AbstractController
{
    /**
     * @Route("/", name="home_index")
     */
    public function index()
    {
        return $this->render('default/index.html.twig');
    }
}
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}
        {{ encore_entry_link_tags('app') }}
{% endblock %}
    </head>
    <body>
        {% block body %}{% endblock %}
{% block javascripts %}
        {{ encore_entry_script_tags('app') }}
{% endblock %}
    </body>
</html>
{% extends 'base.html.twig' %}

{% block body %}
home_index
{% endblock %}

Possible Solution

Additional context

[Tue Nov 27 10:03:01.327741 2018] [proxy_fcgi:error] [pid 950:tid 140692995176192] [client 127.0.0.1:48736] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught ErrorException: Notice: Undefined property: Symfony\\Component\\Stopwatch\\StopwatchPeriod::$isFinder in /home/u01/workspace/p003/vendor/symfony/debug/DebugClassLoader.php:138\nStack trace:
#0 [internal function]: Symfony\\Component\\Debug\\DebugClassLoader->loadClass('Symfony\\\\Compone...')
#1 /home/u01/workspace/p003/vendor/symfony/debug/ExceptionHandler.php(166): spl_autoload_call('Symfony\\\\Compone...')
#2 /home/u01/workspace/p003/vendor/symfony/debug/ExceptionHandler.php(122): Symfony\\Component\\Debug\\ExceptionHandler->sendPhpResponse(Object(ErrorException))
#3 /home/u01/workspace/p003/vendor/symfony/debug/ErrorHandler.php(556): Symfony\\Component\\Debug\\ExceptionHandler->handle(Object(ErrorException))
#4 [internal function]: Symfony\\Component\\Debug\\ErrorHandler->handleException(Object(ErrorException))
#5 {main}
  thrown in /home/u01/workspace/p003/vendor/symfony/debug/DebugClassLoader.php on line 138
@ghost ghost changed the title no output StopwatchPeriod::$isFinder Nov 27, 2018
@xabbuh
Copy link
Member

xabbuh commented Nov 27, 2018

Can you create a small example application that allows to reproduce your issue?

@ghost
Copy link
Author

ghost commented Nov 27, 2018

These are the only command lines and files I edited, otherwise can you tell me how I should transmit it to you, thanks.

@xabbuh
Copy link
Member

xabbuh commented Nov 27, 2018

You can create a GitHub repository and push everything there. That would help a lot. :)

@ghost
Copy link
Author

ghost commented Nov 27, 2018

done at https://github.com/rgutknec/p003.git

@nicolas-grekas
Copy link
Member

@rgutknec thanks for the reproducer, I have the same behavior. This is a complete nonsense, but here is a workaround: #29349. Disabling OPcache also works around the issue BTW.
ping @nikic @jpauli in case you want to have a look.

@nikic
Copy link
Contributor

nikic commented Nov 27, 2018

Yeah, that looks like an opcache optimization bug. Which PHP version does this affect?

@ghost
Copy link
Author

ghost commented Nov 27, 2018

ok, I disabled OPcache, on Ubuntu by the following :

cd /etc/php/7.2/mods-available/
vi opcache.ini
opcache.enable=0

systemctl restart php7.2-fpm.service

Works now with this workaround.
Should I close this issue then, and follow #29349 ?

PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

@Sozialarchiv
Copy link

Sozialarchiv commented Nov 27, 2018

I can confirm the problem on Windows 7/Apache/ PHP 7.2.11

It makes the whole app unusable. After some request I have to restart the server.

Disabling OPcache seems to work as workaround.

nicolas-grekas added a commit that referenced this issue Nov 27, 2018
…as-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] workaround opcache bug mutating "$this" !?!

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #29347
| License       | MIT
| Doc PR        | -

This makes absolutely no sense but works around an OPcache bug.

Commits
-------

e2b4c8d [Debug] workaround opcache bug mutating "$this" !?!
@nicolas-grekas
Copy link
Member

Fixed in #29349. Thanks for the help.

@iammichiel
Copy link

iammichiel commented Nov 29, 2018

This behaviour is confirmed on 7.1.(24 and 16) versions as well. Disabling opcache is a nice workaround for local development.

Any chance to release a 4.1.9 version with this fix? This currently breaks all projects using the webprofiler or orm package aliases.

@OlegZavrazhin
Copy link

OlegZavrazhin commented Dec 19, 2018

In case if someone has this issue (it's still available) in docker, might be fixed by the following:

the fast way

if vim is not available run apt install vim inside of container

docker exec -it [container-name] bash
vi /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini
opcache.enable=0
kill -USR2 1

the more correct way (subjectively) - add the creation of /usr/local/etc/php/conf.d/opcache-recommended.ini with opcache.enable=0 to Dockerfile

@xabbuh
Copy link
Member

xabbuh commented Dec 19, 2018

I would rather update the Debug component than disabling Opcache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants