git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Kevin Burke <kevin@meter.com>
To: git@vger.kernel.org
Subject: Crash when using libcurl with new hyper + rustls backend
Date: Tue, 23 Feb 2021 13:12:18 -0800	[thread overview]
Message-ID: <CAAJ6v9AruZ3HfqB1x6CKBM=JgFj8bNwjQFUO4rzv2s=yeXfcDw@mail.gmail.com> (raw)

Hi,
Curl added a new TLS backend that is written in Rust recently. If you
are using Mac, you can install it by running "brew install --HEAD
meterup/safe/curl", or view the specific compilation flags I passed to
curl, here: https://github.com/meterup/homebrew-safe/blob/main/Formula/curl.rb

If you are on Linux, you can use these instructions to build libcurl
with rustls: https://github.com/abetterinternet/crustls/wiki/Building-curl-with-crustls-and-Hyper

When I compile Git using this curl, I get a segfault when running "git
fetch https://go.googlesource.com/tools"

* thread #1, queue = 'com.apple.main-thread', stop reason =
EXC_BAD_ACCESS (code=1, address=0x8)
  * frame #0: 0x00000001000e2b58 git-remote-https`strbuf_grow + 16
    frame #1: 0x00000001000e3020 git-remote-https`strbuf_add + 27
    frame #2: 0x00000001000076d5 git-remote-https`fwrite_buffer + 27
    frame #3: 0x00000001002ebfba libcurl.4.dylib`Curl_hyper_stream + 594
    frame #4: 0x000000010032fdf8 libcurl.4.dylib`Curl_readwrite + 203
    frame #5: 0x0000000100319a80 libcurl.4.dylib`multi_runsingle + 2113
    frame #6: 0x00000001003191c6 libcurl.4.dylib`curl_multi_perform + 113
    frame #7: 0x00000001000094cb git-remote-https`step_active_slots + 25
    frame #8: 0x0000000100009532 git-remote-https`run_active_slot + 67
    frame #9: 0x00000001000097fd git-remote-https`run_one_slot + 41
    frame #10: 0x000000010000bb06 git-remote-https`http_request + 1630
    frame #11: 0x00000001000099b7 git-remote-https`http_request_reauth + 34
    frame #12: 0x0000000100006131 git-remote-https`discover_refs + 625
    frame #13: 0x00000001000053fc git-remote-https`cmd_main + 4484
    frame #14: 0x000000010000ce55 git-remote-https`main + 130
    frame #15: 0x00007fff699fbcc9 libdyld.dylib`start + 1
    frame #16: 0x00007fff699fbcc9 libdyld.dylib`start + 1


I had previously reported this issue to curl here, which includes a
number of useful pieces of information including the contents of each
register at the time of the crash.
https://github.com/curl/curl/issues/6619

The latest comment on that issue suggests git may not be setting curl
flags appropriately, which is why I am raising an issue here. I'm not
great at C programming and have not been able to sort out what's going
on myself, unfortunately.

Here's some more information about my git installation:

[System Info]
git version:
git version 2.30.1
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05
PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64
compiler info: clang: 12.0.0 (clang-1200.0.32.28)
libc info: no libc information available
$SHELL (typically, interactive shell): /usr/local/bin/zsh

Hope this helps,
Kevin

             reply	other threads:[~2021-02-23 21:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23 21:12 Kevin Burke [this message]
2021-02-23 22:08 ` Crash when using libcurl with new hyper + rustls backend Daniel Stenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAJ6v9AruZ3HfqB1x6CKBM=JgFj8bNwjQFUO4rzv2s=yeXfcDw@mail.gmail.com' \
    --to=kevin@meter.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).