From: [EMAIL PROTECTED]
Operating system: Linux
PHP version: 4.1.0
PHP Bug Type: Feature/Change Request
Bug description: Cannot determine error status
I'd like to have some functionality that helps to determine if a script is
terminated normally or due to time out error and/or memory limit exceeded
error.
There are two global flags, PG(connection_status) and
AG(memory_exhausted), which supposedly would indicate such errors.
However, they are not set properly. PG(connection_status) remains as
PHP_CONNECTION_NORMAL when time out happens. AG(memory_exhausted) is
always 0, never changes.
I'm writing a new PHP extension and I need to generate an alert when a
script is terminated due to errors. The changes I need are very minor,
actually I can pinpoint the changes in the PHP source:
1) in Zend/zend_execute_API.c, function zend_timeout(), uncomment the
following line:
/* is there any point in this? we're terminating the request anyway...
PG(connection_status) |= PHP_CONNECTION_TIMEOUT; */
2) in Zend/zend_alloc.c, _CHECK_MEMORY_LIMIT macro, line
AG(memory_exhausted=1;
should be put before "zend_error(...)", because zend_error(...) never
returns in case of fatal errors.
--
Edit bug report at http://bugs.php.net/?id=16539&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16539&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16539&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16539&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16539&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16539&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16539&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16539&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16539&r=submittedtwice