curl / Mailing Lists / curl-library / Single Mail


macOS High Sierra: SSL_CONNECT_ERROR and crash in curl_share_cleanup

From: Hölzl, Dominik <>
Date: Tue, 24 Oct 2017 16:02:16 +0000


Since the last macOS Update (10.13) and its new pre-installed curl library (7.54) we often see the following crash:

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
abort() called
*** error for object 0x7fffafd23058: pointer being freed was not allocated

Thread 0 Crashed:: Dispatch queue:
0 libsystem_kernel.dylib 0x00007fff7cd7dfce __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff7cebb150 pthread_kill + 333
2 libsystem_c.dylib 0x00007fff7ccda32a abort + 127
3 libsystem_malloc.dylib 0x00007fff7cdd7866 free + 521
4 libcrypto.35.dylib 0x00007fff7b28facc sk_free + 44
5 libssl.35.dylib 0x00007fff7c7829cf SSL_SESSION_free + 271
6 libcurl.4.dylib 0x00007fff7b56460d Curl_ssl_kill_session + 27
7 libcurl.4.dylib 0x00007fff7b54a3dd curl_share_cleanup + 169

The call to curl_share_cleanup ist the first one in the crashing process (so a multi-free from our source is excluded).
The process heavily uses the share handle before without crashing.
The crash usually happens when the network goes away and cURL starts to fail with SSL_CONNECT_ERROR.
Calling curl_share_cleanup after this leads to the crash above.
The share handle is created with CURLSHOPT_SHARE/CURL_LOCK_DATA_SSL_SESSION (maybe on a different thread than curl_share_cleanup is called).
In logs I can see that the ssl session locking functions are correctly called when performing a request.
Our process uses cURL multi-threaded, but only one handle on one thread.
While the crash no request is executed.

Before the macOS-Update I could never see such crashes.

Has anybody an idea what the cause could be?


Received on 2017-10-24