From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29807 invoked by alias); 18 Jul 2013 03:50:48 -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: 31530 Received: (qmail 8065 invoked from network); 18 Jul 2013 03:50:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.220.174 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ntXujox/CWNze7cnysAJ59I8OmqWqY64zYoNU3wX5bQ=; b=JwiSjcZavcds7fWSqdSnaddEmBxaYjLfL9Cr/06H3pNilhdf1gGEuLFzLJldnPv/6P A1D7NIe+ADTRp6+sjtcXuKvgIE06K9E+/yq/kNTLAZK2clQmZdTD8Krz/erkofwiDlR8 u1MTM+FSDafWQ2ulEgE53nIJ92ZBPhkXYup4DsQhee7EDdDfn0w5i8JyNQW7RMI8bZXl 4SgDxMKB053cF2+so+RD3OIFhENtneG24a8j9XRsrTdkBIAkR1jqdsgNWHQQExhjpXdK NGOqZ35TV9izY6uoR9QvmGTJzEeIIIqyhNjSH0tvqoqxXGjH/MKNVx8Xsad6aTgvlct9 3/FQ== MIME-Version: 1.0 X-Received: by 10.58.165.70 with SMTP id yw6mr3285876veb.19.1374119425589; Wed, 17 Jul 2013 20:50:25 -0700 (PDT) Sender: ethersoft@gmail.com In-Reply-To: <20130717201733.2c0b029b@pws-pc.ntlworld.com> References: <20130715133525.GA7694@chaz.gmail.com> <130715100624.ZM14123@torch.brasslantern.com> <20130716215540.22d88a27@pws-pc.ntlworld.com> <130717000027.ZM15643@torch.brasslantern.com> <20130717201733.2c0b029b@pws-pc.ntlworld.com> Date: Wed, 17 Jul 2013 23:50:25 -0400 X-Google-Sender-Auth: eMjKAm7ws3H3Q3tbjzVdU0ajx6o Message-ID: Subject: Re: bug with eval, proc-subst and pipes From: Vin Shelton To: Peter Stephenson Cc: zsh-workers@zsh.org Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jul 17, 2013 at 3:17 PM, Peter Stephenson wrote: > On Wed, 17 Jul 2013 00:00:27 -0700 > Bart Schaefer wrote: >> On Jul 16, 9:55pm, Peter Stephenson wrote: >> } It may therefore be a different problem from Stephane's. >> >> I don't think so, fundamentally. The problem in both cases is that the >> file descriptor for the process substitution is closed before the data >> is read. This has the unintended side-effect of removing the special >> device file. The reasons for the premature descriptor close may be >> different, but the end result is the same; I believe fixing either one >> would fix both. > > We can see... "make check" now hangs and cannot be interrupted with ^C. This is on a Fedora 18 system with the following configure options: /opt/src/zsh-2013-07-17/configure' '--prefix=/opt/zsh-2013-07-17' '--datadir=/opt/share' '--enable-etcdir=/opt/etc' '--with-tcsetpgrp' '--enable-zsh-mem' '--enable-pcre' 'CC=gcc' Let me know if you need me to run any more tests. Here's a verbose trace: ZTST_verbose=3 make TESTNUM=D03 check cd Test ; make check make[1]: Entering directory `/opt/build/zsh-2013-07-17/Test' if test -n "gcc"; then \ cd .. && DESTDIR= \ make MODDIR=`pwd`/Test/Modules install.modules > /dev/null; \ fi if ZTST_testlist="`for f in /opt/src/zsh-2013-07-17/Test/D03*.ztst; \ do echo $f; done`" \ ZTST_srcdir="/opt/src/zsh-2013-07-17/Test" \ ZTST_exe=../Src/zsh \ ../Src/zsh +Z -f /opt/src/zsh-2013-07-17/Test/runtests.zsh; then \ stat=0; \ else \ stat=1; \ fi; \ sleep 1; \ rm -rf Modules .zcompdump; \ exit $stat /opt/src/zsh-2013-07-17/Test/D03procsubst.ztst: starting. ZTST_getsect: read section name: prep ZTST_getchunk: read code chunk: if grep '#define PATH_DEV_FD' $ZTST_testdir/../config.h > /dev/null 2>&1 || grep '#define HAVE_FIFOS' $ZTST_testdir/../config.h > /dev/null 2>&1; then mkdir procsubst.tmp cd procsubst.tmp print 'First\tSecond\tThird\tFourth' >FILE1 print 'Erste\tZweite\tDritte\tVierte' >FILE2 else ZTST_unimplemented="process substitution is not supported" true fi ZTST_execchunk: status 0 ZTST_getchunk: read code chunk: function copycat { cat "$@" } ZTST_execchunk: status 0 ZTST_getchunk: read code chunk: ZTST_getsect: read section name: test ZTST_test: looking for new test ZTST_test: examining line: paste <(cut -f1 FILE1) <(cut -f3 FILE2) ZTST_getchunk: read code chunk: paste <(cut -f1 FILE1) <(cut -f3 FILE2) ZTST_test: examining line: >First Dritte ZTST_getredir: read redir for '>': First Dritte ZTST_test: examining line: Running test: <(...) substitution ZTST_test: expecting status: 0 Input: /tmp/zsh.ztst.in.15606, output: /tmp/zsh.ztst.out.15606, error: /tmp/zsh.ztst.terr.15606 ZTST_execchunk: status 0 ZTST_test: test produced standard output: First Dritte ZTST_test: and standard error: Test successful. ZTST_test: looking for new test ZTST_test: examining line: ZTST_test: examining line: { paste <(cut -f2 FILE1) <(cut -f4 FILE2) } > >(sed 's/e/E/g' >OUTFILE) ZTST_getchunk: read code chunk: { paste <(cut -f2 FILE1) <(cut -f4 FILE2) } > >(sed 's/e/E/g' >OUTFILE) cat OUTFILE ZTST_test: examining line: >SEcond ViErtE ZTST_getredir: read redir for '>': SEcond ViErtE ZTST_test: examining line: Running test: >(...) substitution ZTST_test: expecting status: 0 Input: /tmp/zsh.ztst.in.15606, output: /tmp/zsh.ztst.out.15606, error: /tmp/zsh.ztst.terr.15606 ZTST_execchunk: status 0 ZTST_test: test produced standard output: SEcond ViErtE ZTST_test: and standard error: Test successful. ZTST_test: looking for new test ZTST_test: examining line: ZTST_test: examining line: diff =(cat FILE1) =(cat FILE2) ZTST_getchunk: read code chunk: diff =(cat FILE1) =(cat FILE2) ZTST_test: examining line: >1c1 ZTST_getredir: read redir for '>': 1c1 < First Second Third Fourth --- > Erste Zweite Dritte Vierte ZTST_test: examining line: Running test: =(...) substituion ZTST_test: expecting status: 1 Input: /tmp/zsh.ztst.in.15606, output: /tmp/zsh.ztst.out.15606, error: /tmp/zsh.ztst.terr.15606 ZTST_execchunk: status 1 ZTST_test: test produced standard output: 1c1 < First Second Third Fourth --- > Erste Zweite Dritte Vierte ZTST_test: and standard error: Test successful. ZTST_test: looking for new test ZTST_test: examining line: ZTST_test: examining line: copycat <(print First) <(print Zweite) ZTST_getchunk: read code chunk: copycat <(print First) <(print Zweite) ZTST_test: examining line: >First ZTST_getredir: read redir for '>': First Zweite ZTST_test: examining line: Running test: FDs remain open for external commands called from functions ZTST_test: expecting status: 0 Input: /tmp/zsh.ztst.in.15606, output: /tmp/zsh.ztst.out.15606, error: /tmp/zsh.ztst.terr.15606 ZTST_execchunk: status 0 ZTST_test: test produced standard output: First Zweite ZTST_test: and standard error: Test successful. ZTST_test: looking for new test ZTST_test: examining line: ZTST_test: examining line: catfield2() { ZTST_getchunk: read code chunk: catfield2() { local -a args args=(${(s.,.)1}) print $args[1] cat $args[2] print $args[3] } catfield2 up,<(print $'\x64'own),sideways ZTST_test: examining line: >up ZTST_getredir: read redir for '>': up down sideways ZTST_test: examining line: Running test: <(...) when embedded within an argument ZTST_test: expecting status: 0 Input: /tmp/zsh.ztst.in.15606, output: /tmp/zsh.ztst.out.15606, error: /tmp/zsh.ztst.terr.15606 ZTST_execchunk: status 0 ZTST_test: test produced standard output: up down sideways ZTST_test: and standard error: Test successful. ZTST_test: looking for new test ZTST_test: examining line: ZTST_test: examining line: outputfield2() { ZTST_getchunk: read code chunk: outputfield2() { local -a args args=(${(s.,.)1}) print $args[1] echo 'How sweet the moonlight sits upon the bank' >$args[2] print $args[3] } outputfield2 muddy,>(sed -e s/s/th/g >outputfield2.txt),vesture # yuk while [[ ! -e outputfield2.txt || ! -s outputfield2.txt ]]; do :; done cat outputfield2.txt ZTST_test: examining line: >muddy ZTST_getredir: read redir for '>': muddy vesture How thweet the moonlight thitth upon the bank ZTST_test: examining line: Running test: >(...) when embedded within an argument ZTST_test: expecting status: 0 Input: /tmp/zsh.ztst.in.15606, output: /tmp/zsh.ztst.out.15606, error: /tmp/zsh.ztst.terr.15606 - Vin