{"thread":{"id":"6215","subject":"git completely non-operational w/ curl 7.16.0","startedAt":"2007-01-04T02:31:51Z","lastAt":"2007-01-04T06:45:54Z","messageCount":2,"participants":["felix-git@fefe.de","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"30788","messageId":"20070104023150.GA31151@codeblau.de","threadId":"6215","inReplyTo":null,"subject":"git completely non-operational w/ curl 7.16.0","fromName":"","fromEmail":"felix-git@fefe.de","sentAt":"2007-01-04T02:31:51Z","receivedAt":"2007-01-04T02:31:51Z","isPatch":false,"sender":{"key":"felix-git@fefe.de","avatar":null},"body":"I'm using git 1.4.4.3 on x86_64-linux with curl 7.16.0, glibc 2.5, gcc\n4.1.1 and binutils 2.17.  All of these are as far as I know the current\nrelease versions.\n\nNow, when I try to clone the elinks git repository, this happens:\n\n  $ cg clone http://elinks.cz/elinks.git\n  defaulting to local storage area\n  Fetching head...\n  Fetching objects...\n  *** glibc detected *** git-http-fetch: double free or corruption (fasttop): 0x0000000000552390 ***\n  ======= Backtrace: =========\n  /lib64/libc.so.6[0x2ae65f64f45e]\n  /lib64/libc.so.6(__libc_free+0xae)[0x2ae65f650784]\n  git-http-fetch[0x4041bd]\n  git-http-fetch[0x404f80]\n  git-http-fetch[0x403027]\n  git-http-fetch[0x404454]\n  /lib64/libc.so.6(__libc_start_main+0x14b)[0x2ae65f60e6cb]\n  git-http-fetch[0x4029c9]\n  ======= Memory map: ========\n  00400000-0041e000 r-xp 00000000 00:0d 772197                             /tmp/fefix/usr/bin/git-http-fetch\n  0051d000-0051f000 rw-p 0001d000 00:0d 772197                             /tmp/fefix/usr/bin/git-http-fetch\n  0051f000-0056e000 rw-p 0051f000 00:00 0                                  [heap]\n  2ae65eeed000-2ae65ef05000 r-xp 00000000 08:03 12554262                   /lib64/ld-2.5.so\n  2ae65ef05000-2ae65ef06000 rw-p 2ae65ef05000 00:00 0 \n  2ae65ef12000-2ae65ef13000 rw-p 2ae65ef12000 00:00 0 \n  2ae65f004000-2ae65f006000 rw-p 00017000 08:03 12554262                   /lib64/ld-2.5.so\n  2ae65f006000-2ae65f01c000 r-xp 00000000 08:03 14996111                   /usr/lib64/libz.so.1.2.3\n  2ae65f01c000-2ae65f11b000 ---p 00016000 08:03 14996111                   /usr/lib64/libz.so.1.2.3\n  2ae65f11b000-2ae65f11c000 rw-p 00015000 08:03 14996111                   /usr/lib64/libz.so.1.2.3\n  2ae65f11c000-2ae65f26c000 r-xp 00000000 08:03 14996178                   /usr/lib64/libcrypto.so.0.9.8\n  2ae65f26c000-2ae65f36c000 ---p 00150000 08:03 14996178                   /usr/lib64/libcrypto.so.0.9.8\n  2ae65f36c000-2ae65f38f000 rw-p 00150000 08:03 14996178                   /usr/lib64/libcrypto.so.0.9.8\n  2ae65f38f000-2ae65f392000 rw-p 2ae65f38f000 00:00 0 \n  2ae65f392000-2ae65f3cd000 r-xp 00000000 08:03 10667012                   /usr/lib64/libcurl.so.4.0.0\n  2ae65f3cd000-2ae65f4cc000 ---p 0003b000 08:03 10667012                   /usr/lib64/libcurl.so.4.0.0\n  2ae65f4cc000-2ae65f4ce000 rw-p 0003a000 08:03 10667012                   /usr/lib64/libcurl.so.4.0.0\n  2ae65f4ce000-2ae65f4cf000 rw-p 2ae65f4ce000 00:00 0 \n  2ae65f4cf000-2ae65f4ef000 r-xp 00000000 08:03 10667121                   /usr/lib64/libexpat.so.0.5.0\n  2ae65f4ef000-2ae65f5ef000 ---p 00020000 08:03 10667121                   /usr/lib64/libexpat.so.0.5.0\n  2ae65f5ef000-2ae65f5f1000 rw-p 00020000 08:03 10667121                   /usr/lib64/libexpat.so.0.5.0\n  2ae65f5f1000-2ae65f6fe000 r-xp 00000000 08:03 12554263                   /lib64/libc-2.5.so\n  2ae65f6fe000-2ae65f7fe000 ---p 0010d000 08:03 12554263                   /lib64/libc-2.5.so\n  2ae65f7fe000-2ae65f801000 r--p 0010d000 08:03 12554263                   /lib64/libc-2.5.so\n  2ae65f801000-2ae65f803000 rw-p 00110000 08:03 12554263                   /lib64/libc-2.5.so\n  2ae65f803000-2ae65f808000 rw-p 2ae65f803000 00:00 0 \n  2ae65f808000-2ae65f80a000 r-xp 00000000 08:03 12554244                   /lib64/libdl-2.5.so\n  2ae65f80a000-2ae65f90a000 ---p 00002000 08:03 12554244                   /lib64/libdl-2.5.so\n  2ae65f90a000-2ae65f90c000 rw-p 00002000 08:03 12554244                   /lib64/libdl-2.5.so\n  2ae65f90c000-2ae65f90d000 rw-p 2ae65f90c000 00:00 0 \n  2ae65f90d000-2ae65f94e000 r-xp 00000000 08:03 14996177                   /usr/lib64/libssl.so.0.9.8\n  2ae65f94e000-2ae65fa4e000 ---p 00041000 08:03 14996177                   /usr/lib64/libssl.so.0.9.8\n  2ae65fa4e000-2ae65fa54000 rw-p 00041000 08:03 14996177                   /usr/lib64/libssl.so.0.9.8\n  2ae65fa54000-2ae65fa55000 rw-p 2ae65fa54000 00:00 0 \n  2ae65fa55000-2ae65fa5c000 r-xp 00000000 08:03 12554260                   /lib64/libnss_compat-2.5.so\n  2ae65fa5c000-2ae65fb5b000 ---p 00007000 08:03 12554260                   /lib64/libnss_compat-2.5.so\n  2ae65fb5b000-2ae65fb5d000 rw-p 00006000 08:03 12554260                   /lib64/libnss_compat-2.5.so\n  2ae65fb5d000-2ae65fb6e000 r-xp 00000000 08:03 12554257                   /lib64/libnsl-2.5.so\n  2ae65fb6e000-2ae65fc6d000 ---p 00011000 08:03 12554257                   /lib64/libnsl-2.5.so\n  2ae65fc6d000-2ae65fc6f000 rw-p 00010000 08:03 12554257                   /lib64/libnsl-2.5.so\n  2ae65fc6f000-2ae65fc71000 rw-p 2ae65fc6f000 00:00 0 \n  2ae65fc71000-2ae65fc7a000 r-xp 00000000 08:03 12554258                   /lib64/libnss_nis-2.5.so\n  2ae65fc7a000-2ae65fd79000 ---p 00009000 08:03 12554258                   /lib64/libnss_nis-2.5.so\n  2ae65fd79000-2ae65fd7b000 rw-p 00008000 08:03 12554258                   /lib64/libnss_nis-2.5.so\n  2ae65fd7b000-2ae65fd84000 r-xp 00000000 08:03 12554251                   /lib64/libnss_files-2.5.so\n  2ae65fd84000-2ae65fe83000 ---p 00009000 08:03 12554251                   /lib64/libnss_files-2.5.so\n  2ae65fe83000-2ae65fe85000 rw-p 00008000 08:03 12554251                   /lib64/libnss_files-2.5.so\n  2ae65fe85000-2ae65fe92000 r-xp 00000000 08:03 14995967                   /usr/lib64/libgcc_s.so.1\n  2ae65fe92000-2ae65ff91000 ---p 0000d000 08:03 14995967                   /usr/lib64/libgcc_s.so.1\n  2ae65ff91000-2ae65ff92000 rw-p 0000c000 08:03 14995967                   /usr/lib64/libgcc_s.so.1\n  2ae660000000-2ae660021000 rw-p 2ae660000000 00:00 0 \n  2ae660021000-2ae664000000 ---p 2ae660021000 00:00 0 \n  7fff4bba8000-7fff4bbbd000 rwxp 7fff4bba8000 00:00 0                      [stack]\n  ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0                  [vdso]\n  error: Request for 1e8f8aa4a60a9651e17347d36a880c35c7179391 aborted\n  progress: 0 objects, 0 bytes\n  cg-fetch: objects fetch failed\n\nAs you can see this is somewhat undesireable.  The double free is line\n316 in http-fetch.c:\n\n        free(obj_req->url);\n\nIf I fix this bug, git still utterly breaks.\n\n  $ cg clone http://elinks.cz/elinks.git\n  defaulting to local storage area\n  Fetching head...\n  Fetching objects...\n  error: Request for 1e8f8aa4a60a9651e17347d36a880c35c7179391 aborted\n  Getting pack list for http://elinks.cz/elinks.git/\n  error: Unable to start request\n  Getting alternates list for http://elinks.cz/elinks.git/\n  error: Unable to find 1e8f8aa4a60a9651e17347d36a880c35c7179391 under\n  http://elinks.cz/elinks.git/\n  Cannot obtain needed object 1e8f8aa4a60a9651e17347d36a880c35c7179391\n  progress: 0 objects, 0 bytes\n  cg-fetch: objects fetch failed\n  $\n\nNow, running the same git/cogito command line on my Gentoo box works,\nwhich only apparently differs in that it ships an older version of curl.\n\nWould someone please fix this?\n\nThanks,\n\nFelix\n"},{"id":"30800","messageId":"7vvejnmgrh.fsf@assigned-by-dhcp.cox.net","threadId":"6215","inReplyTo":"20070104023150.GA31151@codeblau.de","subject":"Re: git completely non-operational w/ curl 7.16.0","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-04T06:45:54Z","receivedAt":"2007-01-04T06:45:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"felix-git@fefe.de writes:\n\n> I'm using git 1.4.4.3 on x86_64-linux with curl 7.16.0, glibc 2.5, gcc\n> 4.1.1 and binutils 2.17.  All of these are as far as I know the current\n> release versions.\n\nThis may be related to a bug in cURL 7.16.0, which is reported\nto be fixed in their current CVS version:\n\n\thttp://curl.haxx.se/mail/archive-2006-12/0085.html\n\nIn the meantime, we have a workaround for this particular\nproblem the above URL mentions since last week.\n\nPlease try \"master\" (or anything later than v1.5.0-rc0) to see\nif it still breaks for you.\n\nThe fix also should apply cleanly on top of 1.4.4.3.\n\n-- >8 --\n[PATCH] Work around http-fetch built with cURL 7.16.0\n\nIt appears that curl_easy_duphandle() from libcurl 7.16.0\nreturns a curl session handle which fails GOOD_MULTI_HANDLE()\ncheck in curl_multi_add_handle().  This causes fetch_ref() to\nfail because start_active_slot() cannot start the request.\n\nFor now, check for 7.16.0 to work this issue around.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\ndiff --git a/http.h b/http.h\nindex 6e12e41..324fcf4 100644\n--- a/http.h\n+++ b/http.h\n@@ -18,7 +18,7 @@\n #define curl_global_init(a) do { /* nothing */ } while(0)\n #endif\n \n-#if LIBCURL_VERSION_NUM < 0x070c04\n+#if (LIBCURL_VERSION_NUM < 0x070c04) || (LIBCURL_VERSION_NUM == 0x071000)\n #define NO_CURL_EASY_DUPHANDLE\n #endif\n \n"}]}