cURL / Mailing Lists / curl-library / Single Mail


Re: Fix deadlock patch in "FLUSH" cookie and more

From: Daniel Stenberg <>
Date: Mon, 14 Jul 2014 20:39:42 +0200 (CEST)

On Sun, 13 Jul 2014, wrote:

> This issue was reported in
> Unfortunately the reporter didn't suggest his patch.
> This issue is caused by locking CURL_LOCK_DATA_COOKIE with specified cookie
> files. In this case, CURL_LOCK_DATA_COOKIE is locked before executing
> "FLUSH", and then Curl_cookie_loadfiles locks CURL_LOCK_DATA_COOKIE. That is
> deadlock.

Thanks for the patch. My reading of it says it is incorrect though:

  - for FLUSH you (still) take the lock before Curl_flush_cookies() is called
    and then within Curl_flush_cookies() it locks the same mutex again.

Shouldn't the patch then just have those lines removed, like this?
Received on 2014-07-14