From: ian4hu <hu2008yinxiang@163.com>
To: git@vger.kernel.org
Cc: ian4hu <hu2008yinxiang@163.com>,
Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>
Subject: Re: [PATCH] sigchain: recover from concurrent double-pops of the same signal
Date: Wed, 28 Oct 2026 21:37:54 +0800 [thread overview]
Message-ID: <20261028133755.112476-1-hu2008yinxiang@163.com> (raw)
In-Reply-To: <pull.2263.git.1792154272296.gitgitgadget@gmail.com>
Hi,
Gentle ping on this one. It is queued in 'seen' as
iy/sigchain-recover-concurrent-pops, and the latest "What's cooking"
marks it as "Needs review".
A short recap: when two copies of the same signal reach two threads
nearly at the same time, the concurrent sigchain_pop() calls in the
handlers can unwind the chain by two levels instead of one, leaving
the process spinning in a handler that keeps re-raising the signal.
This is reachable with "git clone --depth 1" over ssh receiving two
SIGTERMs in quick succession, and only SIGKILL gets rid of the
process.
The patch leaves the push/pop fast path alone and only teaches the
"n < 1" guard in sigchain_pop() to fall back to the pre-chain
disposition, so the stuck handler's raise() terminates the process
just as a single delivery would.
Peff, I have Cc'ed you since you wrote the sigchain code. I would
appreciate your thoughts on whether this "repair after the fact"
approach is acceptable, or whether you would rather see the chain
mutation serialized instead. I also have a version that uses a
per-signal spinlock around push/pop, and can send it if that is
preferred.
Thanks,
ian4hu
next prev parent reply other threads:[~2026-10-28 13:38 UTC|newest]
Thread overview: 9+ 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 [this message]
2026-10-28 14:29 ` Phillip Wood
2026-10-28 14:47 ` ian4hu
2026-10-28 16:39 ` Phillip Wood
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
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=20261028133755.112476-1-hu2008yinxiang@163.com \
--to=hu2008yinxiang@163.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox