git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* status hangs trying to get submodule summary
@ 2015-03-22  5:56 Wincent Colaiuta
  2015-03-22  7:44 ` [PATCH] status: read submodule process output before calling wait() Jeff King
  0 siblings, 1 reply; 26+ messages in thread
From: Wincent Colaiuta @ 2015-03-22  5:56 UTC (permalink / raw)
  To: git

Hi,

I just ran into some odd behavior trying to update a submodule in one
of my projects where it would hang indefinitely trying to run either
`git status` or `git commit`.

Here's the minimal repro recipe:

mkdir demo
cd demo
git init
git submodule add git://github.com/ansible/ansible.git ansible
(cd ansible && git checkout v1.6.10)
git add ansible
git commit -m "initial commit"
(cd ansible && git checkout v1.8.4)
git config status.submodulesummary true
git status # hangs...
git commit # hangs...

At the time `git status` is hanging, these are the Git processes
running on the system:

12431 git status
12462 git submodule summary --files --for-status --summary-limit -1
12463 /bin/sh /usr/libexec/git-core/git-submodule summary --files
--for-status --summary-limit -1
12507 /bin/sh /usr/libexec/git-core/git-submodule summary --files
--for-status --summary-limit -1
12522 git log --pretty=format:  %m %s --first-parent
8959338284f6c6e44890b8911434285848f34859...ebc8d48d34296fe010096f044e2b7591df37a622

And `strace` shows the processes `wait4`-ing, except for the `git log`
one which is doing a `write` but apparently blocked:

# strace -p 12431
Process 12431 attached
wait4(12462, ^CProcess 12431 detached
 <detached ...>
# strace -p 12462
Process 12462 attached
wait4(12463, ^CProcess 12462 detached
 <detached ...>
# strace -p 12463
Process 12463 attached
wait4(-1, ^CProcess 12463 detached
 <detached ...>
# strace -p 12507
Process 12507 attached
wait4(-1, ^CProcess 12507 detached
 <detached ...>
# strace -p 12522
Process 12522 attached
write(1, "\n  > Merge pull request #7814 fr"..., 108^CProcess 12522 detached
 <detached ...>

This repros for me on Mac OS X 10.10.2 with Git 1.9.5 and Git 2.3.3,
and on the Amazon LInux (a RHEL-like OS) with Git 2.1.0. Both of these
with an empty .gitconfig (other than user.email, user.name and the
status.submodulesummary value already mentioned above).

I've never seen this hang before despite frequent use of submodules.
Oddly, I was able to work around the hang by moving the submodule in
two hops (one from Ansible v1.6.10 to v1.7.0, then from v1.7.0 to
v1.8.4). I am not sure if this is specific to the Ansible repo, or
whether the length of the summary is crossing some threshold that
triggers the bug to manifest. If I run the forked commands manually
from an interactive shell, they complete just fine.

-Greg

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2015-03-23  4:40 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-22  5:56 status hangs trying to get submodule summary Wincent Colaiuta
2015-03-22  7:44 ` [PATCH] status: read submodule process output before calling wait() Jeff King
2015-03-22  8:07   ` Jeff King
2015-03-22  9:59   ` [PATCH 0/7] introduce strbuf_read_cmd to avoid deadlocks Jeff King
2015-03-22 10:00     ` [PATCH 1/7] wt-status: don't flush before running "submodule status" Jeff King
2015-03-22 10:00     ` [PATCH 2/7] wt_status: fix signedness mismatch in strbuf_read call Jeff King
2015-03-22 10:07     ` [PATCH 3/7] strbuf: introduce strbuf_read_cmd helper Jeff King
2015-03-22 19:36       ` Eric Sunshine
2015-03-22 22:54         ` Junio C Hamano
2015-03-22 23:40           ` Junio C Hamano
2015-03-23  3:53             ` [PATCH v2 0/7] introduce capture_command to avoid deadlocks Jeff King
2015-03-23  3:53               ` [PATCH v2 1/7] wt-status: don't flush before running "submodule status" Jeff King
2015-03-23  3:53               ` [PATCH v2 2/7] wt_status: fix signedness mismatch in strbuf_read call Jeff King
2015-03-23  3:53               ` [PATCH v2 3/7] run-command: introduce capture_command helper Jeff King
2015-03-23  3:53               ` [PATCH v2 4/7] wt-status: use capture_command Jeff King
2015-03-23  3:53               ` [PATCH v2 5/7] submodule: " Jeff King
2015-03-23  3:54               ` [PATCH v2 6/7] trailer: " Jeff King
2015-03-23  3:54               ` [PATCH v2 7/7] run-command: forbid using run_command with piped output Jeff King
2015-03-23  4:40               ` [PATCH v2 0/7] introduce capture_command to avoid deadlocks Junio C Hamano
2015-03-22 23:34         ` [PATCH 3/7] strbuf: introduce strbuf_read_cmd helper Jeff King
2015-03-22 23:22       ` Junio C Hamano
2015-03-22 23:36         ` Jeff King
2015-03-22 10:08     ` [PATCH 4/7] wt-status: use strbuf_read_cmd Jeff King
2015-03-22 10:08     ` [PATCH 5/7] submodule: " Jeff King
2015-03-22 10:09     ` [PATCH 6/7] trailer: " Jeff King
2015-03-22 10:10     ` [PATCH 7/7] run-command: forbid using run_command with piped output Jeff King

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 NNTP newsgroup(s).