Bug #61240 [NEW]: curl_multi_select cause cpu load 100%
| From: | niniwzw at qq dot com | Date: | Fri, 02 Mar 2012 08:51:47 +0000 |
| Subject: | Bug #61240 [NEW]: curl_multi_select cause cpu load 100% | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-168016@lists.php.net to get a copy of this message | ||
From:
Operating system: window xp
PHP version: 5.3.10
Package: cURL related
Bug Type: Bug
Bug description:curl_multi_select cause cpu load 100%
Description:
------------
---
From manual page: http://www.php.net/function.curl-multi-exec
---
In the document of curl_multi_exec, has a example in the document.
it can run in php 5.2, but php 5.3 and php 5.4 cause cpu load 100%.
the example is:
<?php
// create both cURL resources
$ch1 = curl_init();
$ch2 = curl_init();
// set URL and other appropriate options
curl_setopt($ch1, CURLOPT_URL, "http://lxr.php.net/");
curl_setopt($ch1, CURLOPT_HEADER, 0);
curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/");
curl_setopt($ch2, CURLOPT_HEADER, 0);
//create the multiple cURL handle
$mh = curl_multi_init();
//add the two handles
curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);
$active = null;
//execute the handles
do {
$mrc = curl_multi_exec($mh, $active);
} while ($mrc == CURLM_CALL_MULTI_PERFORM);
while ($active && $mrc == CURLM_OK) {
if (curl_multi_select($mh) != -1) {
do {
$mrc = curl_multi_exec($mh, $active);
} while ($mrc == CURLM_CALL_MULTI_PERFORM);
}
}
//close the handles
curl_multi_remove_handle($mh, $ch1);
curl_multi_remove_handle($mh, $ch2);
curl_multi_close($mh);
?>
--
Edit bug report at https://bugs.php.net/bug.php?id=61240&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61240&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61240&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61240&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=61240&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61240&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=61240&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=61240&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=61240&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=61240&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=61240&r=support
Expected behavior: https://bugs.php.net/fix.php?id=61240&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=61240&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=61240&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=61240&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61240&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=61240&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=61240&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=61240&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=61240&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=61240&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=61240&r=mysqlcfg