|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67889 funny Fatal error during apache shutdown
Submitted: 2014-08-22 15:54 UTC Modified: 2015-02-27 17:32 UTC
From: php at bof dot de Assigned:
Status: Closed Package: opcache
PHP Version: 5.5.16 OS: openSUSE 11.4
Private report: No CVE-ID: None
 [2014-08-22 15:54 UTC] php at bof dot de
Recently upgraded production webserver to PHP 5.5.16 with opcache (previously 5.4.26 with APC), I notice that when I shut down apache (while there are still some connections in flight / in processing) the following messages in php error log.

The call to microtime() that is mentioned there happens at request shutdown from within a class instance __destruct() method of an object that is the sole singleton instance of its class (static protected $instance).

How can microtime() be gone at that point in time???

In normal operation everything is fine with this mechanism, it is only when shutting down apache that this happens - which makes me suspect opcache (but not sure)

Unfortunately I could not reproduce this on a nonloaded development system so far...

Here's the fatal error log entry:

[23-Aug-2014 01:19:39 Australia/Queensland] PHP Fatal error:  Call to undefined function microtime() in /.../classes/counter/ on line 184
[23-Aug-2014 01:19:39 Australia/Queensland] PHP Fatal error:  Cannot call overloaded function for non-object in Unknown on line 0

Destructor code:

        public function __destruct() {

That method's code starts like this, up to the line 184 microtime call of the log:

        static public function stop() {
                $that = static::$instance;
                if (!isset($that) || !isset($that->page)) {

                $now = microtime(TRUE);

and the second message about call overloaded function on non-object, probably comes some lines later as "$that->get_cpu_usage();" (there are no other objects involved up to that point)

PHP 5.5.16 is running as mod_php under the openSUSE 11.4 (evergreen) apache 2.2.17 server (up to date). PHP 5.5.16 has been compiled using the following configure line

./configure \
        --prefix=$DIR \
        --bindir=$DIR/bin \
        --libdir=$DIR \
        --includedir=$DIR/include \
        --mandir=$DIR/man \
        --with-apxs2=/usr/sbin/apxs2 \
        --with-config-file-path=$DIR \
        --with-config-file-scan-dir=$DIR/ini.d \
        --with-zend-vm=GOTO \
        --enable-re2c-cgoto \
        --disable-cgi \
        --enable-bcmath \
        --enable-calendar \
        --enable-exif \
        --enable-ftp \
        --enable-intl \
        --enable-mbstring \
        --enable-pcntl \
        --enable-soap \
        --enable-sockets \
        --enable-zip \
        --enable-opcache \
        --with-openssl \
        --with-zlib \
        --with-bz2 \
        --with-curl \
        --with-gd \
        --enable-gd-native-ttf \
        --with-jpeg-dir=/usr/include \
        --with-gettext \
        --with-gmp \
        --enable-mysqlnd \
        --with-mysqli \
        --with-readline \
        --with-recode \
        --with-xmlrpc \
        --with-xsl \
        --with-pear \
        --with-freetype-dir=/usr/include \
        --with-mhash \
        --with-mcrypt \

opcache, should it matter, is configured like this:



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-02-27 17:32 UTC] php at bof dot de
-Status: Open +Status: Closed
 [2015-02-27 17:32 UTC] php at bof dot de
couldn't properly reproduce this later, did not reoccur
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 21 21:01:34 2024 UTC