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

Re: [PATCH] sigchain: recover from concurrent double-pops of the same signal

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Oct 28, 2026, 16:39 UTC
Message-ID
<0806471f-957a-4f32-ac33-c00c25a46033@gmail.com>
In-Reply-To
<20261028144736.121433-1-hu2008yinxiang@163.com>
On 28/10/2026 14:47, ian4hu wrote:
> > If you prefer the thread-level fix, I am happy to build it: a
> git_pthread_create() wrapper that blocks SIGINT/SIGHUP/SIGTERM/
> SIGQUIT around pthread_create()
I think that is probably the safest solution (though it does not help for threads created external library code - I'm not sure if we have any instances of that). I'd be interested to hear what others think, so I'd wait a couple of days to see if anyone else comments before spending much time on it.
> - leaving SIGPIPE alone, since it is
> a synchronous signal and blocking it in workers turns deaths into
> EPIPE
Does it? I thought that happened when its disposition is set to SIG_IGN. Blocking a signal delays its delivery until it is unblocked, it does not ignore the signal.
> - plus a sigaction()-based chain that masks all signals while
> a handler runs.
When I wrote my last email I was thinking about blocking the signal that is being handled as sigaction() defers the signal that is being handled unless SA_NODEFER is passed. However, sigchain_push_common() sets the same handler for all the common signals so it is probably safer to block at least those as well as I'm not sure all our handlers are reentrant.
>  I would then drop this patch, or keep it as a
> separate last-resort series if you think the belt and braces are
> worth it.
I'd be inclined to drop it - if we're handling signals in a single thread that should avoid the issue.
Thanks
Phillip
Previous: ian4huNext: Phillip Wood
Message 5 of 6 in “sigchain: recover from concurrent double-pops of the same signal”
  1. sigchain: recover from concurrent double-pops of the same signalIan Hu via GitGitGadget, Oct 16, 2026
  2. ian4huOct 28, 2026
  3. Phillip WoodOct 28, 2026
  4. ian4huOct 28, 2026
  5. Phillip WoodOct 28, 2026
  6. Phillip WoodOct 29, 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.