php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63171 Script hangs after max_execution_time
Submitted: 2012-09-27 11:36 UTC Modified: -
From: remi@php.net Assigned:
Status: Open Package: ODBC related
PHP Version: 5.4.7 OS: GNU/Linux
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-09-27 11:36 UTC] 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.


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-27 11:55 UTC] 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.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Mon Apr 21 00:02:04 2014 UTC