cURL / Mailing Lists / curl-library / Single Mail

curl-library

Lockup in SSL-based communication

From: David Strauss <david_at_davidstrauss.net>
Date: Wed, 1 May 2013 12:28:12 -0700

We're seeing a sort of lockup in our SSL clients with a trace listed
below. What timeouts should we be configuring to give up faster when
it's in this state? It looks like it's completing the SSL handshake.

We have the following timeouts set on the handle:

curl_easy_setopt(session, CURLOPT_CONNECTTIMEOUT_MS, 500);
curl_easy_setopt(session, CURLOPT_TIMEOUT, 600);

Here's the GDB trace from the relevant thread:

Thread 4 (Thread 0x7fb8c47ff700 (LWP 16792)):
#0 0x00000033f70e8bdf in __GI___poll (fds=fds_at_entry=0x7fb8c47fc370,
nfds=nfds_at_entry=1, timeout=timeout_at_entry=5000) at
../sysdeps/unix/sysv/linux/poll.c:87
#1 0x00007fb8c94dbd6b in pt_poll_now (op=op_at_entry=0x7fb8c47fc3c0) at
../../../mozilla/nsprpub/pr/src/pthreads/ptio.c:583
#2 0x00007fb8c94dc90d in pt_Continue (op=0x7fb8c47fc3c0) at
../../../mozilla/nsprpub/pr/src/pthreads/ptio.c:706
#3 pt_Recv (fd=0x7fb8c38b2a90, buf=0x7fb8c38d4bac, amount=2772,
flags=<optimized out>, timeout=4294967295) at
../../../mozilla/nsprpub/pr/src/pthreads/ptio.c:1865
#4 0x00007fb8c9712cce in ssl_DefRecv (ss=ss_at_entry=0x7fb8c3a68000,
buf=<optimized out>, len=2772, flags=flags_at_entry=0) at ssldef.c:62
#5 0x00007fb8c970e272 in ssl3_GatherData (flags=0, gs=<optimized
out>, ss=0x7fb8c3a68000) at ssl3gthr.c:59
#6 ssl3_GatherCompleteHandshake (ss=ss_at_entry=0x7fb8c3a68000,
flags=flags_at_entry=0) at ssl3gthr.c:318
#7 0x00007fb8c970e80a in ssl3_GatherAppDataRecord (ss=0x7fb8c3a68000,
flags=0) at ssl3gthr.c:404
#8 0x00007fb8c9717f45 in DoRecv (flags=0, len=9823,
out=0x7fb8c387c870 "g\277\177\254\253\377", ss=0x7fb8c3a68000) at
sslsecur.c:535
#9 ssl_SecureRecv (ss=0x7fb8c3a68000, buf=0x7fb8c387c870
"g\277\177\254\253\377", len=9823, flags=0) at sslsecur.c:1144
#10 0x00007fb8c971be76 in ssl_Recv (fd=<optimized out>,
buf=0x7fb8c387c870, len=9823, flags=0, timeout=4294967295) at
sslsock.c:2071
#11 0x00000033fe83fdd2 in nss_recv (conn=0x7fb8c386b600,
num=<optimized out>, buf=<optimized out>, buffersize=<optimized out>,
curlcode=0x7fb8c47fc57c) at nss.c:1485
#12 0x00000033fe814574 in Curl_read (conn=conn_at_entry=0x7fb8c386b600,
sockfd=11, buf=0x7fb8c387c870 "g\277\177\254\253\377",
sizerequested=9823, n=n_at_entry=0x7fb8c47fc5d8) at sendf.c:575
#13 0x00000033fe827800 in readwrite_data (done=0x7fb8c47fc65f,
didwhat=<synthetic pointer>, k=0x7fb8c387c028, conn=0x7fb8c386b600,
data=0x7fb8c387c000) at transfer.c:409
#14 Curl_readwrite (conn=conn_at_entry=0x7fb8c386b600,
done=done_at_entry=0x7fb8c47fc65f) at transfer.c:1029
#15 0x00000033fe82937d in Transfer (conn=0x7fb8c386b600) at transfer.c:1396
#16 Curl_do_perform (data=0x7fb8c387c000) at transfer.c:2108
#17 0x00000033fe82982b in Curl_perform
(data=data_at_entry=0x7fb8c387c000) at transfer.c:2232
#18 0x00000033fe829d0c in curl_easy_perform
(curl=curl_at_entry=0x7fb8c387c000) at easy.c:541
<snip>

--
David Strauss
   | david_at_davidstrauss.net
   | +1 512 577 5827 [mobile]
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-05-01