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=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13991 invoked from network); 18 Jul 2021 22:56:33 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 18 Jul 2021 22:56:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Subject:To:From:Date: References:In-Reply-To:Message-Id:Mime-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=FgL2iXgfXFHLS9Vu5VzxvmPyqRAUwl+ajL6AKiGGo+w=; b=YDylKdK5m1kKRjq4ABbszkyblr TIRYzMLgMdqOJvUxfCyfgAo5EUwhrIe5QHg6RxoP7k3pGv2lG9dArXR+QUfaIt7Z7EBAI8hX2cboZ AMIRKw+nVXRFyLu9i4fXFVkA311i0V6rQpbHTRyYGDuDSzoJ5MWuLGW3Quv2hrTVWiewHGjCOImyC 4bbtFtgYpJ4LTb6lw6Y92meL8gLSwCos0I1kles2+eW7LPjmrstqxwIcgeQuBS7eol78oBWxXOesQ 60SaUaVcd2fFrydBnj9EFWBXf2B5l34nYK3YNTdlO5JRsU3Z+RD0+n+fmJaC15MvZMTKiil2Z1e4Z p65bNHVA==; Received: from authenticated user by zero.zsh.org with local id 1m5Fi4-000EL1-GA; Sun, 18 Jul 2021 22:56:32 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1m5Fhn-000E13-BA; Sun, 18 Jul 2021 22:56:16 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 4638927C0054 for ; Sun, 18 Jul 2021 18:56:14 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute3.internal (MEProxy); Sun, 18 Jul 2021 18:56:14 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdelgdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesthdtre dtreerjeenucfhrhhomhepnfgrfihrvghntggvpgggvghljoiiqhhuvgiiuceolhgrrhhr hihvseiishhhrdhorhhgqeenucggtffrrghtthgvrhhnpeevfeeugffgvdelhfelleeuge eitedufeetffdtleduleehgefhiefgieehkedvieenucffohhmrghinhepiihshhdrohhr ghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrg hrrhihvhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudduhedukeejjedt gedqudduledvjeefkeehqdhlrghrrhihvheppeiishhhrdhorhhgsehfrghsthhmrghilh drtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id CC47BA03997; Sun, 18 Jul 2021 18:56:13 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-533-gf73e617b8a-fm-20210712.002-gf73e617b Mime-Version: 1.0 Message-Id: In-Reply-To: <823a57a39d8873ce30d2806d95a1c540cf0fe2f2.camel@ntlworld.com> References: <20210607172753.222432-1-epaulson10@gmail.com> <823a57a39d8873ce30d2806d95a1c540cf0fe2f2.camel@ntlworld.com> Date: Sun, 18 Jul 2021 18:55:08 -0400 From: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= To: zsh-workers@zsh.org Subject: Re: [PATCH] Do not send duplicate signals when MONITOR is set Content-Type: text/plain X-Seq: 49174 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Mon, Jun 14, 2021, at 3:19 PM, Peter Stephenson wrote: > On Mon, 2021-06-07 at 11:45 -0700, Bart Schaefer wrote: > > On Mon, Jun 7, 2021 at 10:28 AM Erik Paulson wrote: > > > > > > I run emacs as a daemon and use the emacsclient program to connect to > > > it. I noticed that when I suspended the emacsclient program and > > > resumed it in zsh, the program would sporadically crash. After digging > > > into the code, I realized that emacsclient was receiving two SIGCONTs, > > > which caused it to send a malformed command to the daemon. > > > > > > I found that this return used to be present, but was removed in > > > https://www.zsh.org/mla/workers/2018/msg01338.html while addressing > > > another emacs issue. > > > > I don't think it was removed ... similar code was added in two > > separate places, but the "return" was only added in one of those. > > > > Your patch adds that return in the second case. > > > > The difference is that in the first case, the SIGCONT is received by a > > job that is marked STAT_SUPERJOB and in the second case it's received > > by a different job. > > > > I believe this means that in the former case the superjob is in the > > foreground and in the second case, it isn't -- rather one of its > > subjobs is. In the first instance zsh sends the signal to all the > > subjobs and then to the process group. In the second case it sends > > the signal to the process group first and then falls into the loop > > sending the signal to any subjobs that still appear to be stopped. > > > > In any case I think a potential problem with placing an unconditional > > "return" where your patch does, is that signals other than SIGCONT > > probably still need to be delivered to the subjobs. PWS, any input > > here? > > Hmm, it's not clear to me in what cases you'd need to deliver both > killpg() to the group leader and then kill to the processes. You might > hope if the shell was doing the right thing the first would be enough. > But there might be special cases. > > I would hazard that as SIGCONT is probably the most difficult case --- > the only one where you specifically want the process to be running > afterwards --- if this patch improves things there, it's prohably not > doing a lot of harm in most cases. > > It's not impossible there are some oddities where process groups aren't > set up quite how you want that this might affect, but I doubt we're > going to spot them just by staring. Anything else on this? -- vq