curl / Mailing Lists / curl-library / Single Mail


Application Crashes during curl_multi_perform

From: Rich Mpanga <>
Date: Tue, 10 Apr 2018 13:05:36 -0400

Hi everyone,

We have been running to this problem recently lately with MacOs High Sierra
and I haven't found any good discussions about it. We have a Google drive
like Application that syncs files to and from clients and a server. The
application is multi-threaded and we reuse curl handles, meaning that once
a thread is done with a request it places the handle into a queue. Each
thread has its own curl and multi handle.

I managed to create a simple C++ program that reproduces the crash. The
crash report and program are attached. The crash happens when 2 or more
threads call curl_multi_perform at the same time. As of right now the only
way I been able to prevent the crash is to force each thread to create a
new curl handle.

I also implemented the crypto locking callbacks in this example:
These functions do not appear to be called and the crash still occurs.

Apple did make a lot of changes to their Openssl libraries. They moved from
Openssl to Libressl and probably made some changes to the code base.

I have a few questions,

1. Are there other workarounds other than recreating the curl handle ?
2. What are the performance impacts from creating a new curl handle for
similar requests ?
3. Are the threading callback functions deprecated ?


Received on 2018-04-10