From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25008 invoked by alias); 24 Mar 2018 22:09:53 -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: List-Unsubscribe: X-Seq: 42524 Received: (qmail 5826 invoked by uid 1010); 24 Mar 2018 22:09:53 -0000 X-Qmail-Scanner-Diagnostics: from mail-pl0-f46.google.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(209.85.160.46):SA:0(-1.9/5.0):. Processed in 1.292818 secs); 24 Mar 2018 22:09:53 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=9J2AuPT6zE7s1POwMMXWGz0F90ZPdoNAlIktrro8K8E=; b=BY8CS51QvUxLqRpkyfVekjGs2FKd9qHycdgdDabrvhSql3olXF15SRpx1O15//kwfo P7pugGDgXtS9G1VhCxhHPp7ZpJi3wY7FDX7K6qMgTcE2BFWAjtdR7LAUs9cv+kV5RKfT Ir5/ZznyQCJIG4o/sPnTPUX7lai8jXfqWu0YToTIpC+nUFIZyXIRvB+9uCWEfH1q8wlA v6lRuqoShu+FFIavYuja/T+EWYOqCrZ8hctJOs0XdRsKX6yxWwcc6VDW5vVLdDQKgGNx TJSXHZG4JdwHUOSOQUoiVoWOzX6ltIh5tHrMAKQgtjTi+fsZs8Jng3y5zFOenIQXJaC1 /urQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=9J2AuPT6zE7s1POwMMXWGz0F90ZPdoNAlIktrro8K8E=; b=J8KWJtmgwxxWwSkpTBxBV+NMk873RMMxKZVif22wDzxXGA75syQa2WSO7dD6id522O XQ0muGS7yYv9hQaWPU0IJx/QAsqIHXVaUB4lV2+PsfVBzjRRfZ2pFXHMkYRIBeTofYNl wfhk22ZtrPemw6pboGjkGqhZn2jequDk5PuiOi+4uUQ6/FMjpuCD4qPOf/iE47ERBFhi BoldtkAicVvq0Z3mV0wDF8fR1ALiP/yn9MUD+p/BKouh72OW3769jX4AZlV1Yhp4yR/8 2flMW9QMVK8vylSY6M9SzyBk6lj80o5+ENwCWN8geyca0YHhHS61/RRBh7AR/qZyP2pU A0vQ== X-Gm-Message-State: AElRT7GQTi6OHoksOToSGjmRiSXtAdUjFnmyz+BrVlWhaVB5OC1RAMDA eShmn33O3gusJUPxX9mJP7/DnFMt X-Google-Smtp-Source: AG47ELtAtXXwR2mAxqwnh4a33HxzQ72KmGCShq99O3TQid4F2P+iuLx707h7n3eeNY8AOsdOKOYX1Q== X-Received: by 2002:a17:902:7790:: with SMTP id o16-v6mr10656260pll.294.1521929388974; Sat, 24 Mar 2018 15:09:48 -0700 (PDT) From: Bart Schaefer Message-Id: <180324150945.ZM32251@torch.brasslantern.com> Date: Sat, 24 Mar 2018 15:09:44 -0700 In-Reply-To: <20180324080514.txxyrb3qiztu4pqt@gmail.com> Comments: In reply to Joey Pabalinas "Re: "echo | ps -j $(:) | cat | cat | cat" runs components in different process groups" (Mar 23, 10:05pm) References: <20180323161612.GB4857@chaz.gmail.com> <180323163614.ZM10192@torch.brasslantern.com> <180323221959.ZM27569@torch.brasslantern.com> <20180324080514.txxyrb3qiztu4pqt@gmail.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: "echo | ps -j $(:) | cat | cat | cat" runs components in different process groups MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 23, 10:05pm, Joey Pabalinas wrote: } } > It could be I just haven't constructed the right test. } } It's kind of an *incredibly* unlikely edge-case but FWIW: } } > $ echo | ps -j $(: $(cat)) | cat | cat | cat } } The shell _seems_ to completely lock up after applying your patch; on } my zsh 5.4.2 release version there are no problems (aside from the } original process group leader issues). Hmm. The parent shell has received a SIGTTIN signal during readoutput() even though the descriptor from which it is reading is not a TTY. This is because the tty process group is still that of the deceased job leader, and $(cat) is in the new process group owned by the parent, so when $(cat) is stopped the process group stops as well. The parent needs to reattach to the terminal when reaping the group leader, so that $(cat) doesn't get SIGTTYIN and so that the parent begins receiving tty interrupts etc. again. I'm not yet sure exactly where that should happen.