From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5708 invoked by alias); 15 Sep 2016 17:50:55 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39350 Received: (qmail 9780 invoked from network); 15 Sep 2016 17:50:55 -0000 X-Qmail-Scanner-Diagnostics: from mailout3.w1.samsung.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(210.118.77.13):SA:0(-2.2/5.0):. Processed in 0.475339 secs); 15 Sep 2016 17:50:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at samsung.com does not designate permitted sender hosts) X-AuditID: cbfec7f2-f79556d000002c42-2a-57dadd1c2154 Date: Thu, 15 Sep 2016 18:40:40 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Bug related to stdin/always/jobcontrol Message-id: <20160915184040.5fc1b9d0@pwslap01u.europe.root.pri> In-reply-to: <20160915113315.1655019c@pwslap01u.europe.root.pri> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLIsWRmVeSWpSXmKPExsWy7djPc7oyd2+FG8yezmdxsPkhkwOjx6qD H5gCGKO4bFJSczLLUov07RK4Mq4eXsJUsI6vYt6zvewNjFu5uxg5OSQETCTWff/NCGGLSVy4 t56ti5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+ZRxImFPAQWLdnulsILaQwBZmiVuvFUBs fgF9iat/P0GdZy8x88oZsJG8AoISPybfAxvJLKAlsXlbEyuELS+xec1bZog56hI37u5mn8Ao PAtJyywkLbOQtCxgZF7FKJJaWpybnltsqFecmFtcmpeul5yfu4kRGEXbjv3cvIPx0sbgQ4wC HIxKPLwBs2+FC7EmlhVX5h5ilOBgVhLhLb4FFOJNSaysSi3Kjy8qzUktPsRoCgyXicxSosn5 wAjPK4k3NDE0tzQ0MrawMDcyUhLnLflwJVxIID2xJDU7NbUgtQimj4mDU6qBUeXGVpmrR47f NGYrCai/dolluVJMwIWDtwNznzw8F6IZt6I32nCC2Q8BrarJN4MuLRQKuiFyozF7waJXa2p3 qJwVrfa/elLj9TO5gOKVwc6ZM5d2JRyzOs6hqh+vvT8q0TFsvbasSMSj3RrBlYqOx7ybzIoT 6gS/lv38Gd3rFr+yIrnp1PZjSizFGYmGWsxFxYkAV+2oELgCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20160915174043eucas1p22e5d178627c7f5f4ead8144c13fcb949 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?UGV0ZXIgU3RlcGhlbnNvbhtTQ1NDLURhdGEgUGxhbmUb?= =?UTF-8?B?7IK87ISx7KCE7J6QG1ByaW5jaXBhbCBFbmdpbmVlciwgU29mdHdhcmU=?= X-Global-Sender: =?UTF-8?B?UGV0ZXIgU3RlcGhlbnNvbhtTQ1NDLURhdGEgUGxhbmUbU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtQcmluY2lwYWwgRW5naW5lZXIsIFNvZnR3YXJl?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDA1Q0QwNTAwNTg=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20160914173110eucas1p1f0567e319ae439b975b19f4e55676fed X-RootMTR: 20160914173110eucas1p1f0567e319ae439b975b19f4e55676fed References: <87r392jgd0.fsf@juno.home.vuxu.org> <20160905164207.4630643b@pwslap01u.europe.root.pri> <20160914183105.69862fa9@pwslap01u.europe.root.pri> <20160914223553.3173c8ca@ntlworld.com> <160914202450.ZM32479@torch.brasslantern.com> <20160915092721.3d669bc9@pwslap01u.europe.root.pri> <20160915113315.1655019c@pwslap01u.europe.root.pri> On Thu, 15 Sep 2016 11:33:15 +0100 Peter Stephenson wrote: > Still issues here --- I tried the last patch on another machine and it's > OK up to the point where you resume and then exit the job, at which > point vim exits cleanly but the new superjob (the forked zsh) is > continued but suspends itself again. Sending it SIGCONT causes it to > exit normally, so this looks like a race. I'm a bit stuck on this. The race is related to the fact that when the new SUPERJOB takes over it's actually in the same process group as the SUBJOB it's taking over, which is different from it's own PID, list_pipe_pid, that the code currently assumes is the pgrp (and is indeed the pgrp in the cases where everything works --- I've again verified the code on a different machine here and get the impression faster machines work better). However, fixing that up doesn't help --- apparently attaching it to the TTY after the SUBJOB is finished works OK, sending it SIGCONT seems to be OK, but then it always gets SIGSTOP --- and sending it SIGCONT from the keyboard allows it to finish. So I have no idea why it's being stopped after the first SIGCONT. (I tried putting it from the main shell into a new process group of its own; that succeeds, but still doesn't help.) Stepping through the forked zsh that was stopped doesn't suggest anything, either, as it just executes the remainder of the shell code in the v function. However, I should have another look at the point where it gets the pukka SIGSTOP (the one that keeps it out of the way until the SUBJOB has finisehd) to make sure I'm not missing something there. I think the code is enough better that I may submit it and wonder what to do with the remaining problem later, or let Bart have a go when he gets some time. pws