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,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11377 invoked from network); 21 Jun 2022 13:22:18 -0000 Received: from tb-ob0.topicbox.com (64.147.108.117) by inbox.vuxu.org with ESMTPUTF8; 21 Jun 2022 13:22:18 -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 D54CF18EC7 for ; Tue, 21 Jun 2022 09:22:17 -0400 (EDT) (envelope-from bounce.mM198ebde18601eb82a1a5b8d8.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx0.topicbox.com (Postfix, from userid 1132) id CF3D32960ECF; Tue, 21 Jun 2022 09:22:17 -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=1655817737; bh=MSKoq4Nt+OqBszl5 p5oD62I2/ZHj1Qr13WXCfidU72Y=; b=Y57s7v99W0Sc6enP3rTPJQnZlP4OKCsp v0m2+zSzIHS9+isq94mTzlggYW+Ts64gwETAv7LjQSq9ScAngO0Pt1PyUL5GhkYK l68F1Em2SNcxmGpP/TH2vGe/TcdcPJ9CRDKuWU3HFIGJkeOSJRFV6i6gxFVJjfas XiawIgEcYaw= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1655817737; b=Kqz6YPthokQxRaHbZzv5tuuuz/cikEkkWUoLRnqqq1ILNVONPH w/PPXGSaUe293DnkzW1jnCc6mF25/WMMoUHSx07aW6q2dZVMy/EOk7Jh4IRTnHxx sfkXbEdyC6fwFriF0P0PTXJ4/J0WM4V6i5EQsI1BHgcAQqwbdLQ/GF7qE= 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=1655817737; x=1655904137; bh=TWBluiMJsY/DnZjvsNO0qyQSzE4gZxci 2LECxbFFJmE=; b=iwadozqbp3nqhsfS06C7aegHe2HxxQfHIYOCAEiBRvR3ciFb 73ndGHJ4RA8GETJLdTvNocpZi37igmBEccCXPLJvmGS5SMUanOkzZq35c95NVSAJ xd/zkMPmAwm4QM+xuSc4ryH8w21BcH7LO3wzgVSwptOF9tFZi1VVf7D25cs= Received: from tb-mx1.topicbox.com (localhost.local [127.0.0.1]) by tb-mx1.topicbox.com (Postfix) with ESMTP id CDB02159412D for <9fans@9fans.net>; Tue, 21 Jun 2022 09:22: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 FC452F08928; Tue, 21 Jun 2022 09:22:05 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1655817725; b=DOPCs0gDsSdFs3h2FloiaG/yqk7ORy2NsYw7A6k7FkW7V5HR2a Z26yrbz911wxJwThh3pvg9DXn6CskTWrQ2ZsZFOrbVfGfMpVTd5OmCe/oh2xvHqb RKqvpKUGGuCmBFIOQE1xKSOYD8Z/TKKKeEmcx8geFTzAOQp8f/3Zrhr4pOmVtily U4D999g7tUlG/B/RgZqoTJBO3+wp38zek1MCFto/48665X/Ze1ytvONLybgKMBeU jGKVp26DrQ0tX10wtiWfiyVohjBnddcm683hNe/OY7shGTfHM3HwvPduJFKnOhpE hXBXPSzzvUQ7pN/mtaXW7efsHwO59/RgQN8g== 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=1655817725; bh=MGm3xXhqELwY9+BhU8ydUGUOLM7eBG2YNRjVCUcNNBQ=; b=A2tkFgXyX7xd WZZuNzuIsJSO5vSjKFMDLA7DcIin4LDChWzIq+Dz9bzNH/YkcR/zePAfbm0kFGYo j+tXG7vgi1Q/FYtqxZ2oUaUdRyKxjSERBhJDOMoTlO+UgdCrvicHJaQOGZ1Y/oIn 8qqurzrAcLOt6muVR8nzsDWNMx543DK0KmkzgkJLhtfG4pp1V2H9Fhl9cvlkaEQh jCPe5VaQ/9RwsrKo5vJ+jstLW8lOsOxQRNQHYRZn1ERBnkTlJkFse3+cIXHc7AU/ j8YTT73PLbfgyxAfxfIiJ3Vc+cwIk3EtDZHbnPXI9smY5GRx5Wq/ITtgMxJfCZ0H DVrUlIEQRQ== 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: gggruggvucftvghtrhhoucdtuddrgedvfedrudeffedgieefucetufdoteggodetrfdotf 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>; Tue, 21 Jun 2022 09:22:04 -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 25LDM3xd000187 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for <9fans@9fans.net>; Tue, 21 Jun 2022 13:22:03 GMT Received: from localhost (adr@localhost) by sdf.org (8.15.2/8.12.8/Submit) with ESMTP id 25LDM20q017574 for <9fans@9fans.net>; Tue, 21 Jun 2022 13:22:02 GMT Date: Tue, 21 Jun 2022 13:22:02 +0000 (UTC) From: adr To: 9fans <9fans@9fans.net> Subject: Re: [9fans] syscall silently kill processes In-Reply-To: Message-ID: <9307b24-ba87-e7b0-342e-71bf83835ed@SDF.ORG> References: <2b857fe-c6df-a6b8-40ec-566c85b7377d@SDF.ORG> <770c427561d318ba28f7f4fb820577398f49fef8.camel@gmail.com> <7d9742ec-51f0-34d1-714-6f308975da34@SDF.ORG> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 2849a45e-f165-11ec-81ae-b94a76284ceb Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UZmE2ODIzMDQ4YWQ5MGEyMS1NMTk4ZWJkZTE4NjAxZWI4MmExYTVi?= =?UTF-8?B?OGQ4Pg==?= 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:M198ebde18601eb82a1a5b8d8:1:siej7CzESqKas7_gm8kWhLkdVxS5VoeIN5AfkxSJElg On Tue, 21 Jun 2022, andrey100100100@gmail.com wrote: >> For example, let's remove note.c. You could obtain the same result Just for clarity, you actually don't need to remove note.c to do what I said below. >> in your example (all processes using the same handler) using atnotify >> because the notes are registered to the children when proccreate >> uses rfork: >> >> void >> threadmain(int argc, char *argv[]) >> { >> atnotify(handler_alarm, 1); >> >> ./5.out | grep end | wc -l >> 80 >> >> If you have to use a different handler for each processes you can't >> use atnotify because of RFMEM, but you can use the syscalls notify >> and noted: >> >> #include >> #include >> #include >> >> static void >> handler_alarm(void *, char *msg) >> { >> if(strstr(msg, "alarm")){ >> print("yes"); >> noted(NCONT); >> return; /* just in case */ >> } >> noted(NDFLT); >> } >> >> static void >> proc_udp(void *) >> { >> char resp[512]; >> char req[] =3D "request"; >> int fd; >> notify(handler_alarm); >> if((fd =3D dial("udp!185.157.221.201!5678", nil, nil, nil)) >=3D >> 0){ >> if(write(fd, req, strlen(req)) =3D=3D strlen(req)){ >> fprint(1, "start\n"); >> alarm(2000); >> read(fd, resp, sizeof(resp)); >> alarm(0); >> fprint(1, "end\n"); >> } >> close(fd); >> } >> threadexits(nil); >> } >> >> int mainstacksize =3D 5242880; >> >> void >> threadmain(int argc, char *argv[]) >> { >> for(int i =3D 0; i < 80; i++) >> proccreate(proc_udp, nil, 10240); >> sleep(5000); >> threadexitsall(nil); >> } >> >> ./5.out | grep end | wc -l >> 80 >> >> Threadnotify is trying to do an atnotify that works with RFMEM, >> but to do that onnote should be allocated to grow or shrink (or >> have a size thinking in the maximum number of processes the program >> could spawn, not the number of handlers a process could register >> as in atnotify), instead of pointers to handlers, it should be an >> array of pointers to arrays of handlers allocated by each process. >> >> Now again, does the notes mechanism actually fit in libthread? If >> it does it should be fixed, if not removed. > > > I vote for the fix. > Perhaps the notification is being used somewhere or by someone. > > >> >> adr. >> > > Regards, > Andrej ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tfa6823048ad90a21-M198eb= de18601eb82a1a5b8d8 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription