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=-2.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14626 invoked from network); 17 Jun 2022 16:12:15 -0000 Received: from tb-ob1.topicbox.com (64.147.108.173) by inbox.vuxu.org with ESMTPUTF8; 17 Jun 2022 16:12:15 -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 379DF32DB7 for ; Fri, 17 Jun 2022 12:12:15 -0400 (EDT) (envelope-from bounce.mM687ef3adb4df6c21a188e7e1.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx0.topicbox.com (Postfix, from userid 1132) id 3579928D61B2; Fri, 17 Jun 2022 12:12:15 -0400 (EDT) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=pass (1024-bit rsa key sha256) header.d=posixcafe.org header.i=@posixcafe.org header.b=dJxBGfeT header.a=rsa-sha256 header.s=20200506 x-bits=1024; dmarc=pass policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=posixcafe.org; spf=pass smtp.mailfrom=moody@posixcafe.org smtp.helo=mail.posixcafe.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=message-id:date:mime-version:subject:to :references:from:in-reply-to:content-type :content-transfer-encoding:list-help:list-id:list-post :list-subscribe:reply-to:list-unsubscribe; s=sysmsg-1; t= 1655482335; bh=mrrQq2tIsi78aik+ts8u9JjRihmrAJjO9QY2l6UFzgs=; b=b tw2eBdf7XprLpyZTIdj09irlgqCLyVzRBpi87f71jAI3pX9qqepcJhlSRyLWL4t3 qoRqb54W+wWOrLigREb5BKrWjoxNQVzgy6oMbk4/iKs7C+UHTR55DkmMUthfmAMk GJzE5feb9PH4d6wgGYBDex+tJYU53n1zUxTS97jlIs= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1655482335; b=rqQByKsyYSjvba5HtWzeH7MyhcTfJz8jDgS+YzDsrQLT7Iacx8 /Ui700QUyYIuXoKUvPn0VYRahxpBeOeOd+xczVreB1iCNV12jG+2QzLjomp0Umne lFiyO9V/bBoTvEU9E9BGN/7D4MSYhn7e0t1Lly8NEUB+HYrFJxmscnz7Y= Authentication-Results: topicbox.com; arc=pass; dkim=pass (1024-bit rsa key sha256) header.d=posixcafe.org header.i=@posixcafe.org header.b=dJxBGfeT header.a=rsa-sha256 header.s=20200506 x-bits=1024; dmarc=pass policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=posixcafe.org; spf=pass smtp.mailfrom=moody@posixcafe.org smtp.helo=mail.posixcafe.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-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (1024-bit rsa key sha256) header.d=posixcafe.org header.i=@posixcafe.org header.b=dJxBGfeT header.a=rsa-sha256 header.s=20200506 x-bits=1024; dmarc=pass policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=posixcafe.org; iprev=pass smtp.remote-ip=45.76.19.58 (mail.posixcafe.org); spf=pass smtp.mailfrom=moody@posixcafe.org smtp.helo=mail.posixcafe.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mail.posixcafe.org policy.ptr=mail.posixcafe.org; x-return-mx=pass header.domain=posixcafe.org policy.is_org=yes (MX Records found: mail.posixcafe.org); x-return-mx=pass smtp.domain=posixcafe.org policy.is_org=yes (MX Records found: mail.posixcafe.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=message-id :date:mime-version:subject:to:references:from:in-reply-to :content-type:content-transfer-encoding:list-help:list-id :list-post:list-subscribe:reply-to:list-unsubscribe; s=dkim-1; t=1655482335; x=1655568735; bh=f7YbAqYHAjFz5Y6FGjcBIBmX+LLyjcbr yWn6qyZjZv4=; b=V0s/35uS7WwgvHvUKIH8lyIAE31FUhtKcyn1s0vpMdwUPlKi NqbfMe18a6Jhls37eZga36N19g3flRz7ITvIIf6PjTOptsec11F8d8Dsg/UaxWAL Ik5iqekOA6Ewd3rmCU5/PUjyGnTbKRFx3BYtDi9R5Xc7ALFlSbdWeSIkwYA= Received: from tb-mx0.topicbox.com (localhost.local [127.0.0.1]) by tb-mx0.topicbox.com (Postfix) with ESMTP id 30F6128D5CDC for <9fans@9fans.net>; Fri, 17 Jun 2022 12:11:59 -0400 (EDT) (envelope-from moody@posixcafe.org) Received: from tb-mx0.topicbox.com (localhost [127.0.0.1]) by tb-mx0.topicbox.com (Authentication Milter) with ESMTP id 12A922F12ED; Fri, 17 Jun 2022 12:11:59 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1655482319; b=KA+p7dTP0Vat2hstQZm0WRfhyOa6OBgnDKkm5P0zjkUqz7FiIn 0G5qa2oNgotlS75UzG48gGCYIunNC+HrpsQ7EfnzR2erFeDW/W+nnAgQNoKt6Bm7 l0DsUHYpEBdZWRACEtolhzJ/rcEimW+7jFm3+ePfyT7Jl99WqerXxkXKVwJkvOYJ wPOKnmYkaWlxpx4axZRrrNAG2NB6cF8kWJ5C+xB50rvoHClu8cfeE7cwXYKvQEqJ rwTNLhaLrhmAuIvuFMC7gqS9QP8JCUtgNNIaQIR80dUqCVWYebCX/8YlUbUK1i1S oz/STZY51p/b3ND3xgEJdYC1MBoPzC7MIhBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=message-id:date:mime-version:subject:to :references:from:in-reply-to:content-type :content-transfer-encoding; s=arcseal; t=1655482319; bh=n6/wGvEE fVtlniQzB1ARwCZkzROuOOVtiXdTtOhz8LY=; b=DK2yN7nh3pEGzOfs4bXqWbbJ RoCtZHMHHMovTY6OUzSlNTMrOsLqBVlXyBQLUOno2eDo8fbQlXHmnIvxAiDyvKM+ kwrQDpxei84rbzlwCt8jlHmYSM1+vQM2bNwgyWRqCHz4OzhSfUZqj5CXm0efN78a BXm82Z31ECIvsx8SqoIuFh1HKEw9HTc1meKvbKC0Y9c91eFu+yLwkAU8rkAK/TCr uqYaiFucyJaN+k39CLgJabOeyLl4KK25o1He+EYjR4dA56d8vPhbqWr0B8kIG2M8 sAyM8F24qbmYCqK1dUuHOeVCAXYBXeUQpBmsmhct6zYNJsSgYGvfKGIl/3c1IQ== ARC-Authentication-Results: i=1; tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (1024-bit rsa key sha256) header.d=posixcafe.org header.i=@posixcafe.org header.b=dJxBGfeT header.a=rsa-sha256 header.s=20200506 x-bits=1024; dmarc=pass policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=posixcafe.org; iprev=pass smtp.remote-ip=45.76.19.58 (mail.posixcafe.org); spf=pass smtp.mailfrom=moody@posixcafe.org smtp.helo=mail.posixcafe.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mail.posixcafe.org policy.ptr=mail.posixcafe.org; x-return-mx=pass header.domain=posixcafe.org policy.is_org=yes (MX Records found: mail.posixcafe.org); x-return-mx=pass smtp.domain=posixcafe.org policy.is_org=yes (MX Records found: mail.posixcafe.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: gggruggvucftvghtrhhoucdtuddrgedvfedruddvhedgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfg fuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeflrggtohgsucfoohhougihuceo mhhoohguhiesphhoshhigigtrghfvgdrohhrgheqnecuggftrfgrthhtvghrnheptddtvd eutdeiieevgffghfeiteeggeeigeeuteevhfekkeegjeegvdevtddvgeeknecukfhppeeg hedrjeeirdduledrheekpdduiedurdeljedrvddvkedrudefheenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepihhnvghtpeeghedrjeeirdduledrheekpdhhvghlohep mhgrihhlrdhpohhsihigtggrfhgvrdhorhhgpdhmrghilhhfrhhomhepoehmohhougihse hpohhsihigtggrfhgvrdhorhhgqe X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (posixcafe.org: 45.76.19.58 is authorized to use 'moody@posixcafe.org' in 'mfrom' identity (mechanism 'mx' matched)) receiver=tb-mx0.topicbox.com; identity=mailfrom; envelope-from="moody@posixcafe.org"; helo=mail.posixcafe.org; client-ip=45.76.19.58 Received: from mail.posixcafe.org (mail.posixcafe.org [45.76.19.58]) (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>; Fri, 17 Jun 2022 12:11:58 -0400 (EDT) (envelope-from moody@posixcafe.org) Received: from [192.168.168.200] (161-97-228-135.lpcnextlight.net [161.97.228.135]) by mail.posixcafe.org (OpenSMTPD) with ESMTPSA id 4b66005d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <9fans@9fans.net>; Fri, 17 Jun 2022 11:11:57 -0500 (CDT) Message-ID: <0e5677e6-684d-ff37-c6cd-430d18536070@posixcafe.org> Date: Fri, 17 Jun 2022 10:11:05 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [9fans] syscall silently kill processes Content-Language: en-US To: 9fans@9fans.net References: <79286caa2ca77ea9b9a1cd64918bdc5f28c8f180.camel@gmail.com> <9e922645a598c69ba14b74e18e8669cc068e9717.camel@gmail.com> From: Jacob Moody In-Reply-To: <9e922645a598c69ba14b74e18e8669cc068e9717.camel@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 3cf44acc-ee58-11ec-84f1-ebf13c520e96 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UZmE2ODIzMDQ4YWQ5MGEyMS1NNjg3ZWYzYWRiNGRmNmMyMWExODhl?= =?UTF-8?B?N2UxPg==?= 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:M687ef3adb4df6c21a188e7e1:1:Yupk_7zwORh7L0cdURm0gq2PGUKuX7bkTkBdE6Vygt0 On 6/17/22 09:06, andrey100100100@gmail.com wrote: > =D0=92 =D0=9F=D1=82, 17/06/2022 =D0=B2 08:11 -0600, Jacob Moody =D0=BF=D0= =B8=D1=88=D0=B5=D1=82: >> On 6/17/22 07:46, Thaddeus Woskowiak wrote: >>> I believe threadnotify() should be called from threadmain() to >>> properly register the handler in the rendez group >> >> This is incorrect, according to thread(2): >> >> "The thread library depends on all procs >> being in the same rendezvous group" >=20 >=20 > From sleep(2): >=20 > Alarm causes an alarm note (see notify(2)) to be sent to the > invoking process after the number of milliseconds given by > the argument. >=20 > Mean to be sent only to the invoking process, NOT to the process group. Yes this is correct, If I implied otherwise I apologize. My point with pointing out that excerpt is that groups likely had nothing to do with this. >> >> The issue here is that your note handler has to call noted, >> you are returning from the handler without actually resuming the >> program. >> You either need to call noted(NCONT) to resume execution or >> noted(NDFLT) >> to stop execution. >> >> An excerpt from notify(2): >> >> "A notification handler must finish either by exiting the >> program or by calling noted; if the handler returns the >> behavior is undefined and probably erroneous." >> >> So you are indeed observing undefined behavior. >> >=20 > With: >=20 > ------------------------------------ > static int > handler_alarm(void *, char *msg) > { > if(strstr(msg, "alarm")){ > noted(NCONT); > return 1; > } >=20 > return 0; > } > ------------------------------------ > result the same: >=20 > cpu% 6.out | grep end | wc -l > 33 >=20 >=20 > And noted(NCONT) may be needed, when process recieved many (2 and more) > notes at once. >=20 > May be something wrong with interrupted an incomplete system call? You _always_ should call either noted(NCONT) or noted(NDFLT). But you are correct in that this wasn't the exact issue. I poked around with the code a bit. I rewrote it to just use fork(), and I got all 80 "end" messages. So I suspected libthread had some arbitrary limit: #define NFN 33 #define ERRLEN 48 typedef struct Note Note; struct Note { Lock inuse; Proc *proc; /* recipient */ char s[ERRMAX]; /* arg2 */ }; static Note notes[128]; static Note *enotes =3D notes+nelem(notes); static int (*onnote[NFN])(void*, char*); static int onnotepid[NFN]; static Lock onnotelock; int threadnotify(int (*f)(void*, char*), int in) { int i, topid; int (*from)(void*, char*), (*to)(void*, char*); if(in){ from =3D nil; to =3D f; topid =3D _threadgetproc()->pid; }else{ from =3D f; to =3D nil; topid =3D 0; } lock(&onnotelock); for(i=3D0; i