🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #1729

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

#1729
From: ian4hu
Date: Wed, 28 Oct 2026 13:37
29 lines
9508 bytes
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
Technical Details
Message-ID: <20261028133755.112476-1-hu2008yinxiang@163.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-73648-linux-kernel-git=dewy.ru
References: <pull.2263.git.1792154272296.gitgitgadget@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-73648-linux-kernel-git=dewy.ru
From: hu2008yinxiang@163.com (ian4hu)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH] sigchain: recover from concurrent double-pops of the same signal
Date: Wed, 28 Oct 2026 21:37:54 +0800
Organization: Usenet Network
Message-ID: <20261028133755.112476-1-hu2008yinxiang@163.com>
References: <pull.2263.git.1792154272296.gitgitgadget@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1780153"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:dwL8Tor+M8M+xgmXlXj8NqjEW2M= sha256:FSWWt88AB9f2mLbIwaKvU7oJmWVFUbYPLERBQKkcIRA=
	sha1:mE1LIZFaUMp1BE5HpSnqPQhtwm4= sha256:u1NigH2YxybpCyulD41JZZ818vMBAEPihse8HZeCIQU=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id A23C9125C37; Wed, 28 Oct 2026 16:42:39 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.047
X-Spam-Status: No, score=-3.047 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=163.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 4wuTZr8Ad6of;
	Wed, 28 Oct 2026 16:42:31 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-73648-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=163.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 59897125C35; Wed, 28 Oct 2026 16:42:22 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id D01202BE2C; Wed, 28 Oct 2026 13:38:36 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail;
	t=1793194715;
	b=ozCYUR4afPDbzNz3VYK0iw01XAClaImg7O25xZe3+dT7/VJhPv42vKvg2nu4tqNGpzr6
	 hTsS1b8ycwGwzkKMeK3NPyCZ1O5BIT9KQFNxBj45OGUNRW8qk8hhItNkkOwrXDxpCGyFf
	 xQ+5zvXhG7id7lFhMf93uskNfrH0Y8NOKf/BXPRUWNlCK7Mb4Ksf6KDzaryJZPfQGp4JH
	 hv+677H+G5XI8vNf448axN2reVnOQY2l8EfnlmUGkrhy2kSXpT+d8dd5UQcR2UigTMUSY
	 d+NLOpykdS4UTKSt3XWJ8bJojKD/FvL9Z3WV56XPOZacVAEvu7hpb233Vj+3FmrN8hg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793194715;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To:
	 Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding:X-CM-TRANSID:X-Coremail-Antispam:
	 X-CM-SenderInfo;
	bh=EBW2Cqxuc828EJJqiEKCFcHud6D/8KT3HhClpO93lc4=;
	b=nJFQm+4mbX4l2pX4yCyNTGWdKo7kihiYcRBSihEgpygHyRV1M9M5mEvqciJJtJ7mLnhx
	 Xnj37m5WjqACIPu4JmU1WpEhV6T8jLQCuVd7zmOSDB6TmtaDOIyLKXzYMwpcbhQtqUyOA
	 5MZKMeyFszO+VgdGe4ZBohm4CQcGTg/kVl2Ui8eTZNH3sa1ZSzrDcG0nNY05oSKGVekI/
	 2IT+MnL/RVC3ElSOfJGCqKbNGlbE36UR6F7GC3tfPWPOwH4RezUYcPe5c3LHupcIY06l3
	 1gJcZ2JwlCOHraAMbxeKlNKftHxsgsngQ+p1wf7vA9DSAg/sll10rpXdQTfS2iViVVg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=NQneX6fH;
	dmarc=pass header.from=163.com;
	spf=pass smtp.mailfrom=163.com;
	arc=fail smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 498E0606A31F;
	Wed, 28 Oct 2026 13:38:35 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=NQneX6fH
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=117.135.210.5
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793194714;
	b=qtAp2E8XPoaeHXm4hDqjh/bNbZ4SKbpj73GejgDom/vHP9Pc457cVWCuaU7xtDFDyrIb
	 tuQStpEOTFXudFFCqc0HSD8+mRWPyKXNGz7CdwRSDf5HxxMhE0gh7W9XiS1qTe24ZLRl9
	 FgsUxtP7GnpZFRTqKQCHrPdJPTI5Cz1dvjP/qRs166f3zHlboEQdtiHrv4Nvy9Caw8ZJU
	 6wxMSa3yNk05JmJXMnx6bWSxdmNAlf1ShTpiRYcokqegcM9nDLQ9vCFMSbH6VmpgmLVBe
	 980+HwwZxT+KjMxWj6ltmttQtXGjFdY222duPfMsvF4UAXTmIt7ORJI7KJTLfA3AWUw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793194714;
	h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date:
	 Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding:X-CM-TRANSID:X-Coremail-Antispam:
	 X-Originating-IP:X-CM-SenderInfo;
	bh=EBW2Cqxuc828EJJqiEKCFcHud6D/8KT3HhClpO93lc4=;
	b=tw25ufkKdcUuJ1OCn0CtJgQFxNVrO8CQIborH+XxnthTUc6cIKF7/L2Ql0pyiVz+KUTM
	 JZtYoMrkX/m8ktTx10BaG04sMg9vf2ikC8Rwuuu/e6nEeaIIbXMkCB+W6KCGy6twg9Fsd
	 jxdR2NjaYR7FIQg0sQNPzWAx8Jwag+nQtF6oE7in7yWdkUCJdWjMXtoecYi8sOM1+qVxd
	 NIKkmlgN4GTq3bzXmrtfvBu9Q37egZWQx0FnMIqkm0og7yGVF/hJQDZkPRSVPrmg2Dttn
	 wiQZbjmBbSBgLN2edRL2vwqKpyk6ndDbO8rMhm46b9+zAbolpQm96p2N8wMUuYt/U4g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=163.com;
	spf=pass smtp.mailfrom=163.com;
	dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=NQneX6fH;
	arc=none smtp.remote-ip=117.135.210.5
X-Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.5])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F806606A333
	for <git@vger.kernel.org>; Wed, 28 Oct 2026 13:38:30 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2F806606A333
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;
	s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=EB
	W2Cqxuc828EJJqiEKCFcHud6D/8KT3HhClpO93lc4=; b=NQneX6fHrFq5LU07VP
	bbdlhCTzwYMW8wAXyJr/0q4C7B3LGcmBLrwz4PV8Iqb7FPgo2pUWHdRd8mLnOmP8
	uodAB1fnrLBx2rfqsGapQR51cgMQTy9EJJpped0n0b2Ss5M63AmY4I04Bm3W17Rk
	E4xHjEfbIitGiNOde48r4t7jE=
X-Received: from ian-MacBookPro.softshell-mine.ts.net (unknown [])
	by gzga-smtp-mtada-g0-3 (Coremail) with SMTP id _____wD3l8O2+uFqF6nxDQ--.17041S2;
	Wed, 28 Oct 2026 21:38:04 +0800 (CST)
X-Cc: ian4hu <hu2008yinxiang@163.com>,
	Junio C Hamano <gitster@pobox.com>,
	Jeff King <peff@peff.net>
X-Mailer: git-send-email 2.53.0
X-In-Reply-To: <pull.2263.git.1792154272296.gitgitgadget@gmail.com>
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-CM-TRANSID: _____wD3l8O2+uFqF6nxDQ--.17041S2
X-Coremail-Antispam: 1Uf129KBjvdXoWrtry7XFW3XF1xJw4kZFW3GFg_yoWkCrc_Za
	4rArn2yw4kXwsxZw4fKr4DuFWkGanY9F18J34kXr1akry5Z3srWrWvvryxuw1UCa9Iyr98
	WrsIq34fGa4a9jkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT
	9fnUUvcSsGvfC2KfnxnUUI43ZEXa7VUjKsUJUUUUU==
X-CM-SenderInfo: dkxsiigy1l05pldqwqqrwthudrp/xtbC7hwBmmrh+rzg7gAA3q