cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Infinite loop

From: Ray Satiro via curl-library <curl-library_at_cool.haxx.se>
Date: Fri, 15 Jan 2016 03:13:57 -0500

On 1/14/2016 11:26 AM, Jakub Zakrzewski wrote:
> Thanks, Ray.
> I still didn't fgure out, why the timeout does not trigger but taking few more dumps (I'm just creating dumps using TaskManager) led me to a belief that it's either libssh2 or the interaction between libssh2 and libcurl. Just look at the callstack:
>
> ntdll.dll!NtDeviceIoControlFile() Unknown
> mswsock.dll!WSPRecv() Unknown
> ws2_32.dll!recv() Unknown
> libssh2.dll!_libssh2_recv(unsigned __int64 sock=0, void * buffer=0x0000000000000200, unsigned __int64 length=0, int flags=0, void * * abstract=0x0000000105874f80) Line 104 C
> libssh2.dll!_libssh2_transport_read(_LIBSSH2_SESSION * session=0x00000001058751a8) Line 371 C
> libssh2.dll!_libssh2_packet_require(_LIBSSH2_SESSION * session=0x0000000105874f80, unsigned char packet_type='\0', unsigned char * * data=0x0000000000000000, unsigned __int64 * data_len=0x00000001058791e8, int match_ofs=0, const unsigned char * match_buf=0x0000000000000000, unsigned __int64 match_len=0, packet_require_state_t * state=0x0000000105881c38) Line 1118 C
> libssh2.dll!_libssh2_kex_exchange(_LIBSSH2_SESSION * session=0x0000000000000008, int reexchange=0, key_exchange_state_t * key_state=0x0000000105874f80) Line 1743 C
> libssh2.dll!_libssh2_transport_send(_LIBSSH2_SESSION * session=0x0000000000000008, const unsigned char * data=0x0000000105881db8, unsigned __int64 data_len=4387773488, const unsigned char * data2=0x00007ffcdee9b27c, unsigned __int64 data2_len=0) Line 715 C
> libssh2.dll!session_disconnect(_LIBSSH2_SESSION * session=0x01d14dfeaf130467, int reason=92753792, const char * description=0x00007ffcde9bf320, const char * lang=0x0000000000000200) Line 1125 C
> libssh2.dll!libssh2_session_disconnect_ex(_LIBSSH2_SESSION * session=0x0000000000000000, int reason=68414496, const char * desc=0x0000000000000000, const char * lang=0x0000000000000000) Line 1143 C
> libcurl.dll!ssh_statemach_act(connectdata * conn=0x000d59f8000c22a6, bool * block=0x0000000105787e00) Line 2506 C
> libcurl.dll!ssh_block_statemach(connectdata * conn=0x0000000105787e00, bool duringconnect=false) Line 2717 C
> libcurl.dll!Curl_disconnect(connectdata * conn=0x000000010577a380, bool dead_connection=false) Line 2764 C
> libcurl.dll!Curl_done(connectdata * * connp=0x0000000000000000, CURLcode status=91726720, bool premature=120) Line 6088 C
> libcurl.dll!multi_runsingle(Curl_multi * multi=0x000000010577a380, timeval now={...}, SessionHandle * data=0x00000001056bae00) Line 1079 C
> libcurl.dll!curl_multi_perform(void * multi_handle=0x0007280800027fd9, int * running_handles=0x0000000000000000) Line 1811 C
> libcurl.dll!easy_transfer(void * multi=0x000000010577a380) Line 715 C
> libcurl.dll!easy_perform(SessionHandle * data=0x0000000000000001, bool events=240) Line 803 C
> ...
>
> libcurl tries to disconnect gracefully but libssh2 is being stuck on key exchange and therefore cannot complete. In theory setting the timeout should break the loop but in the dumps it seems that it's set to 0. I don't know if I can entirely trust the dumps from an optimized build though.
>

There are some issues with libssh 1.6.0 in Windows [1], so you may want
to look into that. As I've already mentioned please consider making a
debug build of at least libcurl, for starters.

[1]: http://www.libssh2.org/mail/libssh2-devel-archive-2016-01/0025.shtml

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2016-01-15