Bug 1204191
| Summary: | infinite loop in "git ls-tree" for broken symlink under refs/heads | |||
|---|---|---|---|---|
| Product: | Red Hat Software Collections | Reporter: | Frank Ch. Eigler <fche> | |
| Component: | git | Assignee: | Petr Stodulka <pstodulk> | |
| Status: | CLOSED ERRATA | QA Contact: | Leos Pol <lpol> | |
| Severity: | high | Docs Contact: | ||
| Priority: | urgent | |||
| Version: | rh-git29 | CC: | hhorak, jorton, kanderso, lpol, mbenitez, mkyral | |
| Target Milestone: | rc | |||
| Target Release: | 2.3 | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | rh-git29-git-2.9.3-2.el6 rh-git29-git-2.9.3-2.el7 | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1204193 (view as bug list) | Environment: | ||
| Last Closed: | 2016-11-15 10:04:16 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1204193, 1414792 | |||
correction: -> % strace git --git-dir=`pwd`.git ls-tree bar % strace git --git-dir=`pwd`/.git ls-tree bar or just git ls-tree bar I'm still able to replicate the issue with the latest build: # rpm -q rh-git29-git rh-git29-git-2.9.3-1.el7.x86_64 # cd /tmp # git init testrepo Initialized empty Git repository in /tmp/testrepo/.git/ # cd testrepo # mkdir -p .git/refs/remotes # ln -s ../remotes/foo .git/refs/heads/bar # timeout 10 git ls-tree bar # echo $? 124 Thanks for catch. Now it is fixed. Issue wasn't fixed maybe by mistake in upstream. I don't know why fix wasn't applied previously. So it is discussed in upstream now. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHEA-2016-2728.html |
A git19-git installation (being invoked via gitweb) goes into an infinite loop while serving pretty vanilla requests, if the refs/heads/ directory contains a symlink that's broken. Reproduction recipe: % git init % mkdir .git/refs/remotes % ln -s ../remotes/foo .git/refs/heads/bar % strace git --git-dir=`pwd`.git ls-tree bar [...] open("/sourceware1/home/fche/tmp2/.git/refs/heads/bar", O_RDONLY) = -1 ENOENT (No such file or directory) lstat("/sourceware1/home/fche/tmp2/.git/refs/heads/bar", {st_mode=S_IFLNK|0777, st_size=14, ...}) = 0 readlink("/sourceware1/home/fche/tmp2/.git/refs/heads/bar", "../remotes/foo", 255) = 14 open("/sourceware1/home/fche/tmp2/.git/refs/heads/bar", O_RDONLY) = -1 ENOENT (No such file or directory) lstat("/sourceware1/home/fche/tmp2/.git/refs/heads/bar", {st_mode=S_IFLNK|0777, st_size=14, ...}) = 0 readlink("/sourceware1/home/fche/tmp2/.git/refs/heads/bar", "../remotes/foo", 255) = 14 [...endlessly looping...] When gdb is sicced at it, the loop appears to be around line 1360..1401 of refs.c.