git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] run_processes_parallel(): fix order of sigpipe handling

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 8, 2026, 20:54 UTC
Message-ID
<xmqqmrzdxjel.fsf@gitster.g>
In-Reply-To
<xmqqcy09z62e.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 6 quoted lines
>> Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
>> Signed-off-by: Jeff King <peff@peff.net>
>
> Thanks, all of you, for addressing the issue so quickly.
>
> Applied.

We have a few places where we sigchain_push(SIGPIPE, SIG_IGN) then run start_command(). One is in upload-pack.c where we spawn "rev-list" for reachability check, and the other is in fetch-pack.c where we spawn unpack-objects/index-pack.

Currently neither subprocess is marked with the clean-on-exit bit. but if somebody is careless and flips the bit for these subprocesses, start_command() will call mark_child_for_cleanup() and causes sigchain_push_common() to set up cleanup_children_on_signal() to be called, which would lead to a very similar bug.

I wonder if swapping the order of start_command() and sigchain_push() in these two code paths have downsides, or is it making the code worse just to futureproof it against a future that is unlikely to come?

Previous: Junio C HamanoNext: Jeff King
Message 16 of 18 in “Help needed on 2.54.0-rc0 t5301.13 looping.”
  1. rsbecker@nexbridge.comApr 7, 2026
  2. Jeff KingApr 8, 2026
  3. Jeff KingApr 8, 2026
  4. Adrian RatiuApr 8, 2026
  5. rsbecker@nexbridge.comApr 8, 2026
  6. rsbecker@nexbridge.comApr 8, 2026
  7. rsbecker@nexbridge.comApr 8, 2026
  8. Junio C HamanoApr 8, 2026
  9. rsbecker@nexbridge.comApr 8, 2026
  10. Adrian RatiuApr 8, 2026
  11. t5401: test SIGPIPE with parallel hooksJeff King, Apr 8, 2026
  12. Junio C HamanoApr 8, 2026
  13. Adrian RatiuApr 8, 2026
  14. run_processes_parallel(): fix order of sigpipe handlingJeff King, Apr 8, 2026
  15. Junio C HamanoApr 8, 2026
  16. Junio C HamanoApr 8, 2026
  17. Jeff KingApr 8, 2026
  18. Junio C HamanoApr 9, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.