Edit report at https://bugs.php.net/bug.php?id=77312&edit=1
ID: 77312
Updated by: bukka@php.net
Reported by: sjon at hortensius dot net
Summary: accel_replace_string_by_process_permanent: Assertion
`0' failed
Status: Assigned
Type: Bug
Package: FPM related
Operating System: archlinux
PHP Version: 7.3.1
-Assigned To: bukka
+Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
I don't have much time to look what Opcache exactly does so re-assigning to Dmitry as he might
have a better idea what to do and what's the best approach.
I can just comment on the FPM behaviour and requirements. Basically the ini values are set in the
following cases:
* if php_value or php_admin_value is set in the FPM config, then the ini is modified on child init
(it means when the process is created and ready to handle requests - it means it can handle multiple
requests and should be the for the whole child life)
* if FCGI request sets PHP_VALUE or PHP_ADMIN_VALUE envs, then it is modified as well (from the code
it looks that this should actually stay set for all other requests in the child even if the
PHP_VALUE or PHP_ADMIN_VALUE are no longer set).
So it means that FPM needs a way to set an ini in the process that won't get changed. I'm
thinking that it might make sense to either save it as an original or maybe create another field for
the permanently modified ini values. Not really sure though.
Previous Comments:
------------------------------------------------------------------------
[2019-01-24 14:26:39] bukka@php.net
Ok I guess it will probably need a longer look then :)
------------------------------------------------------------------------
[2019-01-24 14:09:22] nikic@php.net
I'm no longer sure if using zend_alter_ini_entry is right in this context, I think it may break
the ini_restore() functionality. (Which should probably restore to the ini value specified through
php_value).
------------------------------------------------------------------------
[2019-01-24 14:03:23] bukka@php.net
From a quick look I agree that we should use zend_alter_ini_entry_ex instead. However I would use it
in fpm_php_apply_defines_ex and call it instead of fpm_php_zend_ini_alter_master which could be then
dropped. That would also keep extension and disable_{functions,classes} working.
------------------------------------------------------------------------
[2019-01-16 13:10:26] sjon at hortensius dot net
thanks, I've tried your patch (combined with the patch posted in #77430 ) but I did see another
segfault with a similar backtrace - this time not for an entry set by nginx through fastcgi, but a
setting that's directly configured in the php-fpm pool configuration through php_admin_value.
That seems to go through this code: https://github.com/php/php-src/blob/1ad08256f349fa513157437abc4feb245cce03fc/sapi/fpm/fpm/fpm_php.c#L127
maybe that requires the same fix ?
------------------------------------------------------------------------
[2019-01-16 09:07:08] mnikulin at plesk dot com
The bug can be reproduced by accessing any php file even just
<?php echo 10; ?>
Certainly, OpCache must be enabled in php.ini
zend_extension=opcache.so
opcache.enable=1
It happens during child exit, so simple way to reproduce
is to set short timeout for on-demand manager in a pool .conf file
pm = ondemand
pm.process_idle_timeout = 2s
catch_workers_output = yes
php_value[error_reporting] = 22519
Unsure which bits of error_reporting should be set.
The pool name in log messages after "child 9958 said into stderr" may be truncated.
------------------------------------------------------------------------
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=77312
--
Edit this bug report at https://bugs.php.net/bug.php?id=77312&edit=1