All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: ian4hu <hu2008yinxiang@163.com>
Cc: git@vger.kernel.org, gitster@pobox.com, peff@peff.net,
	phillip.wood@dunelm.org.uk
Subject: Re: [PATCH] sigchain: recover from concurrent double-pops of the same signal
Date: Wed, 28 Oct 2026 16:39:37 +0000	[thread overview]
Message-ID: <0806471f-957a-4f32-ac33-c00c25a46033@gmail.com> (raw)
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

  reply	other threads:[~2026-10-28 16:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 12:37 [PATCH] sigchain: recover from concurrent double-pops of the same signal Ian Hu via GitGitGadget
2026-10-28 13:37 ` ian4hu
2026-10-28 14:29   ` Phillip Wood
2026-10-28 14:47     ` ian4hu
2026-10-28 16:39       ` Phillip Wood [this message]
2026-10-29 11:15         ` Phillip Wood
  -- strict thread matches above, loose matches on Subject: below --
2026-10-29 14:13 ian4hu
2026-10-29 14:15 ian4hu
2026-10-29 16:03 ` Phillip Wood
2026-10-30  8:45   ` Oswald Buddenhagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0806471f-957a-4f32-ac33-c00c25a46033@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hu2008yinxiang@163.com \
    --cc=peff@peff.net \
    --cc=phillip.wood@dunelm.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.