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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25213 invoked from network); 18 Jun 2022 06:40:45 -0000 Received: from tb-ob1.topicbox.com (64.147.108.173) by inbox.vuxu.org with ESMTPUTF8; 18 Jun 2022 06:40:45 -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 A7B5F18DFF for ; Sat, 18 Jun 2022 02:40:39 -0400 (EDT) (envelope-from bounce.mM2bf5df4e0184bdff80c9eee9.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx0.topicbox.com (Postfix, from userid 1132) id ACEE228F3847; Sat, 18 Jun 2022 02:40:39 -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=nhhwgkDw 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-lf1-f48.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=1655534439; bh=CdXVKIsAjgKGiVuV Ory3IdN8AbT6bFxHeCUQqkmj4N4=; b=tI1SRNR9QPE/ExiFtBdIvVdOa1EGbLfq xGp9C/JWehPl3DxN8YXrllMjDg5njzbVtwbsoqYMU4dQ+qIJofpueLL5p8vX+jk+ jqPXVFp+pIaOt75mAH2oh1cw2hjKLqHPOfYaLXquCf7eV0J6BypMw1YE8QTXyWEv chD/MYQ6Wt8= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1655534439; b=kTZb44mSzBYmALSnoXk88D44wveNGcoMJkpk7uN1/3n5C7yGc9 d/J3D97IyrqFfSEC0P5Vw8/4FhZYLGRRu1uoDpDey5q/h5PeOXK9dJ0gsCz6uhbR Mtwa2QDBIieiV92XFHKfz9sEaqq61l58DtLPY8xzf5fIPuFALlwLD+piw= Authentication-Results: topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=nhhwgkDw 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-lf1-f48.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-mx1.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=nhhwgkDw 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.167.48 (mail-lf1-f48.google.com); spf=pass smtp.mailfrom=andrey100100100@gmail.com smtp.helo=mail-lf1-f48.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=y3UTVeaq; x-me-sender=none; x-ptr=pass smtp.helo=mail-lf1-f48.google.com policy.ptr=mail-lf1-f48.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt3.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,alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt3.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=1655534439; x=1655620839; bh=D4/qS3Xo4FFN4vSAKynfUsRxNglduwuJ MmQiTr1AO/A=; b=akNLez8Frpc9iqNGqmJMlAj/c341vWidmIrOwgaINMduzk5/ lwoSH1gMD2jFi2sCEna40mIkpdGeOOFlrVqkCLAk91i0lYx/Ikwspkc+AkV24FO/ qmizFW6fYWB2aC+tg4q7Lui47A/UCdhOwAQ0Xm3zs0t9pg2UKZXyo7vNl2s= Received: from tb-mx1.topicbox.com (localhost.local [127.0.0.1]) by tb-mx1.topicbox.com (Postfix) with ESMTP id D6E7B15909CB for <9fans@9fans.net>; Sat, 18 Jun 2022 02:40:24 -0400 (EDT) (envelope-from andrey100100100@gmail.com) Received: from tb-mx1.topicbox.com (localhost [127.0.0.1]) by tb-mx1.topicbox.com (Authentication Milter) with ESMTP id B6DC5189D90; Sat, 18 Jun 2022 02:40:24 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1655534424; b=ZG7wKBYgPzJlGWXR6vvzier9yl88goIbL0O2w7KAfn7S6O4Y5x 4c4nmuybSQGcY8VF/kOrSkVSjeCguTK3Gfz5CAXf0FW7PI715zvHxOI0JlUlIm35 PLerWfoKycB+SLOi4Qox6LhbJ2YWMO0TTmiURLRYroFs9a6pT7ou9LXvqML2KeZA TafdSOqw11l4lnJ6kN8iKRGs8BBnY5hSNvIoYlmEnXGyfks3+3DEvOOxacs7PQY0 xI1Ho56RL1ryLyx956+I3gmk1Op24JKb6ELCRrNykBHt2JzL+2pthecmOSfoep64 Mi/9rWAVQVEcyIV2+MV9B5B81Q3VTfYmrE5w== 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=1655534424; bh=JIy+VX9G6z+YYYtnf0VWex3XHpgQ2z6SpFc cvmaBvuE=; b=NPNrqCA8kcsysIhIDwt/iGqdndIoUafYvkA2hJZV8pMHR1ImTh8 mq4VarQvJtvBLDYXkZUSvxf82XS/DjFam4RoD5u0vG9Apw9XSu8UyAR+yw9b4Gfm 2P32dZ5Zvym0WgaqnIgNwFD8y5d/qSxnW9+/KGFVu7R4UTuMwqkcJ5bfqZ1TfF3M cY/alYaBfpG0DzKBTQ0tYIOvwiuSIX5HkdLPh+Ce7ez9c3DdSfw+qjod0yaZnDay WL4MkDfpGqU9uuRKrh2IzlMnFxZ8KQQGlgpoOGo3j9nsF8in+DiNPi6sM2IJFvUc UOjZMM5VnC66ZmFmStuEUgLM7dqxyZc9jFg== ARC-Authentication-Results: i=1; tb-mx1.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=nhhwgkDw 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.167.48 (mail-lf1-f48.google.com); spf=pass smtp.mailfrom=andrey100100100@gmail.com smtp.helo=mail-lf1-f48.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=y3UTVeaq; x-me-sender=none; x-ptr=pass smtp.helo=mail-lf1-f48.google.com policy.ptr=mail-lf1-f48.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt3.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,alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt3.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: gggruggvucftvghtrhhoucdtuddrgedvfedruddviedgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkffuhf fvffgjfhgtgfgfggesthhqredttderjeenucfhrhhomheprghnughrvgihuddttddutddt uddttdesghhmrghilhdrtghomhenucggtffrrghtthgvrhhnpeffhedviedtkeelgeelvd ekgfeugfeiffeugfffvddvhefgffeitdehgfehfedujeenucfkphepvddtledrkeehrddu ieejrdegkedpkeehrddujeegrdduledvrddufeefnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehinhgvthepvddtledrkeehrdduieejrdegkedphhgvlhhopehmrghi lhdqlhhfuddqfhegkedrghhoohhglhgvrdgtohhmpdhmrghilhhfrhhomhepoegrnhgurh gvhidutddtuddttddutddtsehgmhgrihhlrdgtohhmqe 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-mx1.topicbox.com; identity=mailfrom; envelope-from="andrey100100100@gmail.com"; helo=mail-lf1-f48.google.com; client-ip=209.85.167.48 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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 02:40:24 -0400 (EDT) (envelope-from andrey100100100@gmail.com) Received: by mail-lf1-f48.google.com with SMTP id t25so9868014lfg.7 for <9fans@9fans.net>; Fri, 17 Jun 2022 23:40:23 -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=JIy+VX9G6z+YYYtnf0VWex3XHpgQ2z6SpFccvmaBvuE=; b=y3UTVeaq+Wc7vO4WLLkCE6WB7De6p1Bry06deykt3Wjge123d7PQwrFU+MwxoQ3S8g mgcseVqX/U/UkglgCsX0bwC6+4Pe1J8T0TUG881Jco4Inj8/6hMb8EBw+L6dW28du5CP JwKTHHwB1fiuAQb/rJxiQMCaeiJ8Oj6n+hfTTgOWGeF8G53ZmPtOSz/ZsROjtIrSyJJ3 JKqXXAz8467VnTZdXn6K/46ZTiQrieSCjDq6aeSpVm2xbkgHKOHWmf5Ani6wmGc93egT Z2ioGoexHcyQdF6W55qn5b74132un0WL56MhKBFlSfA+9AR77kHyGXNIEOPagxA5mO6/ a4fA== X-Gm-Message-State: AJIora931BnZHY7DjvkQy2wbQzRYqc7i8e9d8pktZoxWG0eE3cb9ASCR lIDOp16VXLxst26qKtIGYmi9BoAN1WHK+Q== X-Google-Smtp-Source: AGRyM1uHnOEZ0JLKn9HTnjyoTV1o9IgpqlFX3lrOv/hFsi2mHbkuSTJUDmdC1/P6QqPYFqDXAUBPKA== X-Received: by 2002:a05:6512:234c:b0:479:3bb1:8d77 with SMTP id p12-20020a056512234c00b004793bb18d77mr7494227lfu.637.1655534422286; Fri, 17 Jun 2022 23:40:22 -0700 (PDT) Received: from [10.33.77.10] ([85.174.192.133]) by smtp.gmail.com with ESMTPSA id s13-20020a2e83cd000000b0025a64093a9esm47317ljh.117.2022.06.17.23.40.21 for <9fans@9fans.net> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 23:40:21 -0700 (PDT) Message-ID: Subject: Re: [9fans] syscall silently kill processes From: andrey100100100@gmail.com To: 9fans@9fans.net Date: Sat, 18 Jun 2022 09:40:20 +0300 In-Reply-To: <3889a52-3fe4-c28-1c3b-a73412a489@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> 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: 8bc61daa-eed1-11ec-b37d-bffb39eeb8b0 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UZmE2ODIzMDQ4YWQ5MGEyMS1NMmJmNWRmNGUwMTg0YmRmZjgwYzll?= =?UTF-8?B?ZWU5Pg==?= 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:M2bf5df4e0184bdff80c9eee9:1:7P7mixP4DlVNfuwvHHaBabqhR_HJgqqcvNCwf2vkq6w =D0=92 =D0=9F=D1=82, 17/06/2022 =D0=B2 21:15 +0000, adr =D0=BF=D0=B8=D1=88= =D0=B5=D1=82: > On Fri, 17 Jun 2022, andrey100100100@gmail.com=C2=A0wrote: > > Seems like noted() call not needed in user code. >=20 > noted() is only needed when using the syscall notify, when using > atnotify() (or threadnotify) you don't need it, as it is said in > notify(2) and you did correctly in your first example. threadnotify > doesn't kill your process if there is no space free in onnote[], > onnotepid[], the handler is not registered, that's all. alarm() > should send the note to the process and the first handler registered > with the note "alarm" should be executed. Your handler checked for > the note and returned non zero, the process should continue. When > read is interrupted, it should return an error, the process should > not be killed. Here is the issue. Comment the read statement and > there will be the same number of "end"s as "start"s. >=20 =D0=9Core clear example, which demonstrate crux of the problem: --------------------------------------------- #include #include #include static int handler_alarm(void *, char *msg) { if(strstr(msg, "alarm")){ return 1; } return 0; } static void proc_func(void *) { if(threadnotify(handler_alarm, 1) =3D=3D 0){ fprint(1, "handler not registred\n"); } alarm(2000); fprint(1, "start\n"); sleep(10000); fprint(1, "end\n"); alarm(0); threadexits(nil); } int mainstacksize =3D 5242880; void threadmain(int argc, char *argv[]) { for(int i =3D 0; i < 80; i++){ proccreate(proc_func, nil, 10240); } sleep(5000); threadexitsall(nil); } --------------------------------------------- cpu% 6.out | grep end | wc -l 33 Problem in unregistered handlers. > 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. Regards, Andrej ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tfa6823048ad90a21-M2bf5d= f4e0184bdff80c9eee9 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription