php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72590 Opcache restart with kill_all_lockers does not work as expected
Submitted: 2016-07-13 02:38 UTC Modified: 2016-07-13 03:13 UTC
From: keyur@php.net Assigned: keyur
Status: Closed Package: opcache
PHP Version: 7.0.8 OS: Linux
Private report: No CVE-ID:
 [2016-07-13 02:38 UTC] keyur@php.net
Description:
------------
Suppose one of the Apache child is blocked by a malloc deadlock while holding a read lock on Opcache. After some time Opcache gets full and is scheduled to be restarted. 

Because of the child holding the lock, we eventually end up calling kill_all_lockers.

This line https://github.com/php/php-src/blob/PHP-7.0.0/ext/opcache/ZendAccelerator.c#L600 calls zend_accel_error with ACCEL_LOG_ERROR.

ACCEL_LOG_ERROR is special and causes a zend_bailout, so the code never gets to call kill() in line 601. Combined with the reset of force_restart_time in line 597, the child is never terminated and Opcache never restarts.

The fix would be to change the log level to ACCEL_LOG_WARNING


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-13 02:38 UTC] keyur@php.net
-Assigned To: +Assigned To: keyur
 [2016-07-13 03:13 UTC] keyur@php.net
-Status: Assigned +Status: Closed
 [2016-07-13 03:13 UTC] keyur@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2016-09-05 15:06 UTC] jpauli@php.net
Backported to PHP-5.6 today
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Jul 25 16:01:42 2017 UTC