Article View: linux.kernel.git
Article #1753Re: [PATCH] sigchain: recover from concurrent double-pops of the same signal
From: Phillip Wood
Date: Wed, 28 Oct 2026 16:39
Date: Wed, 28 Oct 2026 16:39
40 lines
12495 bytes
12495 bytes
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
Technical Details
Message-ID:
<0806471f-957a-4f32-ac33-c00c25a46033@gmail.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-73673-linux-kernel-git=dewy.ruReferences:
<3f939144-d4b3-4bc5-aaea-16422450d638@gmail.com> <20261028144736.121433-1-hu2008yinxiang@163.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-73673-linux-kernel-git=dewy.ru
From: phillip.wood123@gmail.com (Phillip Wood)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH] sigchain: recover from concurrent double-pops of the same
signal
Date: Wed, 28 Oct 2026 16:39:37 +0000
Organization: Usenet Network
Message-ID: <0806471f-957a-4f32-ac33-c00c25a46033@gmail.com>
References: <3f939144-d4b3-4bc5-aaea-16422450d638@gmail.com>
<20261028144736.121433-1-hu2008yinxiang@163.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="1818259"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:bP63rbwcpefGq/WPaZXp3qa3wro= sha256:vpF5pYMTzFbYLLuLH+/XHG7PXZQ+OCLcWXgi/k+29IQ=
sha1:cX4deJmKhek3IG6zPYVYFuhIAOQ= sha256:J+pAGQBu0r/mxNRpmDaKdla5BLl+ol9ds0lM8fTiHYU=
Content-Language: en-US
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 8F940125C43; Wed, 28 Oct 2026 19:53:30 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.948
X-Spam-Status: No, score=-1.948 tagged_above=-9999 required=6.31
tests=[DCC_CHECK=1.1, 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] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.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 F0Ik5PWWC1Me;
Wed, 28 Oct 2026 19:53:28 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-73673-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id E14B8125C42; Wed, 28 Oct 2026 19:53:19 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id B75592D3C2; Wed, 28 Oct 2026 16:40:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1793205583;
b=WKQTJmhcxWjInGqMXXWYTTWRcnFwac4LgRxLWSdK1i/bwFJ72FwBadUK8BRrqT7zuTFt
pCyHcHlVjTYTdLjX5ShKi9ZLUM3b2YxRGFe2hg9b5VY/iNR9hvQPdibRkewqS0BWfqT0c
ibqQcShJQJWxYUXihEJ1FKxjfD4UOAh9k8Wc5GcVGQN6l1vL5/mh9dwL0pm3k6s0lRBP/
dsPP5DHmu8uGFq4+QgrmfR/tK3dpPcs602IuQBXY+Cok5UKyj6wN9QGfhOO0abOhUNp5U
P7HXbhnBFy9+6Uj+sc5Nh5KdvHN63E1sbPelHcpNuJqk81igCjLx9CAwHY9ufF2MUyQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793205583;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:Message-ID:Date:X-Mailing-List:List-Id:List-Post:List-Help:
List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
User-Agent:From:Reply-To:Subject:To:Cc:References:Content-Language:
In-Reply-To:Content-Type:Content-Transfer-Encoding;
bh=Z+LTy7VR9zcY5ymgLSa54MkJCl2jaaelvDouQb71CVE=;
b=DlBzwaxlmkLLRJgd+n+VurD6S5qwzUVuLLs8/JSk1iYyzloERjyc9eaQbPXz+03d4u2V
zUXjqHMiojssNMEjcYA/I8acY9upHrgqiSF6GbiNmH9h1Rev/Ymae3atGG2N2gi0+q476
M/zhQbTqZYhcAp1chwXZDrmWCzHfbER4+YHaT83PSML4bVKbFYjqhiobutvMiUrH0BJQM
otB6yo0c7WvgJU4BlFiwbMj3ZmZv1hn6vbi7qfjn1l8xn5OGlHErYhr2FE7CjqormNJfZ
UbqUQCIUFLiX03qVnBnZVDMsa+vR2DSfvRlzLo9gmfmJ32TK8It3yXmdhR8rbglpWYQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=K+sS+Ed9;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 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 CD66D606A32C;
Wed, 28 Oct 2026 16:39:43 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=K+sS+Ed9
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.52
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1793205583;
b=O1I2yrPCPUGxQI70FPu5hvX1nWAo4IImcLgnqrg02hukuqvQ5l6nBpbN5QcXfEtKSW8T
AnqvNRct1T3UEu8/i7gsxJG/FNOVAze157SagtX6mjXMSolNEX8GqODfX0z1aO/54F4GU
Oaw89Pqe92mV6Sf/iXMcYvyDvI7DcbNiKywCemN1pVbdjOTM889U+xDSLEg8XdVjH96RU
U4XUL09DpoeWiKFqCp5ehKUdtCeD+nTe0CTq+GFXAx8E5ovTYV/ONh/5E4xB8H1xXVh+f
RPksnr/ynkbfIolPmYoeeAKDBmW0/lFH6WlAf0mfTwWvTOl9TKD4+6KUBDZmd5UKgPA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793205583;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Message-ID:Date:
MIME-Version:User-Agent:From:Reply-To:Subject:To:Cc:References:
Content-Language:In-Reply-To:Content-Type:Content-Transfer-Encoding;
bh=Z+LTy7VR9zcY5ymgLSa54MkJCl2jaaelvDouQb71CVE=;
b=SrtWlGI2GKBhe5fuILfFa3fFVEpr8Ibp8Qe1H2VIG0/zb2sB3kqusx5f1Mr/uw3+HXFe
RoTG9sXMbPwfGb3U4lueaqmziwACO4X0aaERPGUTJdORC3WIiTRB7e5pld/bChoirRmBr
k2NhqeHpInP+5h1/gozafn8Nhdtgx0cC32MVDx3ov+Ys9N82dEe6o3CDoKv2ABRxFf1Z3
4ocIsN/ik5ECI7WLV6tt+c/+vuQ/cn80ygmUtl3m7JXGrWpFuQ6+anZNtAz9SyFd9Yt/J
E4nSI+Q4slK5GGrqnJauDN9P3zla7e432CBN1mi8kVkI8BpJIOPlocpBdyh18lliJ9w==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=K+sS+Ed9;
arc=none smtp.remote-ip=209.85.221.52
X-Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 986CA606A31E
for <git@vger.kernel.org>; Wed, 28 Oct 2026 16:39:42 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 986CA606A31E
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-48e09aa5264so633283f8f.2
for <git@vger.kernel.org>; Wed, 28 Oct 2026 09:39:42 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1793205581; x=1793810381; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:in-reply-to:content-language
:references:cc:to:subject:reply-to:from:user-agent:mime-version:date
:message-id:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=Z+LTy7VR9zcY5ymgLSa54MkJCl2jaaelvDouQb71CVE=;
b=K+sS+Ed9a+cat71pgr+ebXxOc22j3Hjcxo++UsnGU8zDk1YEA1vUAg2B2zfZowEufb
MMYvfkVTVmsVrmeV+pug5c8+C2rVpUMRvG9gzojnmVZ8gxfwqjKHg2Vz/Ju/hDroAvdS
Ahi96n29Jf8dc4OP+LcR4Q4GVCVWf5s3mszqvhGouCEGjpzNX26Tnr0iIx99Jn/HuA2G
hF3nxEdgzEOsjRsUXvE63h/tvi7G98gr6Ci6cYOQ+QIsRTzJEWIJ1IyToM0bM945YUur
lBHBo6Chl46KO7EGP5X8ujSRHTH2LgEW5vvds+Iqz89OoFqR8KTFXTzhbLpDr9YmhlJ8
15vg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1793205581; x=1793810381;
h=content-transfer-encoding:content-type:in-reply-to:content-language
:references:cc:to:subject:reply-to:from:user-agent:mime-version:date
:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=Z+LTy7VR9zcY5ymgLSa54MkJCl2jaaelvDouQb71CVE=;
b=u/btWR/NgKmwFFMTJkbjSpv/RhqL8If0qJ9UTmf67TsHCwib4wuXTu0ZFyZDeyxHef
/zOam6vOzXTRV/BN/L33hK4oLxLgdN4abkB2ma/1DI9DCXd+wspiKF1p07JmlzX+bYKS
FsjSATbFRURxWNdq8wCj1r7i3Eu+2fFmGLBJ6il9a/NFogBvZumPiOEuIdJCLBRge7of
tP9PkMHaEjBxzGhFA218Yc0xFj52kKbXF5qg10Dncs46XdZIPD4Z5iRaII2os9GhGjcU
8SIWABuliUJ/aPXd78H7J4Pub/7iPvzAfYujOUvED36cnSOx8MHYsXTCcyQdh/rlsxKR
snyg==
X-Gm-Message-State: AFq9FYIVhMwSF567sszj/yk+Icha+4KLvHSHUE49cWzrtLSIuPkg+8AE
G+aHkBRT8UqlJPq5n/ql9dkcXDnt+h95rP2bRNUPEglo5easE7GEt/xs
X-Gm-Gg: AYBFou2xT4tOQNwVZNATzZ95q56jL0gnSzksL5kH3Ml0/ASEORLBBSt+oc8v6yESYpX
uedVcKPyqoCJm78gYcTm5LCfg7C7ec2rc6W7hLePkbHGacEnUMoGrbxcYsKef9PUMMptwUF7DkB
5yUaX7mcAvQQNBgRuBNdlXL/UPSZ5sf3nifatihaY0pE9s3WL9esaNb39W9FRWCMqOo78LPsIWc
amsUk0InRcyy+FfXidRDufg2VPEpbmvmGrLGDb84wvoNgnR6mkA7BCnzDh5nG2WakiSKpqgRnNl
WsH6gWUuv5Udm8h8Z2b6mqEZmiU9lR3L9Y3I0F9t88YTfjymsL3amsNFEZt9xw5SPikwhd643j3
ZwVJrBLDW0stn6tC//SHfpkKAEcucanfF9GjKpkLtNVIV/s4hjstwDCuOhsfRUnabg12/kGHi3d
SyNXqvs7xFfiYIqGrDMU11S7fzFewdA4am9gZI2gK9MrtZrmYwRWkcfnP1FZfDVhP+rsQUPUne8
fOW2L4bkKmbRSuqoy8C6FZbE+k9qSX07Ky6QMkPtCREVwtyE2AP3nx/yU3rjqiL6ndYDUjtxqvO
LjFez3C3CdkI+q+7lv7og+1L4QovNjCU/Og/CL7qL3QScH7dqn00IwNGjQ8fuwE31FguCJ1HAvw
UO78XY1k=
X-Received: by 2002:a05:6000:4a06:b0:48a:f404:695e with SMTP id ffacd0b85a97d-48e5d5cf41cmr7138276f8f.50.1793205580845;
Wed, 28 Oct 2026 09:39:40 -0700 (PDT)
X-Received: from ?IPV6:2a0a:ef40:724:6601:f3ff:aebc:61f8:d91f? ([2a0a:ef40:724:6601:f3ff:aebc:61f8:d91f])
by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e3ebc3c5bsm30133799f8f.9.2026.10.28.09.39.40
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Wed, 28 Oct 2026 09:39:40 -0700 (PDT)
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-User-Agent: Mozilla Thunderbird
X-Reply-To: phillip.wood@dunelm.org.uk
X-Cc: git@vger.kernel.org, gitster@pobox.com, peff@peff.net,
phillip.wood@dunelm.org.uk
X-In-Reply-To: <20261028144736.121433-1-hu2008yinxiang@163.com>