Bug #63171 [Opn->Csd]: Script hangs after max_execution_time
| From: | remi@php.net | Date: | Thu, 17 Mar 2016 12:43:00 +0000 |
| Subject: | Bug #63171 [Opn->Csd]: Script hangs after max_execution_time | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-199889@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63171&edit=1
ID: 63171
Updated by: remi@php.net
Reported by: remi@php.net
Summary: Script hangs after max_execution_time
-Status: Open
+Status: Closed
Type: Bug
Package: ODBC related
Operating System: GNU/Linux
PHP Version: 5.4.7
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of remi
Revision: http://git.php.net/?p=php-src.git;a=commit;h=407ad28ae5bbdf1c9e4c3ae8fa40a3ec6aeaf34e
Log: Fix Bug #63171 Script hangs after max_execution_time
Previous Comments:
------------------------------------------------------------------------
[2012-09-27 11:55:26] remi@php.net
Please, review https://github.com/php/php-src/pull/207
Pull request against 5.4, but could apply to all branches, 5.3, 5.4 and master.
------------------------------------------------------------------------
[2012-09-27 11:36:19] remi@php.net
Description:
------------
As unixODBC functions are not async-signal-safe, nor safe to be longjmp'ed out, If a timeout
occurs during an odbc calls, with a lock set, the PHP script will hangs.
I have a patch proposal, will submit a pull request.
Test script:
---------------
<?php
ini_set('max_execution_time', '1');
$db = odbc_connect('MySQL-test', 'root', '');
if (!$db) {
print "failed to connect\n";
} else {
while(true) {
echo ".";
$result = odbc_exec($db, 'SELECT * FROM mysql.user');
}
}
Expected result:
----------------
$ php test.php
.............................................................................
.............................................................................
.............................................................................
.............................................................................
.............................................................................
....PHP Fatal error: Maximum execution time of 1 second exceeded in
/home/rcollet/git/php/php/Regression/bz594813-ODBC-execution-timeout-hang/bz594813.php on line 10
$
Actual result:
--------------
Same output, but script hangs, need to be killed.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63171&edit=1