cURL / Mailing Lists / curl-library / Single Mail


libcurl: Hang/Crash due to CURLE_COULDNT_CONNECT ( probably in curl_easy_cleanup)

From: Sandeep Kale <>
Date: Mon, 6 Apr 2009 19:32:53 +0530



We are using the libcurl version as below,


---------------------- libcurl version ----------------------------

curl 7.18.1 (sparc-sun-solaris2.10) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.1.3

Protocols: tftp ftp telnet dict ldap http file https ftps

Features: IPv6 Largefile NTLM SSL libz



We have developed a server which has libcurl at its heart. It processes all
kind of http / soap requests. This server goes into a hang state once it
receives a curl return code as "CURLE_COULDNT_CONNECT", the server process
doesn't crash neither it generates any core file.


However the curl return code "CURLE_COULDNT_CONNECT" is not frequent enough
to replicate the issue. So we tried to simulate the situation by
intentionally setting the return code variable to "CURLE_COULDNT_CONNECT"
and observed the behavior. This time the process crashed and generated a
core showing the below stack,


(dbx) lwp l_at_5

Current function is Curl_ossl_session_free

  850 SSL_SESSION_free(ptr);

t_at_5 (l_at_5) stopped in realfree at 0xfe9d4a4c

0xfe9d4a4c: realfree+0x003c: st %o1, [%i0 - 8]

(dbx) where

dbx: warning: can't find file "/app/middle/skale/BALA/src/CurlMQ/curlAdap.o"

dbx: warning: see `help finding-files'

  [1] realfree(0xff368e70, 0x74206e61, 0x95890, 0xfe9d51d4, 0x8, 0x8), at

  [2] _free_unlocked(0xfea71b14, 0x0, 0x950bc, 0xfea71b94, 0xfea6a2b4,
0x89980), at 0xfe9d5298

  [3] free(0x89980, 0x33, 0x950fc, 0xfef57a34, 0xfea6a2b4, 0x991f0), at

  [4] CRYPTO_free(0x89980, 0x9, 0x10db0c, 0xff33d09c, 0x0, 0xfeec9a34), at

  [5] SSL_SESSION_free(0x0, 0x33, 0x1d3e0, 0xff35f6ac, 0xfef74d94, 0x991f0),
at 0xfef57a34

=>[6] Curl_ossl_session_free(ptr = 0x991f0), line 850 in "ssluse.c"

  [7] kill_session(session = 0x71498), line 315 in "sslgen.c"

  [8] Curl_ssl_close_all(data = 0x7bb48), line 411 in "sslgen.c"

  [9] Curl_close(data = 0x7bb48), line 478 in "url.c"

  [10] curl_easy_cleanup(curl = 0x7bb48), line 535 in "easy.c"

  [11] HTTPCALL(0x6abb8, 0x33, 0x1a, 0x1d, 0x1a, 0x7bb48), at 0x15984

  [12] l210_mqproc_function(pMqPut = 0x6b468), line 428 in "CurlMQ.c"

  [13] l201_mqget_thread(pFrontData = 0x50468), line 334 in "CurlMQ.c"


As per the core, the server fails during curl_easy_cleanup ( not sure what
would be a logical reason).

Any help for this regard would be great.



Received on 2009-04-06