cURL / Mailing Lists / curl-library / Single Mail

curl-library

curl_easy_cleanup is crashing

From: Vasavi Mahadev <vasavi_at_tataelxsi.co.in>
Date: Thu, 8 Apr 2010 14:44:15 +0530

Hi,

Code Snippet:
-(int)contactProbeServerHTTP
{
  conn = curl_easy_init();
        
   if (conn == NULL)
    {
                exit(EXIT_FAILURE);
   }

             ProbeInfo=(EProbeInfos *)malloc(sizeof(EProbeInfos));
                
        //Frame the XML request
        strcpy(ProbeInfo->cstrData ,"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n");

        curl_easy_setopt(conn, CURLOPT_SSL_VERIFYHOST, 0L);
        curl_easy_setopt(conn, CURLOPT_SSL_VERIFYPEER, 0L);
    
        //Send HTTP request to the server
        sprintf(httpreq,"%s%s%s","https://",pszProbeServerAddr,"/PlcmRmWeb/device/adapterProbe");
                        
        code = curl_easy_setopt(conn, CURLOPT_INTERFACE,pHostIp );
        code = curl_easy_setopt(conn, CURLOPT_URL,httpreq);
        code = curl_easy_setopt(conn, CURLOPT_POSTFIELDS, ProbeInfo->cstrData);
        code = curl_easy_setopt(conn, CURLOPT_TIMEOUT, 5);
        code = curl_easy_perform(conn);
        
        
        curl_easy_getinfo(conn,CURLINFO_RESPONSE_CODE,&http_code);
        if(http_code == 200 && code != CURLE_ABORTED_BY_CALLBACK)
        {
                   curl_easy_cleanup(conn);
        }
}

When curl_easy_cleanup() is crashing the thread.
It happens very very rarely.
Can anyone tell me what has to be done to avoid crashing.

Crash Report::::

Thread 17 Crashed:
0 libcrypto.0.9.7.dylib 0x00859cc8 getrn + 76
1 libcrypto.0.9.7.dylib 0x008b3662 lh_delete + 44
2 libcrypto.0.9.7.dylib 0x008a3728 int_thread_del_item + 109
3 libcrypto.0.9.7.dylib 0x008a4259 ERR_remove_state + 64
4 libcurl.4.dylib 0x0078e3c6 Curl_ossl_close_all + 22
5 libcurl.4.dylib 0x0078a0bd Curl_close + 189
6 com.polycom.CMADesktop 0x003e9b13 0x1000 + 4098835
7 com.polycom.CMADesktop 0x003e8ef6 0x1000 + 4095734
8 com.apple.Foundation 0x941158dc -[NSThread main] + 45
9 com.apple.Foundation 0x9411588c __NSThread__main__ + 1499
10 libSystem.B.dylib 0x965d5a19 _pthread_start + 345
11 libSystem.B.dylib 0x965d589e thread_start + 34

Thread 17 crashed with X86 Thread State (32-bit):
  eax: 0x0001784a ebx: 0x00c0b810 ecx: 0xb08baaac edx: 0x00000002
  edi: 0x00c0b878 esi: 0x00000005 ebp: 0xb08baa78 esp: 0xb08baa40
   ss: 0x0000001f efl: 0x00010202 eip: 0x00859cc8 cs: 0x00000017
   ds: 0x0000001f es: 0x0000001f fs: 0x0000001f gs: 0x00000037
  cr2: 0x0000000d

-Vasavi

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-08