Bug #77434 [Com]: php-fpm workers are segfaulting in zend_gc_addref
| From: | bugs dot php dot net at mundpropaganda dot net | Date: | Thu, 10 Jan 2019 11:07:50 +0000 |
| Subject: | Bug #77434 [Com]: php-fpm workers are segfaulting in zend_gc_addref | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-218881@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77434&edit=1
ID: 77434
Comment by: bugs dot php dot net at mundpropaganda dot net
Reported by: bugs dot php dot net at mundpropaganda dot net
Summary: php-fpm workers are segfaulting in zend_gc_addref
Status: Closed
Type: Bug
Package: opcache
Operating System: Archlinux
PHP Version: 7.3Git-2019-01-09 (Git)
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
Yes, it does indeed fix the issue! Thanks a lot!
Previous Comments:
------------------------------------------------------------------------
[2019-01-10 09:29:31] nikic@php.net
Can you please confirm whether this fixes the issue you're seeing? I've fixed *something*
here, but I'm not sure if this is also what was causing the problem, or just an unrelated
problem.
------------------------------------------------------------------------
[2019-01-10 09:28:19] nikic@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ade702a0d299f0c8967720fb4887cd1447419cd9
Log: Fixed bug #77434
------------------------------------------------------------------------
[2019-01-10 09:10:06] nikic@php.net
Two possible ways to fix: Either we can check recursively for partial arrays when replacing
constants, or we can mark arrays as partial if they contain partial arrays. Not totally sure, but I
think the latter is required for correctness in other cases as well. In particular we assume that
for non-partial arrays a constant lattice value can only lower to overdetermined, while in the case
where it contains a partial array it could lower to another, different constant value.
------------------------------------------------------------------------
[2019-01-10 09:00:30] nikic@php.net
I believe the issue is not in the template, but the code generating the data: https://github.com/vanilla/vanilla/blob/818e6a6dc387dd47a0a9fa78c6899aebf6ba7ecb/plugins/editor/class.editor.plugin.php#L323
For now I have this test case causing memory leaks in opcache:
<?php
function test(int $x) {
$a = ['a' => 0, 'b' => $x];
$b = [];
$b[0] = $a;
$c = $b[0];
}
SCCP value dump:
#5.X4 = null
#6.X4 = partial ["a" => int(0)]
#7.CV1($a) = partial ["a" => int(0)]
#8.CV2($b) = []
#9.CV2($b) = [0 => zval(type=253)]
#10.X4 = partial ["a" => int(0)]
#11.CV3($c) = partial ["a" => int(0)]
And importantly, we end up embedding #9.CV2($b) as a literal -- but of course nothing will be able
to handle the partial array it contains, as this is an SCCP only concept.
------------------------------------------------------------------------
[2019-01-09 14:50:41] bugs dot php dot net at mundpropaganda dot net
I meant the problem goes away when I set "opcache.optimization_level=0" (checked twice ,
sorry again)
------------------------------------------------------------------------
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=77434
--
Edit this bug report at https://bugs.php.net/bug.php?id=77434&edit=1