From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 892 invoked by alias); 23 Sep 2016 06:07:44 -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: 39421 Received: (qmail 1771 invoked from network); 23 Sep 2016 06:07:44 -0000 X-Qmail-Scanner-Diagnostics: from out2-smtp.messagingengine.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(66.111.4.26):SA:0(0.0/5.0):. Processed in 0.625926 secs); 23 Sep 2016 06:07:44 -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=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=ZEO5el6mPUDVamPR0NWf4WAVPZU=; b=ZHmd2C D0sbFvv5EGioGbWm8vDiaHHt9kupusfr+mjJqdTVY8x8U/xFlz2493EaksGpioFW PfzMWRstMGHC7LyLfYqVVZpVXWyNWDk4a+khMYlnGGf9P95w9R/hbD1RjfSbYRu3 M09YkCR4YTYJVFNO8WzrHQ7X5G5cydUSHDRNI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=ZEO5el6mPUDVamPR0NWf4WAVPZU=; b=Ssc/p LxvSQjCnYKEulp+DElv4BbgugcxzZ9k3ijI4a657Z+9KRJu55EWXOrU0mW+YcrIT vvOJ9Z2Zx5ERCHdIder3102LHWqtqVhGoSyU7LpTVDUFw73vsDB0vfPiZGR1faSO douuvJcOXwpC1HxN3OTUOgv7U6UXah7wuEWdZs= X-Sasl-enc: uJ5Dgxl3Ss00imURZRCBnekMssHprLksW33GMC5x5urB 1474610853 Date: Fri, 23 Sep 2016 06:06:24 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: Re: Bug related to stdin/always/jobcontrol Message-ID: <20160923060624.GA2843@fujitsu.shahaf.local2> References: <87r392jgd0.fsf@juno.home.vuxu.org> <20160905164207.4630643b@pwslap01u.europe.root.pri> <20160914183105.69862fa9@pwslap01u.europe.root.pri> <20160914223553.3173c8ca@ntlworld.com> <20160922115921.GA3613@fujitsu.shahaf.local2> <160922093838.ZM7266@torch.brasslantern.com> <160922181847.ZM22524@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <160922181847.ZM22524@torch.brasslantern.com> User-Agent: Mutt/1.5.23 (2014-03-12) Bart Schaefer wrote on Thu, Sep 22, 2016 at 18:18:47 -0700: > However, in attempting to figure it out, I found some sixteen-year-old > code that is clearly wrong: > > diff --git a/Src/exec.c b/Src/exec.c > index d924148..bf97b5c 100644 > --- a/Src/exec.c > +++ b/Src/exec.c > @@ -1702,7 +1702,7 @@ execpline(Estate state, wordcode slcode, int how, int last1) > jobtab[list_pipe_job].other = newjob; > jobtab[list_pipe_job].stat |= STAT_SUPERJOB; > jn->stat |= STAT_SUBJOB | STAT_NOPRINT; > - jn->other = pid; > + jn->other = list_pipe_job; > jn->gleader = jobtab[list_pipe_job].gleader; > } > if ((list_pipe || last1) && hasprocs(list_pipe_job)) > > jn->other is a job table index, not a process ID. However, (a) I don't > know if list_pip_job is the right value (although a few lines earlier > list_pipe_pid = pid is assigned, so it would seem to makes sense) and > (b) that this has never caused a wild pointer dereference in all this > time seems to indicate that this code is never actually reached. The code does get reached: if you do . % f() vim % f ^Z . at a new shell, it executes the line you changed. Perhaps nothing reads the value assigned to jn->other, though? > I don't have any more time to look at this now; hoping this information > is helpful to PWS if he has a chance to look when he wakes up on Friday. >