#28709 [Fbk->NoF]: Call to the function pg_last_error kill apache process.
ID: 28709
Updated by: php-bugs@lists.php.net
Reported By: info at sosulka dot ru
-Status: Feedback
+Status: No Feedback
Bug Type: PostgreSQL related
Operating System: FreeBsd 4.9
PHP Version: 4.3.6
New Comment:
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
Previous Comments:
------------------------------------------------------------------------
[2004-06-09 12:55:55] tony2001@php.net
Please, provide a short & clean reproduce script.
Read this: http://bugs.php.net/how-to-report.php
before reporting.
Include a backtrace, if you Apache is crashing (read here:
http://bugs.php.net/bugs-generating-backtrace.php
how to get a
backtrace, using gdb).
------------------------------------------------------------------------
[2004-06-09 12:48:45] info at sosulka dot ru
function _Halt($msg) {
$this->mError = pg_last_error($this->_LinkId);
if ($this->mErrHandler != '') {
$text = "Database Error occured!\n\nQuery:\n" .
$this->_Query . "\n\nError:\n" . $this->mError .
"\n\nError No:\n" . $this->mErrno;
$f = $this->mErrHandler;
$f($text);
}
if ($this->mHaltOnError == 'no') return;
$this->_HaltMsg($msg);
if ($this->mHaltOnError != 'report') die('Session halted.');
}
function _HaltMsg($msg) {
print '<b>Database error:</b> ' . $msg . "<br>\n";
print '<b>PgSQL Error</b>: ' . $this->mErrno . ' (' .
$this->mError . ")<br>\n";
}
------------------------------------------------------------------------
[2004-06-09 12:46:14] info at sosulka dot ru
Description:
------------
Call to the function pg_last_error kill apache process. It continue
working and eat so much resources. No reply to the user brouser.
Reproduce code:
---------------
function Query($query) {
if ($query == '') return 0;
$this->_Query = $query;
if (!$this->Connect()) return 0;
if ($this->_QueryId) $this->Free();
if ($this->mDebug) print 'Debug: query = ' . $query .
"<br>\n";
$this->_QueryId = pg_query($this->_LinkId, $query);
$this->mRow = 0;
# !!!!!! next line error!!!
$this->mError = pg_last_error($this->_LinkId);
# !!!!!!
if (!$this->_QueryId) $this->_Halt("Invalid SQL: " . $query);
return $this->_QueryId;
}
Actual result:
--------------
It working, but sometimes this code kill apache!!! Session destroied.
This normal load:
-bash-2.05b$ uptime
2:34PM up 17 days, 22:44, 1 user, load averages: 0,00 0,00 0,00
This load after erorr:
-bash-2.05b$ uptime
2:34PM up 17 days, 22:44, 1 user, load averages: 30,00 30,00 30,00
and much
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28709&edit=1
Thread (4 messages)