{"thread":{"id":"55196","subject":"Crash when using libcurl with new hyper + rustls backend","startedAt":"2021-02-23T21:16:02Z","lastAt":"2021-02-23T22:19:42Z","messageCount":2,"participants":["Kevin Burke","Daniel Stenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"417622","messageId":"CAAJ6v9AruZ3HfqB1x6CKBM=JgFj8bNwjQFUO4rzv2s=yeXfcDw@mail.gmail.com","threadId":"55196","inReplyTo":null,"subject":"Crash when using libcurl with new hyper + rustls backend","fromName":"Kevin Burke","fromEmail":"kevin@meter.com","sentAt":"2021-02-23T21:12:18Z","receivedAt":"2021-02-23T21:16:02Z","isPatch":false,"sender":{"key":"kevin@meter.com","avatar":null},"body":"Hi,\nCurl added a new TLS backend that is written in Rust recently. If you\nare using Mac, you can install it by running \"brew install --HEAD\nmeterup/safe/curl\", or view the specific compilation flags I passed to\ncurl, here: https://github.com/meterup/homebrew-safe/blob/main/Formula/curl.rb\n\nIf you are on Linux, you can use these instructions to build libcurl\nwith rustls: https://github.com/abetterinternet/crustls/wiki/Building-curl-with-crustls-and-Hyper\n\nWhen I compile Git using this curl, I get a segfault when running \"git\nfetch https://go.googlesource.com/tools\"\n\n* thread #1, queue = 'com.apple.main-thread', stop reason =\nEXC_BAD_ACCESS (code=1, address=0x8)\n  * frame #0: 0x00000001000e2b58 git-remote-https`strbuf_grow + 16\n    frame #1: 0x00000001000e3020 git-remote-https`strbuf_add + 27\n    frame #2: 0x00000001000076d5 git-remote-https`fwrite_buffer + 27\n    frame #3: 0x00000001002ebfba libcurl.4.dylib`Curl_hyper_stream + 594\n    frame #4: 0x000000010032fdf8 libcurl.4.dylib`Curl_readwrite + 203\n    frame #5: 0x0000000100319a80 libcurl.4.dylib`multi_runsingle + 2113\n    frame #6: 0x00000001003191c6 libcurl.4.dylib`curl_multi_perform + 113\n    frame #7: 0x00000001000094cb git-remote-https`step_active_slots + 25\n    frame #8: 0x0000000100009532 git-remote-https`run_active_slot + 67\n    frame #9: 0x00000001000097fd git-remote-https`run_one_slot + 41\n    frame #10: 0x000000010000bb06 git-remote-https`http_request + 1630\n    frame #11: 0x00000001000099b7 git-remote-https`http_request_reauth + 34\n    frame #12: 0x0000000100006131 git-remote-https`discover_refs + 625\n    frame #13: 0x00000001000053fc git-remote-https`cmd_main + 4484\n    frame #14: 0x000000010000ce55 git-remote-https`main + 130\n    frame #15: 0x00007fff699fbcc9 libdyld.dylib`start + 1\n    frame #16: 0x00007fff699fbcc9 libdyld.dylib`start + 1\n\n\nI had previously reported this issue to curl here, which includes a\nnumber of useful pieces of information including the contents of each\nregister at the time of the crash.\nhttps://github.com/curl/curl/issues/6619\n\nThe latest comment on that issue suggests git may not be setting curl\nflags appropriately, which is why I am raising an issue here. I'm not\ngreat at C programming and have not been able to sort out what's going\non myself, unfortunately.\n\nHere's some more information about my git installation:\n\n[System Info]\ngit version:\ngit version 2.30.1\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05\nPST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64\ncompiler info: clang: 12.0.0 (clang-1200.0.32.28)\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /usr/local/bin/zsh\n\nHope this helps,\nKevin\n"},{"id":"417627","messageId":"nycvar.QRO.7.76.2102232301550.23358@fvyyl","threadId":"55196","inReplyTo":"CAAJ6v9AruZ3HfqB1x6CKBM=JgFj8bNwjQFUO4rzv2s=yeXfcDw@mail.gmail.com","subject":"Re: Crash when using libcurl with new hyper + rustls backend","fromName":"Daniel Stenberg","fromEmail":"daniel@haxx.se","sentAt":"2021-02-23T22:08:43Z","receivedAt":"2021-02-23T22:19:42Z","isPatch":false,"sender":{"key":"daniel@haxx.se","avatar":"https://gravatar.com/avatar/69fdca87edd17cee21ca2e79fc2ff671d644603c3dc27167430f3cd3dbab7ba8?d=mp&s=160"},"body":"On Tue, 23 Feb 2021, Kevin Burke wrote:\n\n> When I compile Git using this curl, I get a segfault when running \"git\n> fetch https://go.googlesource.com/tools\"\n\nThe hyper backend in curl is still considered experimental and it doesn't even \npass all curl's own tests yet. Before it does that, I'm not sure it is \nconstructive to bring problems to libcurl users like git since if the problems \ncan't be produced with the built-in libcurl HTTP code, they seem likely to \nrather be libcurl internal problems.\n\n-- \n\n  / daniel.haxx.se\n"}]}