cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Invalid write in curl_multi_perform

From: Hardeep Singh <hardeep21_at_gmail.com>
Date: Mon, 22 Jun 2009 10:28:36 -0700

On Sun, Jun 21, 2009 at 14:05, Daniel Stenberg<daniel_at_haxx.se> wrote:
> On Fri, 19 Jun 2009, Hardeep Singh wrote:
>
>> I am new to curl development. I am facing an issue of Invalid Write within
>> the curl_multi_perform function. Due to this the application crashes after
>> receiving SIGSEGV. This signal is received in the destructor of a string(
>> always). We pass that string to create a curl_slist object which is passed
>> in setting header option in curl_easy_setopt. This use of curl_easy is in a
>> separate class but could be called simultaneously in a different thread.
>
> Can you elaborate? You're using the same curl handle simultaneously in more
> than one thread? That's documented not to work.
>

No we don't use the same handle simultaneously in multiple threads. I
mean to say that there could be two threads running simultaneously
with different handles. One of which is a multi handle and other one
is not. The write error happens in curl_multi_perform, but application
crashes in the destructor of the string that was used for setting http
header options via curl_slist object. (for the non-multi handle).

>> This happens when curl timeouts waiting for a response. This is around a
>> minute, i think which corresponds to low limit time default value. The curl
>> version in use is 7.19.2 ( libcurl 4.1.1 )
>>
>> Has anyone seen this before? Any solution for this behavior? Any ideas or
>> pointers are appreciated.
>
> It'll help if you get the most recent version and see if the problem
> persists. If it does, check the code flow for the crash to see exactly what
> string it wants to *printf() when it crashes. Also, try to write up an
> example code that can repeat the problem to post here for us to help you
> out.
>

Ok I can try with the newer version.

> --
>
>  / daniel.haxx.se

Thanks
Hardeep
Received on 2009-06-22