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_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14164 invoked from network); 18 Jun 2022 22:23:12 -0000 Received: from tb-ob0.topicbox.com (64.147.108.117) by inbox.vuxu.org with ESMTPUTF8; 18 Jun 2022 22:23:12 -0000 Received: from tb-mx0.topicbox.com (tb-mx0.nyi.icgroup.com [10.90.30.73]) by tb-ob0.topicbox.com (Postfix) with ESMTP id E774922039 for ; Sat, 18 Jun 2022 18:23:10 -0400 (EDT) (envelope-from bounce.mMfea7f52ccd99974d957af810.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx0.topicbox.com (Postfix, from userid 1132) id E53D52904CB6; Sat, 18 Jun 2022 18:23:10 -0400 (EDT) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=Xd6WNNiG header.a=rsa-sha256 header.s=20210112 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; spf=pass smtp.mailfrom=andrey100100100@gmail.com smtp.helo=mail-lj1-f178.google.com; 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=message-id:subject:from:to:date:in-reply-to :references:content-type:content-transfer-encoding:mime-version :list-help:list-id:list-post:list-subscribe:reply-to :list-unsubscribe; s=sysmsg-1; t=1655590990; bh=YVbxuubb9AaylRbY jHhHOoOsGwlIOCnecspW5o3x4pU=; b=tq4ZKABEkToXVFytedq3GebwzfCrl47w ELUj8etuhj9NSlmL5rKkW7V86osAPhgiCDH8BCc7oipayQx9OC+vU5LJ4pY4DUYC v5CoA53jKsPGwoTUlVjLT49EHUr8/46dN6qJvxb1JX6AzRlrSy5HvGBnlj7/Vjc0 IAI0H4P8xvA= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1655590990; b=PiuOUX6UTFt/9xwAHVjpowWQdoYqnLvhBEe5UkuXrb+7Yt79LI 58qzbb7yxmN4vJcw6mPReBfLm01eXuo7YHSr7dGjBDwU6deMPG8ZHJ73UTGXmfV+ iMgq7znAdnQLalN0Z1yDPbcPhcrcDmbCxnxeCvEk77/wCbad91C4u6OVU= Authentication-Results: topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=Xd6WNNiG header.a=rsa-sha256 header.s=20210112 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; spf=pass smtp.mailfrom=andrey100100100@gmail.com smtp.helo=mail-lj1-f178.google.com; 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-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=Xd6WNNiG header.a=rsa-sha256 header.s=20210112 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.208.178 (mail-lj1-f178.google.com); spf=pass smtp.mailfrom=andrey100100100@gmail.com smtp.helo=mail-lj1-f178.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=dmHSZX90; x-me-sender=none; x-ptr=pass smtp.helo=mail-lj1-f178.google.com policy.ptr=mail-lj1-f178.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com); 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=message-id :subject:from:to:date:in-reply-to:references:content-type :content-transfer-encoding:mime-version:list-help:list-id :list-post:list-subscribe:reply-to:list-unsubscribe; s=dkim-1; t=1655590990; x=1655677390; bh=YVbxuubb9AaylRbYjHhHOoOsGwlIOCne cspW5o3x4pU=; b=PZacbgE68LrOD3358SgyBe2w04T6fgCdAMdB2WpcgA8kGJ8z sIyd1jXqgkOHDW+3beV8JFNY/CyU8QbBkJwHzrQDELjdxRDvvMhwChDdagDNQCFC ZFFZTjavfQHwHgiwAuQIPv3pcKN14ptzWELOQSyB/MCA2mdI0SndsAdRFs4= Received: from tb-mx0.topicbox.com (localhost.local [127.0.0.1]) by tb-mx0.topicbox.com (Postfix) with ESMTP id 36BD12904893 for <9fans@9fans.net>; Sat, 18 Jun 2022 18:22:55 -0400 (EDT) (envelope-from andrey100100100@gmail.com) Received: from tb-mx0.topicbox.com (localhost [127.0.0.1]) by tb-mx0.topicbox.com (Authentication Milter) with ESMTP id D17C1A1222C; Sat, 18 Jun 2022 18:22:55 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1655590975; b=qtDs0T6moW9DKgNDObESRQfxXOdgNhb9uZczTrpvRWsT5+OBVB guSubQckA1o56doK8vwsLjZb0RojkBuwpA+Wod/ByE75JpKBGvRQsQEFhamZKc0h XWEJaNcqR7x234IqSiy3TwNFelzFnuR2dxEwOXlEmYsONM7tReoQpXr2y7qcmmqW E1C4Hmf15/cdreeBbIch34wpk7c2aRWbmed6bVfLm9E2unWmn59uJHmGlM6vZfzR 3kxalMnNFr3X3NLsceHdaeb+4lBrMFA3wbCJkWug3Hn6mI5OmNDkJCColIVchTwX T8DzQ6Hs9H/3o8+Z38MOd7+r8mar1RJmJp1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=message-id:subject:from:to:date:in-reply-to :references:content-type:content-transfer-encoding:mime-version; s=arcseal; t=1655590975; bh=2jKT3bB9KzIDkyEXo8GR1n+0ylI2GcEVf03 oHrHCzBs=; b=H/m4oofZuaXYQm1XrY1Ed29q1Uyo+2QcqQK1VGjBGeY4D8iPxJQ I9LrvQNeNnAOnhlSVRJ6XL5cAQ7IezVAW1PDCfR5/sKJnfMJUNXE3yHMiUiy8Ct0 udZo5zWNt1lgP2SQlr2M/oguwJ107wtKN2qTHzzCmTdcXmYLSikQgxbemmmYaJnV ENj/awEou8jLc0lK7Xj/4ZmcOiKPowXX1hrcsaaaejThm5jB4B1AXvSleFU9BXSi Njf9NZ1RY5S4Um/E6dkHBae7r4+baNYJ2n1bjIoVtKAX0pp4nzfRMYuME1S33fIw mkQTLT05Qu4KtxTn35cblVPk5iU/WcyPpGA== ARC-Authentication-Results: i=1; tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=Xd6WNNiG header.a=rsa-sha256 header.s=20210112 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.208.178 (mail-lj1-f178.google.com); spf=pass smtp.mailfrom=andrey100100100@gmail.com smtp.helo=mail-lj1-f178.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=dmHSZX90; x-me-sender=none; x-ptr=pass smtp.helo=mail-lj1-f178.google.com policy.ptr=mail-lj1-f178.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com); 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: gggruggvucftvghtrhhoucdtuddrgedvfedruddvkedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkuffhvf ffjghftgfgfgggsehtqhertddtreejnecuhfhrohhmpegrnhgurhgvhidutddtuddttddu tddtsehgmhgrihhlrdgtohhmnecuggftrfgrthhtvghrnhepffehvdeitdekleegledvke fguefgieffuefgffdvvdehgfffiedthefgheefudejnecukfhppedvtdelrdekhedrvddt kedrudejkedpkeehrddujeegrdduleelrdekvdenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepihhnvghtpedvtdelrdekhedrvddtkedrudejkedphhgvlhhopehmrghi lhdqlhhjuddqfhdujeekrdhgohhoghhlvgdrtghomhdpmhgrihhlfhhrohhmpeeorghnug hrvgihuddttddutddtuddttdesghhmrghilhdrtghomheq X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (gmail.com ... _spf.google.com: Sender is authorized to use 'andrey100100100@gmail.com' in 'mfrom' identity (mechanism 'include:_netblocks.google.com' matched)) receiver=tb-mx0.topicbox.com; identity=mailfrom; envelope-from="andrey100100100@gmail.com"; helo=mail-lj1-f178.google.com; client-ip=209.85.208.178 Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx0.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Sat, 18 Jun 2022 18:22:54 -0400 (EDT) (envelope-from andrey100100100@gmail.com) Received: by mail-lj1-f178.google.com with SMTP id d18so8193844ljc.4 for <9fans@9fans.net>; Sat, 18 Jun 2022 15:22:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:content-transfer-encoding:user-agent:mime-version; bh=2jKT3bB9KzIDkyEXo8GR1n+0ylI2GcEVf03oHrHCzBs=; b=dmHSZX90mJAc+dlsxNeY0wIHdg1cL8zO40LYYhl5RsxMatWv3ge6htWpiVGAlyrqoj lsrrb5mMXvYTH7xvBPOdSafg5d67zkUphaSyVA7STg7/N7pXrvs9Qzd7jkMppmchlhSg l8i2FWrdGTrti7Lie0ARAJhrwb+uUpVKTwbt+7M28mFZjUAy/hJaWxGSXwFoj/DW9z9K QB2ba8XWzSh5tdryBK4RQWZy8vdpBhMljvPK79iMsye+YctpvUNjwZwe7SKYoplbzRDU mNAgObF3czfcUfigVaytGCvUN5m+1IXalgBpxaNy3OSIR3myGAHBtS5SiC0kxd6fq8Sd RmfQ== X-Gm-Message-State: AJIora/X9sTf6HeG+vAIJP0Ge6skXIP01AE3SV31bcrepHXAEusAim/0 2tXPDX5/blOhI+lyNnlfBSGgsNoTt7Q= X-Google-Smtp-Source: AGRyM1taprsjl+IMs0QxgAW3K/CLX1a9biwCLgEtyf6c3kgXOl/CfkQm4fLDsWoBpwmG2YRVcW0hYA== X-Received: by 2002:a2e:2418:0:b0:25a:662e:5051 with SMTP id k24-20020a2e2418000000b0025a662e5051mr1475239ljk.137.1655590972604; Sat, 18 Jun 2022 15:22:52 -0700 (PDT) Received: from [10.33.77.10] ([85.174.199.82]) by smtp.gmail.com with ESMTPSA id v16-20020a05651203b000b0047255d211bbsm402388lfp.234.2022.06.18.15.22.51 for <9fans@9fans.net> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jun 2022 15:22:52 -0700 (PDT) Message-ID: <1e4f4ef464bd003c52e8e98ba9ad440d7e0bc33f.camel@gmail.com> Subject: Re: [9fans] syscall silently kill processes From: andrey100100100@gmail.com To: 9fans@9fans.net Date: Sun, 19 Jun 2022 01:22:51 +0300 In-Reply-To: <5e2f8566-da80-6c40-9718-3a9199434e7d@SDF.ORG> 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> <5e2f8566-da80-6c40-9718-3a9199434e7d@SDF.ORG> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.1 MIME-Version: 1.0 Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 35dc732e-ef55-11ec-8f6d-b6ef22e29ab7 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UZmE2ODIzMDQ4YWQ5MGEyMS1NZmVhN2Y1MmNjZDk5OTc0ZDk1N2Fm?= =?UTF-8?B?ODEwPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:Mfea7f52ccd99974d957af810:1:IvTckxDEEEo_IyWfS7w07g6Niu9mzcEVEK66CrAY4ME =D0=92 =D0=A1=D0=B1, 18/06/2022 =D0=B2 09:22 +0000, adr =D0=BF=D0=B8=D1=88= =D0=B5=D1=82: > On Sat, 18 Jun 2022, adr wrote: >=20 > > On Sat, 18 Jun 2022, andrey100100100@gmail.com=C2=A0wrote: > >=20 > > > --------------------------------------------- > > >=20 > > > cpu% 6.out | grep end | wc -l > > > =C2=A0=C2=A0=C2=A0 33 > > >=20 > > >=20 > > > Problem in unregistered handlers. > >=20 > > But unregistered handlers shouldn't be a problem. The process is > > been killed when alarm sends the note. That's why the code worked > > removing the read statement, the alarm is set off and the note is > > not sent before the process ends. I just don't see why the process > > is been killed. The documentation describes another behavior. To > > me it smells like bug barbecue (corrupted onnote?). Maybe I got > > something wrong, bear with me. > >=20 > > > > Note that you could register the handler in threadmain and > > > > avoid > > > > completely this issue, but as I said before, something seems > > > > wrong > > > > to me here. > > >=20 > > > I'm don't understand how handler in threadmain would solve the > > > problem. > > > I need in 'alarm' on per process basis. > >=20 > > You need alarm() in every process, but you don't need to register > > the > > same handler 80 times! > >=20 > > adr. >=20 > I think there is some confussion here, so I'll explain myself a > little more. >=20 > Lets change your last example to not use libthread: >=20 > #include > #include >=20 > int > handler_alarm(void *, char *msg) > { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if(strstr(msg, "alarm")){ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 return 1; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 0; > } >=20 > int > test(void) > { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if(atnotify(handler_alar= m, 1) =3D=3D 0){ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 fprint(1, "handler not registered\n"); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 alarm(10); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fprint(1, "start\n"); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sleep(40); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fprint(1, "end\n"); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 alarm(0); >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 0; > } >=20 > void > main() > { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for(int i =3D 0; i < 80;= i++){ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 test(); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 exits(nil); > } >=20 > You see, after the NFNth iteration of test(), onnot[NFN] in atnotify > will be full, the handlers wont be registered but the code will > work without any problem. It doesn't matter, the first handler in > onnot[] will be executed. I fact you only need one handler there, not > 80, you should move atnotify to main. >=20 > The same should be happening with libthread. I'm really the only > one smelling a bug here? Atnotify and threadnotify have different implementation. it seems that threadnotify is for processes with shared memory, atnotify for fork() (no shared memory). But then it is not entirely clear why lock() is used in atnotify? Regards, Andrej ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tfa6823048ad90a21-Mfea7f= 52ccd99974d957af810 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription