0

When working with PHP scripts, I usually do not have to bother with the underlying system. Today, I have to.

A PHP script (cronjob) that has worked fine is crashing since 2 days ago. The cronjob mail as well as running the script via shell both say:

Bus-Zugriffsfehler (Speicherabzug geschrieben)

If running the same script via PHP-FPM (via nginx) I receive a Bad Gateway which probably means "I have crashed, leave me alone", as well.

Unfortunately, I have no idea how to find more information, let alone, solve the problem. I have already checked the syslog (nothing related to the issue), dmesg (nothing) and the PHP error log (nothing). I also have reinstalled php5-cli, php5-pfm, and even libc6 and restarted the server -- no effect.

By the way: The whole thing is running on a virtual server (VPS), which also limits the chances of a hardware error. PHP has been updated to php5-cli (5.5.9+dfsg-1ubuntu4.7) recently, but the script worked fine after that for 9 days and two reboots...

Any ideas? Thanks a lot!

BurninLeo


EDIT: Solution

Of course, regularly sending echo from the PHP script is not elegant - but it helps to track problems to function calls. And, of course, the one seeking help did touch something, when he told he did not...

The solution was quite simple: A static class method called itself in the first line:

class ServerManager {

    public static function dropCache() {
        ServerManager::dropCache();  // VERY STUPID
        foreach (array('active', 'packed', 'old') as $class) {
            $cacheID = 'cache-'.$class.'-0';
            Cache::drop($cacheID);
        }
    }

}

Well, maybe PHP could have been a bit more specific in the cause of the problem. Yet, removing this one solved the problem.

BurninLeo
  • 900
  • 3
  • 12
  • 30
  • 1
    Either the system had an update two days ago, or some value in your script exceeds a value that triggers some PHP bug. – Tero Kilkanen Mar 31 '15 at 10:29
  • Hi, the most recent update was 9 days before the problem occured (added this to the question, now). Do I have any chance to find the PHP bug that is responsible for the issue? We're talking about thousands of lines of PHP scripts that won't be easy to debug with no indication... – BurninLeo Mar 31 '15 at 11:06

0 Answers0