Either recent curl or gnutls doesn't like initializing again after cleaning up, and this is happening in some cases such as git fetch. We work around this by removing the http_cleanup call from get_refs_via_curl, and allowing http_init to be called several times without initializing http.c global variables again and leaking old values. The remaining calls to http_cleanup are either last (http-push.c), or almost never called (walker.c; the function it lies in is only called from transport-disconnect, which is called last, and only in builtin-push.c). These leaks shall be addressed in the http code refactoring. Signed-off-by: Mike Hommey <mh@xxxxxxxxxxxx> --- > So, it looks like either gnutls has a problem reinitializing its ASN1 > parser or curl is doing something wrong with gnutls when initializing a > new request. In the end, it was a bit of git's fault, but either curl or gnutls is the actual culprit. I've not looked into either code to find out who's responsible, but a very simplified testcase is as follows: #include <curl/curl.h> #include <curl/easy.h> int main(void) { CURL *easy = curl_easy_init(); curl_easy_setopt(easy, CURLOPT_VERBOSE, 1); curl_easy_setopt(easy, CURLOPT_URL, "https://www.verisign.com/"); curl_easy_perform(easy); curl_global_cleanup(); easy = curl_easy_init(); curl_easy_setopt(easy, CURLOPT_VERBOSE, 1); curl_easy_setopt(easy, CURLOPT_URL, "https://www.verisign.com/"); curl_easy_perform(easy); } (build with gcc -o test test.c -lcurl) (note curl_easy_init does curl_global_init behind the curtains, even the second time. You can convince yourself by adding curl_global_init(CURL_GLOBAL_ALL);) http.c | 5 +++++ transport.c | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/http.c b/http.c index d2c11ae..a3aa9e9 100644 --- a/http.c +++ b/http.c @@ -215,9 +215,14 @@ static CURL* get_curl_handle(void) void http_init(void) { + static int init = 0; char *low_speed_limit; char *low_speed_time; + if (init) + return; + init = 1; + curl_global_init(CURL_GLOBAL_ALL); pragma_header = curl_slist_append(pragma_header, "Pragma: no-cache"); diff --git a/transport.c b/transport.c index babaa21..1eb6d78 100644 --- a/transport.c +++ b/transport.c @@ -473,8 +473,6 @@ static struct ref *get_refs_via_curl(struct transport *transport) return NULL; } - http_cleanup(); - data = buffer.buf; start = NULL; mid = data; -- 1.5.4.7.gd8534-dirty - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html