Mantis - Quercus
Viewing Issue Advanced Details
6083 crash always 08-04-17 11:43 08-04-17 11:43
michaelahlers  
 
normal  
new  
open  
none    
none  
0006083: CurlMultiResource#execute Stuck in Infinite Loop
When using curl_multi_exec, com.caucho.quercus.lib.curl.CurlMultiResource#execute is called in an infinite loop, apparently because _runningCount is never decremented as requests complete.

This is easily reproducible with the following PHP script (using Guzzle) invoked using either QuercusEngine (or any other means):

<?php
$client = new \\Guzzle\\Http\\Client('https://caucho.com'); [^]
$client->get('/')->send();
$client->get('/')->send();
?>

One request will succeed, but the script will always hang on subsequent requests.

I found that adding this statement to com.caucho.quercus.lib.curl.CurlMultiResource#removeCurl (after _curlList.remove(curl)):

if (isRemoved) {
    _runningCount--;
}

Reliably fixes the bug (however, I'm not sure what implications this might have besides).

There are no notes attached to this issue.