cURL / Mailing Lists / curl-library / Single Mail


Curl_share_lock deadlock when flushing cookielist?

From: Kristoffer Gleditsch <>
Date: Wed, 19 Feb 2014 12:35:24 +0100


I've been testing the share objects (CURLSH) for cookie sharing
between handles lately, but I've stumbled across a deadlock, so I'm
wondering if this is a bug, or if I'm just using it incorrectly:

We flush the cookie list:
curl_easy_setopt(request, CURLOPT_COOKIELIST, "FLUSH");

When executing this, Curl_setopt() does a share_lock on the cookie
data (
Then it calls Curl_flush_cookies(), and that does another share_lock
on the cookie data
(, which
then makes pthreads fall over.

Is this intentional, i.e. are the lock function given to the share
handle required to be recursive? The documentation I've found don't
seem to say so, but I may not have looked in the right places.

(Granted, the FLUSH option seems to be a NOP when using the share
object instead of a cookie file, so the quick solution for us is to
just remove the call.)

List admin:
Received on 2014-02-19