From:             ceason at gmail dot com
Operating system: Linux 
PHP version:      5.1.1
PHP Bug Type:     *General Issues
Bug description:  Php script does not timeout 

Description:
------------
A php script that didn't check the odbc_connect return value entered a
state
where it did not end.  The httpd server does not seem to time these
requests out
and reports the as "W" Sending Reply state.  Eventually this causes
access
denial due to max_connection limit being reached.  I upgraded to httpd
2.2.0 and
php 5.1.1 but the problem still occurs.

This is the timeout value from httpd.conf
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

This is the timeout value from php.ini
max_execution_time = 120     ; Maximum execution time of each script, in
seconds
max_input_time = 60     ; Maximum amount of time each script may spend
parsing
request data
memory_limit = 8M      ; Maximum amount of memory a script may consume
(8MB)


server-status entry:
0-0     27217   2/2/2   W       0.00    3284    0       13.2    0.01    0.01    
ceason  madmax  GET
/status/ras_results.php?db=bgs1&severityCB=1&facilityCB=1&b


I initially reported this as an Apache bug and received this response.

This is a bug in mod_php.  If mod_php does not return the control of
execution
from the script, httpd can't do anytning.  Please report this to the PHP
Project, instead of Apache HTTP Server Project.



Reproduce code:
---------------
$dbconn =  odbc_connect("BOGUS","username","password");
$query = "select * from footable";
 while(odbc_fetch_row($result)) {
 print"$result";  
 } 


This may fail correct the 1st time.  Hit refresh after this and it should
hang up.

Expected result:
----------------
Similiar error messages as below


Warning: odbc_connect() [function.odbc-connect]: SQL error: \EA, SQL
state D\$ in SQLConnect in /var/www/html/test.php on line 14

Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result
resource in /var/www/html/test.php on line 16

Actual result:
--------------
Hang after refresh

-- 
Edit bug report at http://bugs.php.net/?id=35714&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=35714&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=35714&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=35714&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=35714&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=35714&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=35714&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=35714&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=35714&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=35714&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=35714&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=35714&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=35714&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=35714&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=35714&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=35714&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=35714&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=35714&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=35714&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=35714&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=35714&r=mysqlcfg

Reply via email to