curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: AW: Problem/Crash with libCurl Daily Snapshot and Option CURLSHOPT_SHARE and Parameter CURL_LOCK_DATA_CONNECT

From: Gisle Vanem via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 29 Nov 2017 14:39:55 +0100

Patrick Dawson wrote:

>>> static void ShareLockFunc( CURL* pHandle, curl_lock_data Data, curl_lock_access Access, void* pUseptr )
>>> {
>>> ...
>>> }
>>>
>>> static void ShareUnlockFunc( CURL* pHandle, curl_lock_data Data, void* pUseptr )
>>> {
>>> ...
>>> }
>>
>> Vanem, Gisle wrote:
>> What are these used for?
>
> In my understanding they are used to lock the access to the shared handle.

Yes, I know. But you forgot to use those lock-options. I've made a
patch for you:)

@@ -73,6 +73,8 @@

      CURLSH *pShare = curl_share_init();
      curl_share_setopt( pShare, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT );
+ curl_share_setopt( pShare, CURLSHOPT_LOCKFUNC, ShareLockFunc);
+ curl_share_setopt( pShare, CURLSHOPT_UNLOCKFUNC, ShareUnlockFunc);

> Crash 2:
> hash.c: 114
> struct curl_llist *l = FETCH_LIST(h, key, key_len); // h is 0

Looks very much like this issue:
   https://github.com/curl/curl/pull/712

Fixed last year though. Your subject says "libCurl Daily Snapshot".
So I assume you're using libcurl from a few days ago (?)

Is this a 64-bit version? I also tried your sample on 64-bit;
no problems there either.

-- 
--gv
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-11-29