Bug #80322 [Com]: Preloader does not work as expected
| From: | ricardo dot cescon at panthermedia dot net | Date: | Thu, 12 Nov 2020 16:00:12 +0000 |
| Subject: | Bug #80322 [Com]: Preloader does not work as expected | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230305@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80322&edit=1
ID: 80322
Comment by: ricardo dot cescon at panthermedia dot net
Reported by: sametsahindogan at gmail dot com
Summary: Preloader does not work as expected
Status: Open
Type: Bug
Package: opcache
Operating System: Ubuntu 20.04.1 LTS
PHP Version: 7.4.12
Block user comment: N
Private report: N
New Comment:
in addition to my last comments:
removing "php7.4-uopz" solve all our problems with opcache
Previous Comments:
------------------------------------------------------------------------
[2020-11-12 14:41:02] ricardo dot cescon at panthermedia dot net
We also see another problem with enabled opcache:
traits not will be used correctly.
Error: Call to undefined method XYZ::do_something()
Sample:
################################
trait tX{
protected function do_something(){
}
}
//---------
abstract class Y extends Z{
use tX;
}
//---------
class XYZ extends Y{
function __construct(){
$this->do_something();
}
}
################################
Version PHP 7.3.24 work as expected
------------------------------------------------------------------------
[2020-11-12 12:13:13] ricardo dot cescon at panthermedia dot net
We have currently a similar problem switching to PHP version 7.4.12, but without Laravel and on
Ubuntu 18.04.5 LTS.
We get the following error with enabled opcache:
Call to undefined method SphinxClient::SetServer()
This occurs on the following of code sample
############################################
class sphinxAPI extends SphinxClient {
...
function SetServer($host, $port = null) {
...
parent::SetServer($this->_servers[0][0], $this->_servers[0][1]);
...
############################################
with opcache.enable = Off everything works as expacted
PHP 7.3.24 also work as expacted
------------------------------------------------------------------------
[2020-11-06 16:54:16] jon dot johnson at ucsf dot edu
This may be the same as reported in https://github.com/symfony/symfony/issues/39010
where
ArgumentCountError: Too few arguments to function
Symfony\Component\Cache\Adapter\AbstractAdapter::throwError(), 2 passed in and exactly 4
expected
is thrown when pre-loading is enabled.
I wasn't able to distill this to a PHP script case, but using symfony I created a docker based
reproduction of this at https://github.com/jrjohnson/reproduction-symfony-error-apc-opcache
the error can be reproduced there by doing:
composer install
docker-compose build
docker-compose up
Then visit http://127.0.0.1:8000/ which will fail with a 500
error and messages logged to the console running docker-compose.
------------------------------------------------------------------------
[2020-11-06 10:31:59] nikic@php.net
There's been quite a few reports of preloading issues with this release. I believe the problem
has been introduced by https://github.com/php/php-src/commit/3928b6b435f6c7c818e8211b2ecdeeb7191310d1
(this commit by itself is correct, but it exposed a pre-existing issue) and will be fixed by https://github.com/php/php-src/commit/6808968c896a18d2b9f309b2fe63d529058b78b4
(in 7.4.13).
If you are able to test current PHP-7.4 HEAD, it would be great to confirm the issue is indeed
resolved.
------------------------------------------------------------------------
[2020-11-05 21:29:43] sametsahindogan at gmail dot com
Btw I guess I must say again, I haven't made any changes to the code. (I also didn't
change the Laravel version.) Everything was working fine with the preload. I just updated to PHP
7.4.12 and these errors occurred. I don't think there is a problem with the application layer.
I have tested it on other different servers (with clean PHP 7.4.12 and Laravel installation) as I
thought it might be a different problem, but the error persists.
------------------------------------------------------------------------
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=80322
--
Edit this bug report at https://bugs.php.net/bug.php?id=80322&edit=1