php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75247 Documentation Recommends Broken Setting
Submitted: 2017-09-22 19:25 UTC Modified: 2017-12-18 20:54 UTC
From: pegasus at vaultwiki dot org Assigned: nikic (profile)
Status: Closed Package: opcache
PHP Version: 5.6.31 OS:
Private report: No CVE-ID: None
 [2017-09-22 19:25 UTC] pegasus at vaultwiki dot org
Description:
------------
---
From manual page: http://www.php.net/opcache.installation
---

The page recommends using directive opcache.fast_shutdown = 1, however this directive is known to be broken. See the following Zend bug which has remained unsolved since 2013: https://github.com/zendtech/ZendOptimizerPlus/issues/146

In my experiences on many clients' servers, fast_shutdown occasionally caused PHP<->web server communication to fail and the PHP process to crash in random places without a segfault. In a number of cases, this led to database corruption. Disabling opcache.fast_shutdown always resolved the issue.

Since opcache.fast_shutdown bypasses PHP garbage collection in favor of Zend MM garbage collection, it is likely that Zend MM is not doing this successfully, possibly creating a Use-Again-Without-Free? situation which causes the next process to crash. However, without segfaults to provide information, this is only a theory.

Expected result:
----------------
The documentation should not recommend opcache.fast_shutdown = 1 until the Zend bug is fixed: https://github.com/zendtech/ZendOptimizerPlus/issues/146

If the Zend bug is fixed, the documentation should specify which version(s) of PHP the fix applies in, and therefore which version of PHP opcache.fast_shutdown becomes safe to use again.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-22 19:47 UTC] pegasus at vaultwiki dot org
See also this PHP bug report, providing case-in-point, which has gone ignored for over 2 years even though the requested information was provided: https://bugs.php.net/bug.php?id=69190
 [2017-12-18 20:54 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2017-12-18 20:54 UTC] nikic@php.net
As far as I'm aware there haven't been issues with opcache.fast_shutdown in PHP 7. As of PHP 7.2 the ini option is removed, as fast_shutdown is now integrated in core PHP. I've just pushed a doc change to that effect.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 01 13:03:35 2021 UTC