php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10981 Script crash in zend_execute.c
Submitted: 2001-05-21 03:28 UTC Modified: 2001-06-12 17:21 UTC
From: graeme at i7 dot com dot au Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.5 OS: linux x86
Private report: No CVE-ID: None
 [2001-05-21 03:28 UTC] graeme at i7 dot com dot au
One of our users reported the following problem to us in a screen dump. Because the script in question is in production and it looks perhaps to be an intermittent problem (we don't know at this stage) I cannot provide a backtrace.

The error is 
Fatal error: Cannot increment/decrement overloaded objects nor string offsets in &#224:Ì on line 795176303.

The error is reported at 1082 in zend_execute.c

Script attached:
$URL = "http://XXX.com.au/internal/thingie.php";
$HOME = "/home/aap";
$PARSER_LOCKFILE = "$HOME/parser.LCK";
$PARSER_STAMPFILE = "$HOME/parser.stamp";
$PREGEN_LOCKFILE = "$HOME/pregen.LCK";
$PREGEN_OVERRIDE_FILE = "$HOME/pregen.override";
$PREGEN_TIMEOUT = 300; # seconds
$FEED_DIR = "$HOME/ftpdata/TAN";

/* actions */

if ($QUERY_STRING == "halt") {
        $base_url = "http://XXX.com.au/NewsSiteGenerator/1,2045,,0.html";
#       $f = fopen("$base_url?actionType=abort",'r');
#       fclose($f);
#       @unlink($PREGEN_LOCKFILE);
        header("Location: $base_url");
}
elseif ($QUERY_STRING == "queue") {
        $f = @fopen($PREGEN_OVERRIDE_FILE, 'w');
        @fwrite ($f,    "TRUE\n");
        @fclose ($f);
        header("Location: $URL");
}
elseif (ereg("^stop=",$QUERY_STRING)) {
        @unlink ($PARSER_STAMPFILE);
        @unlink ($PARSER_STAMPFILE);
        header("Location: $URL?stopped=$stop");
}
elseif ($QUERY_STRING == "reset") {
        @unlink ($PARSER_STAMPFILE);
        @unlink ($PARSER_LOCKFILE);
        @unlink ($PREGEN_OVERRIDE_FILE);
        header("Location: $URL");
}

/* figure out our state machine */

$parser_locked = file_exists($PARSER_LOCKFILE);
$timer_running = file_exists($PARSER_STAMPFILE);
$pregen_running = (file_exists($PREGEN_LOCKFILE) || pregen_running());
$pregen_queued = file_exists($PREGEN_OVERRIDE_FILE);
$stories_queued = `find $FEED_DIR -type f -maxdepth 1`;

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache");
header("Cache-Control: post-check=0, pre-check=0");
header("Pragma: no-cache");

?>
<html><head><title>AAP Status and Control page</title>
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="refresh" content="2">
        <link rel="stylesheet" href="style.css" type="text/css">
</head>
<body<?=($timer_running ? ' onLoad="window.focus();"':'')?>>
<p><b>BE VERY CAREFUL</b><br>Time: <?=date('g:i:s a')?></p>

<?
if ($timer_running) {
        $LAST_INSERT = trim(`head -1 $PARSER_STAMPFILE`);
        $NOW = date('U');
        $seconds = ($LAST_INSERT + $PREGEN_TIMEOUT) - $NOW;
        $minutes = floor($seconds / 60);
        $seconds = $seconds % 60;
        $time_left = sprintf("%02d:%02d",$minutes,$seconds);

        echo "New stories await<br><span class=alert>$time_left<br>";
        printf (
                "<a class=alert href=$URL?stop=%s><b>Stop the clock</b></a><br><br></span>",
                urlencode($time_left)
        );
} elseif (ereg("^stopped",$QUERY_STRING)) {
        printf (
                "<span class=alert>Clock stopped at %s<br><br></span>",
                urldecode($stopped)
        );
}

if ($stories_queued) {
        echo "New bulletin waiting to enter the system<br><br>";
}

if ($parser_locked) echo "System locked<br>";
if ($pregen_queued) echo "Pregeneration queued<br>";

if ($parser_locked or $pregen_queued) {
        echo "<a href=$URL?reset><b>Reset the system</b></a><br><br></span>";
}

if ($pregen_running) {
        echo "Pregeneration in progress<br>";
        echo "<a href=$URL?halt>Halt pregeneration</a><br><br>";
}

echo "<a href=$URL?queue>Queue Pregeneration</a><br><br>";

echo "</body>";

function pregen_running()
{
        global $dbh;
        if (!$dbh) $dbh = ociplogon("XXX","XXX","TAN");
        $field = "GENERATION_IN_PROGRESS_FLAG";
        $sql = "select $field from i7_news_cache_control";
        if ( ! $sth = ociparse($dbh,$sql)) return 0;
        if ( ! ociexecute($sth)) return 0;
        if ( ! ocifetch($sth)) return false;
        if ( ociresult($sth, $field) != 'Y') return false;
        return true;
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-23 02:44 UTC] sniper@php.net
Can you actually reproduce this?
please try shortening the script to shortest possible that
still causes the crash.



 [2001-05-23 02:46 UTC] sniper@php.net
Can you actually reproduce this?
please try shortening the script to shortest possible that
still causes the crash.



 [2001-06-12 17:21 UTC] sniper@php.net
No feedback. Most likely Apache not linked with pthreads,
or the needed environment variables are not set.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC