Req #76225 [Opn]: ini setting to not empty opcache when php-fpm is reloaded
| From: | nikic@php.net | Date: | Tue, 17 Apr 2018 11:24:55 +0000 |
| Subject: | Req #76225 [Opn]: ini setting to not empty opcache when php-fpm is reloaded | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214778@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76225&edit=1
ID: 76225
Updated by: nikic@php.net
Reported by: post at minhost dot no
Summary: ini setting to not empty opcache when php-fpm is
reloaded
Status: Open
Type: Feature/Change Request
Package: opcache
Operating System: CentOS 7.4
PHP Version: 7.1.16
Block user comment: N
Private report: N
New Comment:
It is not necessary to build PHP with --enable-debug (which apart from enabling debug symbols also
disables optimization and enables debug assertions). The documentation and ./configure --help output
are quite misleading in that regard and should be improved.
For a basic backtrace without file+line information, just using a normal PHP build is fine. To also
have file+line information it's possible to pass CFLAGS="-g" to configure, in which
case PHP will be built with debug symbols (and optimization). This should not impact performance,
but increases the size of the binary.
Previous Comments:
------------------------------------------------------------------------
[2018-04-17 10:23:16] post at minhost dot no
When compiling PHP with --enable-debug, PHP runs to slow for me to do this on production servers. As
I said, the crash only happen sporadic, and it can be anything from days to weeks before it happen
again. So I can't do the backtrace on my production servers.
Instead I will try to setup a copy of the sites on a test VPS, and run backtrace on that test server
instead. I can only hope I will be able to trigger the crashes when it is only a copy of the live
sites.
I will then try to reproduce the crashes of both InfititeWP in this bug https://bugs.php.net/bug.php?id=76205 and on Drupal
sites when running update.php (described in the bug report I am commenting on now).
Please note that this bug report was a feature request. But I guess it does not matter if I use the
comment field here.
This could take time ...
------------------------------------------------------------------------
[2018-04-16 13:25:52] nikic@php.net
Ah yes, you will have to install gdb first (using "sudo apt-get install gdb" or whatever
the equivalent for your operating system is).
Alternatively, if you do not want to install additional software on a production server, it is also
in principle possible to copy the core dump to a different machine that has gdb installed and
analyze it there. However, this requires that both the php-fpm binary and shared objects are the
same on the other machine. This tends to be more finicky, so if you can directly install gdb,
I'd recommend going that way.
------------------------------------------------------------------------
[2018-04-16 12:03:27] post at minhost dot no
Thanks for the information. However this is new to me. I did try to see if GDB is installed, here is
some output:
[root@server~]# which -a gdb
/usr/bin/which: no gdb in
(/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/.local/bin:/root/bin)
[root@server~]# locate -eb '\gdb'
/usr/share/gdb
[root@server~]# gdb -help
-bash: gdb: command not found
[root@server~]# gdb php-fpm /usr/local/php71/bin
-bash: gdb: command not found
[root@server ~]# gdb /usr/local/php71/bin
-bash: gdb: command not found
Any help to point me in the right direction? If not I will have to seek outside technical advice on
this, wich could take several days or weeks.
------------------------------------------------------------------------
[2018-04-16 11:41:54] nikic@php.net
Sure, that's exactly what core dumps are for :) You need to run "gdb php-fpm
path-to-core-file" and then "bt" or "bt full". It may be necessary to
specify a full path to the php-fpm binary and to install debug symbols from your package manager, if
they aren't installed yet.
------------------------------------------------------------------------
[2018-04-16 11:34:54] post at minhost dot no
Is it possible to do after it has happened? As said it only happen sporadic. Also can you please
point me to some guides for creating a backtrace from the core dumps AFTER the crash has already
happened?
------------------------------------------------------------------------
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=76225
--
Edit this bug report at https://bugs.php.net/bug.php?id=76225&edit=1