Edit report at https://bugs.php.net/bug.php?id=77289&edit=1
ID: 77289
Comment by: lauri dot kentta at gmail dot com
Reported by: bugs dot php dot net at mundpropaganda dot net
Summary: php-fpm workers are segfaulting intermittently
Status: Assigned
Type: Bug
Package: opcache
Operating System: Linux 4.14.82
PHP Version: 7.3.0
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
@nikic, thanks for pointing out those functions. That's exactly what I was looking for.
I'll send another patch to use them in pdo_mysql. It works and seems like the right solution.
By the way, both functions are used in mysqli as well.
Previous Comments:
------------------------------------------------------------------------
[2019-01-08 11:09:55] nikic@php.net
I think the problem is that the mysqlnd connection has end_psession and restart_psession handlers
that are supposed to be called at the end/start of a request respectively. If end_psession were
called, it would free the last_message and NULL it.
However, it seems that mysqli only calls restart_psession (which also nulls last_message, so
probably prevents the worst) and PDO doesn't call either (resulting in what we see here).
@dmitry: What do you think about this? I think reverting to use persistent flag for last_message is
probably the most pragmatic thing to do here. (There might be ABI concerns though...)
------------------------------------------------------------------------
[2019-01-08 09:37:38] nikic@php.net
last_message was changed in https://github.com/php/php-src/commit/a7305eb539596e175bd6c3ae9a20953358c5d677
to be allocated by Zend MM, with the comment that it's not supposed to be used in the next
request. I'm not sure if the attached patch is right, or if some use of last_message (or lack
of reset somewhere) is at fault here.
------------------------------------------------------------------------
[2019-01-07 19:29:04] lauri dot kentta at gmail dot com
Related To: Bug #77312
------------------------------------------------------------------------
[2019-01-06 21:18:16] bugs dot php dot net at mundpropaganda dot net
Hey Lauri,
OP here. Just want to say wow and thanks⦠big time! Your work is greatly appreciated! The other
opcache bug I encountered seems already fixed in 7.3.1RC1. Looking fwd to the next patch releases!
------------------------------------------------------------------------
[2019-01-06 20:07:29] lauri dot kentta at gmail dot com
Oops, wrong backtrace in the last piece. However, the first one led to the right place, or so it
seems. I'll send a patch.
------------------------------------------------------------------------
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=77289
--
Edit this bug report at https://bugs.php.net/bug.php?id=77289&edit=1