From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16802 invoked from network); 19 Jun 2022 02:41:32 -0000 Received: from tb-ob1.topicbox.com (64.147.108.173) by inbox.vuxu.org with ESMTPUTF8; 19 Jun 2022 02:41:32 -0000 Received: from tb-mx0.topicbox.com (tb-mx0.nyi.icgroup.com [10.90.30.73]) by tb-ob1.topicbox.com (Postfix) with ESMTP id 5D3961F4BF for ; Sat, 18 Jun 2022 22:41:18 -0400 (EDT) (envelope-from bounce.mM45b18058b8188bfcc376c11c.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx0.topicbox.com (Postfix, from userid 1132) id 5C82729088E2; Sat, 18 Jun 2022 22:41:18 -0400 (EDT) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=date:from:to:subject:in-reply-to:message-id :references:mime-version:content-type:list-help:list-id :list-post:list-subscribe:reply-to:content-transfer-encoding :list-unsubscribe; s=sysmsg-1; t=1655606478; bh=4zIGLja1oN+u2TDL lEuMaKtyOKTSN6qUCQ3u0OiFCUo=; b=mWOgJR+id+lziqyDhKr9oYtqiy6KPd3o PMrN1FsaAD6yDAtFIn9s2hq0hYXNj5uaWEeZmHRgI4FJlMli7uC1bR3xX5akGu7z 7u23w3mkgc3BTuCPuOY/wpB0PZ3zaY3T98ozQ+skvKAVDkKs513ti7Lrtq7+5TnN yIXbgq/M5Xw= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1655606478; b=FypSpaGcy4feRVlGdfxIyVOHWugFXwFiZkqHEHJaKUKGA2d2t+ gKfkZpYhn/ErnYdplYF7CO2QEdvhZVA/hfjWzB8pQARL9dObw9S3GkLvPUulD3Xc mBofuZD72x+soyvSluW9kQwqbTn/WMBSEKOpdDMQoWvP0dgYfy9CpQmIw= Authentication-Results: topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) X-Received-Authentication-Results: tb-mx1.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; iprev=pass smtp.remote-ip=205.166.94.24 (mx.sdf.org); spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mx.sdf.org policy.ptr=mx.sdf.org; x-return-mx=pass header.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-return-mx=pass smtp.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=date:from :to:subject:in-reply-to:message-id:references:mime-version :content-type:list-help:list-id:list-post:list-subscribe :reply-to:content-transfer-encoding:list-unsubscribe; s=dkim-1; t=1655606478; x=1655692878; bh=hP/FD+qLq3lfixT+q/NhNbhDWk9sqjtj mWUsD6KVf9U=; b=P3+LPenNoemwr37DNS5I9BvybQ/ka8buZBy2/G9HxEMZCM62 RR9Rg9Kb1+/VGdpb+kqvH7eV+3uXd6Ar6Qv+x9iFTE8I2Go1rli5AZg8zD8cnioU eVCu6NTJMAr4uIS0X+Eo/AAe99PRN0xa0H6w+dd8vaAKPoIIpVPttxPk5Lw= Received: from tb-mx1.topicbox.com (localhost.local [127.0.0.1]) by tb-mx1.topicbox.com (Postfix) with ESMTP id 33BCA15957C4 for <9fans@9fans.net>; Sat, 18 Jun 2022 22:41:05 -0400 (EDT) (envelope-from adr@SDF.ORG) Received: from tb-mx1.topicbox.com (localhost [127.0.0.1]) by tb-mx1.topicbox.com (Authentication Milter) with ESMTP id B2A71922EAC; Sat, 18 Jun 2022 22:41:05 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1655606465; b=w0pHD8yFYrZbKDpHGmHyxnBZh10zsZJgcJXBCc71tQc+yybAGR 2j4RAnnTFcBVKKY4Gm1WhtQuc8oiZvJKf0yh+b86Eso9M74ZBgBekStMDQaUS/3s CdIi5NCvMXIXSia3WnKjS+ATARO3wfuswqSzvzioupdJzlHK2OAkiGXtV5NBoQ2C u1H+zpMONDpGi0hQfmHDhdM/3XqyjxjuLLJkMdkSxmNwbMg/4/VoxdK7OwSubY/p t2Kz85VI4MiIIeEkOJKp161DZwdWrEk1jb7ka2B8vgSVdLbNDN5OuzTUs+PQygzn dmnB+CYs2N/8XIJ4UIEQa5TFJLe2T5Ha3H9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=date:from:to:subject:in-reply-to:message-id :references:mime-version:content-type; s=arcseal; t=1655606465; bh=Xtfu9Hr62ZxrRNEAw/oGushNHr1ye1/NJtE9VQ2aRQc=; b=VJXdfVuHlEyY 6DO6+i8C8sW8IHISu1IYPARzUnCv8JdZ1BsBlhu54m3IGjxCcXFNevvKIWZ0hHaF Ia5dGLxeTh1jXYwz1hwsGgyaMYW/gbrPCIjV0915LBfJbl4SgyQADkys4kmKtfpL bpAY7ebm0X+R+xyRih80K87yseN0m1hhTIxyATu5Y0Cnkn78ymXMPIAg47HogIgt m7M6hhcEJJIiBuv5rw0xK344I8BwNDzgVhDVTJi1sOxDt3XeQA+lXAAJs0P0h94G vaF/P3nhWtx04TLGkpetNUS8AQfCkSixRXfjoVfPKbfK3KJ4sGuMbX2c3y/m49N3 ic3+W2APyA== ARC-Authentication-Results: i=1; tb-mx1.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; iprev=pass smtp.remote-ip=205.166.94.24 (mx.sdf.org); spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mx.sdf.org policy.ptr=mx.sdf.org; x-return-mx=pass header.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-return-mx=pass smtp.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgedvfedruddvkedgheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuf gjkfhfgggtsehttdertddttddvnecuhfhrohhmpegrughruceorggurhesufffhfdrqfft ifeqnecuggftrfgrthhtvghrnhepkeehtdevffehvefhtdeghfehgfevleevudejteejtd ehuddvfedvkeegtdffhfffnecukfhppedvtdehrdduieeirdelgedrvdegpddvtdehrddu ieeirdelgedrudeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvth epvddthedrudeiiedrleegrddvgedphhgvlhhopehmgidrshgufhdrohhrghdpmhgrihhl fhhrohhmpeeorggurhesufffhfdrqfftifeq X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (sdf.org: 205.166.94.24 is authorized to use 'adr@SDF.ORG' in 'mfrom' identity (mechanism 'ip4:205.166.94.0/24' matched)) receiver=tb-mx1.topicbox.com; identity=mailfrom; envelope-from="adr@SDF.ORG"; helo=mx.sdf.org; client-ip=205.166.94.24 Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx1.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Sat, 18 Jun 2022 22:41:01 -0400 (EDT) (envelope-from adr@SDF.ORG) Received: from sdf.org (IDENT:adr@sdf.org [205.166.94.16]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 25J2exim016907 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for <9fans@9fans.net>; Sun, 19 Jun 2022 02:40:59 GMT Received: from localhost (adr@localhost) by sdf.org (8.15.2/8.12.8/Submit) with ESMTP id 25J2excQ021993 for <9fans@9fans.net>; Sun, 19 Jun 2022 02:40:59 GMT Date: Sun, 19 Jun 2022 02:40:59 +0000 (UTC) From: adr To: 9fans <9fans@9fans.net> Subject: Re: [9fans] syscall silently kill processes In-Reply-To: <658d1591a1abef7c4a85ea3bbf23777b38247893.camel@gmail.com> Message-ID: References: <79286caa2ca77ea9b9a1cd64918bdc5f28c8f180.camel@gmail.com> <9e922645a598c69ba14b74e18e8669cc068e9717.camel@gmail.com> <0e5677e6-684d-ff37-c6cd-430d18536070@posixcafe.org> <3889a52-3fe4-c28-1c3b-a73412a489@SDF.ORG> <64a85bad-7ab-fb6-6517-acfafa819bc@SDF.ORG> <658d1591a1abef7c4a85ea3bbf23777b38247893.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 4760b97e-ef79-11ec-aa07-98534f2cf814 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UZmE2ODIzMDQ4YWQ5MGEyMS1NNDViMTgwNThiODE4OGJmY2MzNzZj?= =?UTF-8?B?MTFjPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Content-Transfer-Encoding: quoted-printable List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M45b18058b8188bfcc376c11c:1:UJSfdB7675m6VZXIDhk60WBPR1jjans6FXeJShhpq6k Oh man... how silly, I know what's going on. We are using processes not threads, so although we are sharing the same array of handlers, they are registered for different processes. When the array is full the next processes fail to register handlers _for_them_ so as andrey rightly said, the default action (death) is taken when the alarm note is sent. The solution is obvious, cancel the process' handlers before it exits so we don't run out of space. Now, is there any reason to not do that in threadexits() when it terminates the process? Shouldn't threadnotify() cancel only the process' handlers? We are sharing onnote[NFN] and the code as it is right now removes the first handler that match the pointer, it can belong to another process. Something like this?: int threadnotify(int (*f)(void*, char*), int in) { int i, topid; int (*from)(void*, char*), (*to)(void*, char*); if(in){ from =3D nil; frompid =3D 0; to =3D f; topid =3D _threadgetproc()->pid; }else{ from =3D f; frompid =3D _threadgetproc()->pid; to =3D nil; topid =3D 0; } lock(&onnotelock); for(i=3D0; i