Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 930633 - dev-vcs/git: indefinite hang during 'git clone' (net-misc/curl issue?)
Summary: dev-vcs/git: indefinite hang during 'git clone' (net-misc/curl issue?)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on: 930702
Blocks:
  Show dependency tree
 
Reported: 2024-04-24 17:04 UTC by Hank Leininger
Modified: 2024-04-26 21:24 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
backtrace of hung git-clone on endeavouros (git_curl_backtrace_endeavouros,24.39 KB, text/plain)
2024-04-24 17:04 UTC, Hank Leininger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hank Leininger 2024-04-24 17:04:14 UTC
Created attachment 891663 [details]
backtrace of hung git-clone on endeavouros

This is very likely an upstream curl bug.

git clone --origin=origin --mirror https://git.rockbox.org/cgit/rockbox.git rockbox

^^^ this hangs indefinitely using:

dev-vcs/git-2.44.0::gentoo was built with the following:
USE="blksha1 curl gpg iconv nls pcre perl safe-directory subversion webdav"

net-misc/curl-8.7.1-r1::gentoo was built with the following:
USE="adns alt-svc ftp hsts http2 imap openssl pop3 progress-meter psl smtp ssl tftp verify-sig" ... CURL_SSL="openssl"

git clone runs git remote-https which runs git-remote-https:

hlein    11570 11568  0 10:18 pts/445  00:00:00             bash
hlein    20236 11570  0 10:56 pts/445  00:00:00               git clone --origin=origin --mirror https://git.rockbox.org/cgit/rockbox.git rockbox
hlein    20252 20236  0 10:56 pts/445  00:00:00                 /usr/libexec/git-core/git remote-https origin https://git.rockbox.org/cgit/rockbox.git
hlein    20253 20252 99 10:56 pts/445  00:01:28                   /usr/libexec/git-core/git-remote-https origin https://git.rockbox.org/cgit/rockbox.git

strace -p 20253 shows nothing (stuck in userland)

Running with tracing on:

$ GIT_TRACE_CURL=1 git clone --origin=origin --mirror https://git.rockbox.org/cgit/rockbox.git rockbox

...it seems to often stall right after reaching the end of a page/response:

10:56:30.789725 http.c:831              <= Recv data: /a> (<a href='https://git-scm.com/'>git 2.34.1</a>) at 2024-
10:56:30.789727 http.c:831              <= Recv data: 04-24 16:56:31 +0000</div>.</div> <!-- id=cgit -->.</body>.<
10:56:30.789729 http.c:831              <= Recv data: /html>.
10:56:30.789733 http.c:816              <= Recv SSL data, 0000000005 bytes (0x00000005)
10:56:30.789735 http.c:831              <= Recv SSL data: .....
10:56:30.789740 http.c:816              <= Recv SSL data, 0000000001 bytes (0x00000001)
10:56:30.789742 http.c:831              <= Recv SSL data: .
10:56:30.789746 http.c:816              <= Recv data, 0000000000 bytes (0x00000000)
10:56:30.789751 http.c:843              == Info: Connection #2 to host git.rockbox.org left intact


I don't have symbol resolution working on this box, but will attach a backtrace from an endeavouros box with git-2.44.0-1 and curl-8.7.1-5 (like I said, likely an upstream bug :)
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-04-24 17:08:23 UTC
I can reproduce, bisecting...

curl-9999 works.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-04-24 18:13:56 UTC
https://github.com/curl/curl/commit/5c59f91427c6e14036070d4e1426360393458b25 seems to be the fix from bisect but it doesn't apply cleanly, and the patches which are needed for it are also huge...
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-04-24 18:14:58 UTC
(In reply to Sam James from comment #2)
> https://github.com/curl/curl/commit/5c59f91427c6e14036070d4e1426360393458b25
> seems to be the fix from bisect but it doesn't apply cleanly, and the
> patches which are needed for it are also huge...

I wonder if I'm wrong though, given it seems to focus on error handling?
Comment 4 Larry the Git Cow gentoo-dev 2024-04-26 13:37:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e15b31fe250cf83eda813789cfc371a22dfb50f

commit 9e15b31fe250cf83eda813789cfc371a22dfb50f
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-04-26 13:35:58 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-04-26 13:36:55 +0000

    net-misc/curl: backport fix for hanging git clone over HTTP2
    
    Thank you to Stefan for giving us a bespoke backport, as the original
    fix didn't apply cleanly to 8.7.1.
    
    Bug: https://github.com/curl/curl/issues/13474
    Closes: https://bugs.gentoo.org/930633
    Thanks-to: Stefan Eissing <stefan@eissing.org>
    Signed-off-by: Sam James <sam@gentoo.org>

 net-misc/curl/curl-8.7.1-r4.ebuild                 | 369 +++++++++++++++++++++
 .../curl/files/curl-8.7.1-http2-git-clone.patch    | 342 +++++++++++++++++++
 2 files changed, 711 insertions(+)