From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 411 invoked by alias); 17 Apr 2018 17:53:06 -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: 42675 Received: (qmail 23158 invoked by uid 1010); 17 Apr 2018 17:53:06 -0000 X-Qmail-Scanner-Diagnostics: from mail-pg0-f47.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(74.125.83.47):SA:0(-1.9/5.0):. Processed in 15.326032 secs); 17 Apr 2018 17:53:06 -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,SPF_PASS, T_DKIM_INVALID,T_SPF_HELO_TEMPERROR 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=bSw0OgTtRtDqRoDwYOGqzMCNKxmh1EGBXgi1Xe/RrYI=; b=QpXnNcKVdjZdF467BxaAccyLOEyZqfzutxc4Sbq6NxKUEgR1nBlndeINyezpcqHjBs +sNrOzXQLdyfyJtF05Oht8gbsGVzvnkllk4JZbnveWy++mqbvFtp/yKPbuDn8CheXBRC IwDeuiwGdY0hhmcSRLT17PZm5KbtXlzEDCf8kglJEjkMQ/G0enxrViws3HoiX1WCtlC1 jNHIYAQ87wTt0UM0LDxXTWBIDksljyaY7xJjV6eHrI6SZi9g4MjjK74DHzzeEUXs+6up 2N89xWdGVTtoK84NC/KduZWSDX61JlmWJuKl6WK1HJSq1LYPbuKHBJa09n6pkQXGZt35 yPAw== 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=bSw0OgTtRtDqRoDwYOGqzMCNKxmh1EGBXgi1Xe/RrYI=; b=jnc/E1ubIRCrtmBbnsoNgiN9wYZcSErlVcwrIucZvhz+KVQOBNSPj/JU3Iahhs86D5 jw/t8STlW2mZDx+77xFEkIo3cphRg3KRcOAujje1952EMgXVe+MwSnG4VtTpB3HFuR0u Ma3gVKoa11nZVR7R6jmwNfuXDqtEZcGDomD+HDnrL9V9pKQSW23+ZIwATTBjg2ssdrn4 5OajyeeQFjg8oXv8qKP56018NYpSGEH7OIWKbJFTVuucCytYlvkCLhgumiTpn+iWR1wy 2cVj0goFl3S2nVO8uqlIfqNrwWQgCLSGsZQhDISL7A3KOp/u+LNmIXGaRhK+Mg9WzJFE 1qpg== X-Gm-Message-State: ALQs6tC5fhuQ365iT3onuM1WgvR3X/Yzb980kctvhb2tkQUwcMAG5CnR Xna2KrQ/Rr9mwR7CGOd3roZJ3xHj X-Google-Smtp-Source: AIpwx4/kYu4Jf4+uT21Nq6kGCxzL1Mkx2AKaBvKoMXlwoczBwXjN386jAuznf2Lj9HXN707z39ZJFQ== X-Received: by 10.98.7.83 with SMTP id b80mr2836887pfd.133.1523987567257; Tue, 17 Apr 2018 10:52:47 -0700 (PDT) From: Bart Schaefer Message-Id: <180417105243.ZM2929@torch.brasslantern.com> Date: Tue, 17 Apr 2018 10:52:43 -0700 In-Reply-To: <20180417173558.769503bd@camnpupstephen.cam.scsc.local> Comments: In reply to Peter Stephenson "Re: "echo | ps -j $(:) | cat | cat | cat" runs components in different process groups" (Apr 17, 5:35pm) References: <180323221959.ZM27569@torch.brasslantern.com> <20180324080514.txxyrb3qiztu4pqt@gmail.com> <180324150945.ZM32251@torch.brasslantern.com> <20180410124545.13fccd5d@camnpupstephen.cam.scsc.local> <20180410145926.64c4f671@camnpupstephen.cam.scsc.local> <180411151025.ZM19332@torch.brasslantern.com> <20180412172342.52df6b10@camnpupstephen.cam.scsc.local> <20180415162326.GA12549@chaz.gmail.com> <20180415185804.GB12549@chaz.gmail.com> <180416223910.ZM32002@torch.brasslantern.com> <20180417101947.5fd347df@camnpupstephen.cam.scsc.local> <180417090926.ZM2456@torch.brasslantern.com> <20180417173558.769503bd@camnpupstephen.cam.scsc.local> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org 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 Apr 17, 5:35pm, Peter Stephenson wrote: } } It's the whole structure of the parsing rather than the resulting word } code (though of course the effect is encoded there). When "time" is } parsed we're at the level of a command, but instead of treating the } arguments as a command (which wouldn't work as we need to time am entire } pipeline), the parser recursively parses a nested pipeline (essentially } --- it's actually called "sublist2" in the parser because it can have } "coproc" or "!" in front, which also apply to the whole pipeline). And sublist2() still stops at the "&". Understood so far, I think. } The ampersand is therefore parsed rather late to be able to see you need } this structure. So it probably needs some other trick --- a different } list marker that causes a special null command akin to time to do the } fork, for example, as it's easy to update word code tokens when the } structure doesn't change. So what we'd need to do (?) is insert a no-op token in the wordcode at the "front" of the parse, and update it to be an "in background" token in the event the parse ends at "&" (or "&!" etc.) ... } The logic would then be within the exec code ... which would ignore the no-op or invoke an additional execcmd_bg() to exec the pipeline after the fork. } > There's also workers/42233 and related thread } } I think we demonstrated fairly conclusively that no one has the faintest } clue what's happening here. Actually I'm fairly sure that what's happening is that the resulting wordcode is so large that the tail of it has overflowed the integer type used as an internal offset for byte positions / program counter.