cURL / Mailing Lists / curl-library / Single Mail


Re: Getting Segmentation Fault from curl_multi_perform() when I add data

From: Dan Fandrich <>
Date: Thu, 17 Dec 2015 00:01:30 +0100

On Wed, Dec 16, 2015 at 02:04:59PM -0600, wrote:
> I am getting a segmentation fault from curl_multi_perform() when I try to add
> data.
> My do {} while loop looks like the one on
> multi-post.html. While my program is waiting for data the curl_multi_perform()
> is running and returning normally, as far as I can tell. When data becomes
> available I set it in the easy handle using curl_easy_setopt() with the
> CURLOPT_POSTFIELDS and CURLOPT_POSTFIELDSIZE enumerations. I then add that
> easy handle to my multi handle with curl_multi_add_handle().

Are you changing and adding the first handle or a second handle? You can't
change a handle in mid-transfer.

> From what I can tell with my COUTs, it called the curl_multi_perform() two more
> times and then seg faults on the third call. What could be happening?

Run it under a debugger to see the exact line number of the code that's
segfaulting. If you still can't figure it out, please post code that
demonstrates the problem.

>>> Dan
List admin:
Received on 2015-12-17