|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35714 odbc_connect() does not timeout.
Submitted: 2005-12-16 21:13 UTC Modified: 2005-12-20 20:29 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: ceason at gmail dot com Assigned:
Status: Not a bug Package: ODBC related
PHP Version: 5.1.1 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.
Block user comment
Status: Assign to:
Bug Type:
From: ceason at gmail dot com
New email:
PHP Version: OS:


 [2005-12-16 21:13 UTC] ceason at gmail dot com
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

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)) {

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-17 02:53 UTC]
Please try using this CVS snapshot:
For Windows:

And use the PDO ODBC driver instead.
 [2005-12-19 23:10 UTC] ceason at gmail dot com
Compiled with latest and gave POD ODBC driver a spin.  Switching to POD will require a rewrite if I understand it correctly.  Will have to work with original for now.
 [2005-12-19 23:20 UTC]
You won't test, we can't fix. Bogus.
 [2005-12-20 20:29 UTC] ceason at gmail dot com
Guess I disagree.

Switching to POD is switching to a different API.  Don't see how that is a "Fix".
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Feb 20 10:01:24 2020 UTC