Req #16539 [Opn->Wfx]: Cannot determine error status
| From: | jani@php.net | Date: | Fri, 31 Dec 2010 23:26:13 +0000 |
| Subject: | Req #16539 [Opn->Wfx]: Cannot determine error status | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157441@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=16539&edit=1
ID: 16539
Updated by: jani@php.net
Reported by: charmaine dot tian at contec-innovations dot com
Summary: Cannot determine error status
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: Linux
PHP Version: 4.1.2
Block user comment: N
Private report: N
New Comment:
All the code has changed in 5.x. This request no longer applies.
Previous Comments:
------------------------------------------------------------------------
[2002-04-10 18:28:21] charmaine dot tian at contec-innovations dot com
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 this bug report at http://bugs.php.net/bug.php?id=16539&edit=1