cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: SSL_shutdown crashes

From: Ganesh Ragavan <ganeshragavan_at_gmail.com>
Date: Fri, 18 Sep 2009 12:14:34 -0700

Daniel,

Thanks for the reply. I am using Linux (2.6.18).

openSSL version: 0.9.8, static
I see the same problem with 7.19.6 as well.

I shall try to see the SSL_shutdown() input value.

~G

>So this is 7.18.2 on Windows? What OpenSSL version? Using OpenSSL static or
>DLL?

>Two ideas:
>
>1 - try 7.19.6 and see if that shows the same problem
>
>2 - set a break-point in the library and run with a debugger and check
> what libcurl passes as input to SSL_shutdown()

On Thu, Sep 17, 2009 at 8:37 PM, Ganesh Ragavan <ganeshragavan_at_gmail.com> wrote:
> Sorry, forgot to mention:
> #define CD_TIMEOUT_VALUE_SEC 60
>
> On Thu, Sep 17, 2009 at 5:44 PM, Ganesh Ragavan <ganeshragavan_at_gmail.com> wrote:
>> Hello,
>>
>> I am trying to run the following piece of code (I created this code to
>> narrow down my problem).  The code does the job for 1000 iterations in
>> the while loop.  In the while loop, after the
>> sleep (1001 th iteration), the code crashes at the line
>> curl_easy_perform(curl_desc).  I added some debug statements into the
>> libcurl code and I see the code crashing at the following place.
>>
>> file:           curl-7.18.2\lib\ssluse.c
>> function :   void Curl_ossl_close(struct connectdata *conn, int sockindex)
>> line:          (void)SSL_shutdown(connssl->handle);
>>
>>
>> int
>> main(int nargs,
>>         char *args[])
>> {
>>        CURL *curl_desc;
>>        FILE * pFile;
>>        int i=1;
>>
>>        curl_desc = curl_easy_init();
>>
>>        curl_easy_setopt(curl_desc, CURLOPT_FOLLOWLOCATION,1);
>>        curl_easy_setopt(curl_desc, CURLOPT_TIMEOUT, CD_TIMEOUT_VALUE_SEC);
>>        curl_easy_setopt(curl_desc, CURLOPT_CONNECTTIMEOUT, CD_TIMEOUT_VALUE_SEC);
>>        curl_easy_setopt(curl_desc, CURLOPT_FAILONERROR, 1);
>>        curl_easy_setopt(curl_desc, CURLOPT_USERPWD, "testuser123:Ph0enix08");
>>        curl_easy_setopt(curl_desc, CURLOPT_SSL_VERIFYPEER, 0);
>>        curl_easy_setopt(curl_desc, CURLOPT_SSL_VERIFYHOST, 0);
>>
>>
>>        while (1)
>>        {
>>                i++;
>>                pFile = fopen ("tmpfile","w");
>>
>>                /* set options for a curl easy handle */
>>                curl_easy_setopt(curl_desc, CURLOPT_RANGE, "0-");
>>                curl_easy_setopt(curl_desc, CURLOPT_WRITEDATA, pFile);
>>                curl_easy_setopt(curl_desc, CURLOPT_URL,
>> "https://fd86:8baa:b243:202::2023:443/data");
>>                curl_easy_perform(curl_desc);
>>
>>                if ((i % 1000) == 1)
>>                        sleep(600);
>>
>>                fclose(pFile);
>>        }
>>
>>        return 1;
>>
>> }
>>
>>
>> Could someone please let me know if I am missing something here.
>>
>> Thanks,
>> G
>>
>
Received on 2009-09-18