php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #16539 Cannot determine error status
Submitted: 2002-04-10 18:28 UTC Modified: 2011-01-01 00:26 UTC
From: charmaine dot tian at contec-innovations dot com Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.1.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: charmaine dot tian at contec-innovations dot com
New email:
PHP Version: OS:

 

 [2002-04-10 18:28 UTC] 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.
                                                                 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-01 00:26 UTC] jani@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2011-01-01 00:26 UTC] jani@php.net
All the code has changed in 5.x. This request no longer applies.
 [2011-01-01 00:26 UTC] jani@php.net
-Package: *General Issues +Package: Scripting Engine problem
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC