From: ab
Operating system: any
PHP version: Irrelevant
Package: cURL related
Bug Type: Bug
Bug description:curl_multi_* crash with libcurl 7.29.0
Description:
------------
Perhaps that's a libcurl bug, but the curl extension multi functionality
consistently fails with 7.29.0 . For instance this snippet based on
ext/curl/tests/curl_multi_init_basic.phpt
$mh = curl_multi_init();
curl_multi_close($mh);
Basically it does crash always if no handles were added between init and
cleanup. Ther corresponding snippet in c
#include <curl/curl.h>
int main(void)
{
CURLM *multi_handle;
multi_handle = curl_multi_init();
curl_multi_cleanup(multi_handle);
return 0;
}
That snippets do successfully work with the libcurl versions prior to
7.29.0 . The issue introduces itself starting with this commit in libcurl
included in 7.29.0
https://github.com/bagder/curl/commit/c43127414d89ccb9ef6517081f68986d991bcfb3#L10R1776
And the commit is related to a big change explaned here
http://daniel.haxx.se/blog/2013/01/17/internally-were-all-multi-now/
The issue is consistently reproduceable on linux and windows through all
PHP versions.
Expected result:
----------------
no crash
Actual result:
--------------
#0 _php_curl_multi_close (rsrc=0xb707259c) at
/home/weltling/dws/src/php-5.5-nts/ext/curl/multi.c:349
#1 0x085902ff in list_entry_destructor (ptr=0xb707259c) at
/home/weltling/dws/src/php-5.5-nts/Zend/zend_list.c:183
#2 0x0858d72e in zend_hash_del_key_or_index (ht=0x8aa7158, arKey=0x0,
nKeyLength=0, h=4, flag=1)
at /home/weltling/dws/src/php-5.5-nts/Zend/zend_hash.c:531
#3 0x0858ffed in _zend_list_delete (id=4) at
/home/weltling/dws/src/php-5.5-nts/Zend/zend_list.c:57
#4 0x081d1d8b in zif_curl_multi_close (ht=1, return_value=0xb7070b3c,
return_value_ptr=0x0, this_ptr=0x0,
return_value_used=0) at
/home/weltling/dws/src/php-5.5-nts/ext/curl/multi.c:330
#5 0x085b7f4b in zend_do_fcall_common_helper_SPEC
(execute_data=0xb70540c4)
at /home/weltling/dws/src/php-5.5-nts/Zend/zend_vm_execute.h:542
#6 0x085bdc7b in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0xb70540c4)
at /home/weltling/dws/src/php-5.5-nts/Zend/zend_vm_execute.h:2293
#7 0x085b695c in execute_ex (execute_data=0xb70540c4) at
/home/weltling/dws/src/php-5.5-nts/Zend/zend_vm_execute.h:356
#8 0x085b7023 in zend_execute (op_array=0xb70713a8) at
/home/weltling/dws/src/php-5.5-nts/Zend/zend_vm_execute.h:381
#9 0x0857ed2d in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at /home/weltling/dws/src/php-5.5-nts/Zend/zend.c:1316
#10 0x085023ec in php_execute_script (primary_file=0xbfffdff0) at
/home/weltling/dws/src/php-5.5-nts/main/main.c:2479
#11 0x086a7d59 in do_cli (argc=2, argv=0xbffff284) at
/home/weltling/dws/src/php-5.5-nts/sapi/cli/php_cli.c:988
#12 0x086a8ec3 in main (argc=2, argv=0xbffff284) at
/home/weltling/dws/src/php-5.5-nts/sapi/cli/php_cli.c:1364
--
Edit bug report at https://bugs.php.net/bug.php?id=64177&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=64177&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=64177&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=64177&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64177&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64177&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64177&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64177&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64177&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64177&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64177&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64177&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64177&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64177&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64177&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64177&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64177&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64177&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64177&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64177&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64177&r=mysqlcfg