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
Iian4hu <hu2008yinxiang@163.com>
Date
Oct 28, 2026, 13:37 UTC
Message-ID
<20261028133755.112476-1-hu2008yinxiang@163.com>
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

Previous: Ian Hu via GitGitGadgetNext: Phillip Wood
Message 2 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.