Edit report at http://bugs.php.net/bug.php?id=52284&edit=1

 ID:                 52284
 Comment by:         profy dot net at gmail dot com
 Reported by:        ahar...@php.net
 Summary:            Reproducible crash using curl_multi functions with
                     FTP
 Status:             Verified
 Type:               Bug
 Package:            cURL related
 Operating System:   Ubuntu 10.04 (and others)
 PHP Version:        5.3SVN-2010-07-08 (SVN)
 Block user comment: N

 New Comment:

Reproduced every time when call test script.



Test script:

---------------

<?php

function multi_request($urls, $url_options = array()) {

       $mh = curl_multi_init();

       foreach ($urls as $id => $url) {

               $curly[$id] = curl_init();

               curl_setopt($curly[$id], CURLOPT_URL, $url);

               curl_setopt($curly[$id], CURLOPT_RETURNTRANSFER, true);

               // I've add this opt to speed up request, bug appearing
with or

without this line

               curl_setopt($curly[$id], CURLOPT_NOBODY, true);

               curl_multi_add_handle($mh, $curly[$id]);

       }



       $running = null;

       do {

               $status = curl_multi_exec($mh, $running);

               usleep(1000);

       } while($status == CURLM_CALL_MULTI_PERFORM || $running);



       foreach ($curly as $id => $c) {

               $result[$id] = curl_multi_getcontent($c);

               curl_multi_remove_handle($mh, $c);

               curl_close($c);

       }

       curl_multi_close($mh);



       return $result;

}



$urls = array(

       "4358521"       =>

"ftp://ftp.ea.com/pub/ea/patches/nfs-underground/pc/en-uk/NFSU_EUROPE_PATCH_4.exe";,

       "7458288"       =>
"ftp://ftp.nero.com/software/plugins/WMAPlugin20937.exe";,

);



echo "<pre>";

print_R(multi_request($urls));

echo "</pre>";


Previous Comments:
------------------------------------------------------------------------
[2010-07-27 04:57:11] srina...@php.net

able to reproduce this issue. here is the stack trace:



(gdb) where

#0  0x0000000000520a58 in curl_write_header (data=0x18d3b78 "221
Goodbye.\r\nomplete.\r", size=1, nmemb=14, ctx=0x1876e58)

    at
/home/sriramn/dev/php-src/branches/PHP_5_3/ext/curl/interface.c:1123

#1  0x00007f106e187c26 in ?? () from /usr/lib/libcurl.so.4

#2  0x00007f106e1885ad in ?? () from /usr/lib/libcurl.so.4

#3  0x00007f106e18b2ed in ?? () from /usr/lib/libcurl.so.4

#4  0x00007f106e18c64f in ?? () from /usr/lib/libcurl.so.4

#5  0x00007f106e18c792 in ?? () from /usr/lib/libcurl.so.4

#6  0x00007f106e18e9b2 in ?? () from /usr/lib/libcurl.so.4

#7  0x00007f106e1a4813 in curl_multi_cleanup () from
/usr/lib/libcurl.so.4

#8  0x0000000000527208 in _php_curl_multi_close (rsrc=0x1871970) at
/home/sriramn/dev/php-src/branches/PHP_5_3/ext/curl/multi.c:327

#9  0x00000000007f246e in list_entry_destructor (ptr=0x1871970) at
/home/sriramn/dev/php-src/branches/PHP_5_3/Zend/zend_list.c:184

#10 0x00000000007efa3b in zend_hash_del_key_or_index (ht=0xe1eaf0,
arKey=0x0, nKeyLength=0, h=4, flag=1) at
/home/sriramn/dev/php-src/branches/PHP_5_3/Zend/zend_hash.c:497

#11 0x00000000007f1fa0 in _zend_list_delete (id=4) at
/home/sriramn/dev/php-src/branches/PHP_5_3/Zend/zend_list.c:58

#12 0x00000000005271d5 in zif_curl_multi_close (ht=1,
return_value=0x187a140, return_value_ptr=0x0, this_ptr=0x0,
return_value_used=0)

    at /home/sriramn/dev/php-src/branches/PHP_5_3/ext/curl/multi.c:319

------------------------------------------------------------------------
[2010-07-21 13:11:10] profy dot net at gmail dot com

Sorry for bothering you, but I see now that bug still exists. My code
already had a workaround for that issue and I not disabled it when
testing against latest version (5.3.3RC3 and libcurl 7.21.0). Now
I&#39;ve tested again with truly parallel 5 ftp requests and it is still
failing as it was with PHP 5.2.13 on Win XP SP3

------------------------------------------------------------------------
[2010-07-21 12:39:00] paj...@php.net

Was a libCurl issue, fixed in latest release.

------------------------------------------------------------------------
[2010-07-21 12:31:14] profy dot net at gmail dot com

I&#38;#38;#39;ve tested with latest PHP5.3.3RC3 downloaded from
http://windows.php.net/qa/ and it works fine now with 5 FTP and 3 HTTP
parallel requests using curl_multi_* functions. This request failed
before. cURL version is 7.21.0. It seems bug is fixed in latest curl.

------------------------------------------------------------------------
[2010-07-21 11:07:25] profy dot net at gmail dot com

Curl version: libcurl/7.20.0 OpenSSL/0.9.8h zlib/1.2.3

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=52284


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52284&edit=1

Reply via email to