cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Invalid write in curl_multi_perform

From: Hardeep Singh <hardeep21_at_gmail.com>
Date: Thu, 25 Jun 2009 16:11:45 -0700

On Thu, Jun 25, 2009 at 13:25, Savitha Perumal<savithap_at_yahoo-inc.com> wrote:
> Try using CURLOPT_COPYPOSTFIELDS option instead of CURLOPT_POSTFIELDS.
> This worked for me.
>
> Thanks
> Savitha
>
>
> -----Original Message-----
> From: curl-library-bounces_at_cool.haxx.se [mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
> Sent: Thursday, June 25, 2009 1:08 PM
> To: libcurl development
> Subject: Re: Invalid write in curl_multi_perform
>
> On Mon, 22 Jun 2009, Hardeep Singh wrote:
>
>> 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).
>
> In about 97 cases out of 100 when people reports this kind of bugs, it turns
> out that their app misbehaves and overwrites some memory at some random time.
> Or similar. Have you run your app with valgrind or similar?
>
> Of course, if you can provide an example repeating this problem or can get
> more data on exactly when and why it happens, then that can help too.
>
> --
>
>  / daniel.haxx.se
>

Thanks Daniel and Savitha

The problem is resolved. Yes the problem was in our code. The problem
was that error buffer memory was getting freed in another thread
before the request completed. One more count added to the 97%
statistic :)

Regards
Hardeep Singh
Received on 2009-06-26