zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: Bug in sh emulation
Date: Fri, 09 Dec 2011 18:47:47 -0800	[thread overview]
Message-ID: <111209184747.ZM5000@torch.brasslantern.com> (raw)
In-Reply-To: <CAG2tFJy+crpJVg2m1kO9H=fhYUYqPWEuJg+ivDaXCqzqOxa3Hg@mail.gmail.com>

On Dec 9, 11:39pm, Ivan S. Freitas wrote:
} Subject: Bug in sh emulation
}
} Zsh is hanging in commands like: emulate sh -c "(echo | grep)"

Well, this is interesting.

#0  0x007067a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x007e4029 in ioctl () from /lib/tls/libc.so.6
#2  0x007e35cd in tcsetpgrp () from /lib/tls/libc.so.6
#3  0x080c5424 in attachtty (pgrp=4940) at ../../zsh-4.0/Src/utils.c:3876
#4  0x08060b66 in entersubsh (flags=6) at ../../zsh-4.0/Src/exec.c:947
#5  0x080655f0 in execcmd (state=0xbfe8e630, input=0, output=12, how=18, 
    last1=0) at ../../zsh-4.0/Src/exec.c:2832
#6  0x080628b1 in execpline2 (state=0xbfe8e630, pcode=163, how=18, input=0, 
    output=0, last1=1) at ../../zsh-4.0/Src/exec.c:1686
#7  0x08061a3e in execpline (state=0xbfe8e630, slcode=8194, how=18, last1=1)
    at ../../zsh-4.0/Src/exec.c:1424
#8  0x08061316 in execlist (state=0xbfe8e630, dont_change_job=0, exiting=1)
    at ../../zsh-4.0/Src/exec.c:1207
#9  0x08066d5c in execcmd (state=0xbfe8e630, input=0, output=0, how=18, 
    last1=2) at ../../zsh-4.0/Src/exec.c:3285
#10 0x08062690 in execpline2 (state=0xbfe8e630, pcode=131, how=18, input=0, 
    output=0, last1=0) at ../../zsh-4.0/Src/exec.c:1640
#11 0x08061a3e in execpline (state=0xbfe8e630, slcode=14338, how=18, last1=0)
    at ../../zsh-4.0/Src/exec.c:1424
#12 0x08061316 in execlist (state=0xbfe8e630, dont_change_job=1, exiting=0)
    at ../../zsh-4.0/Src/exec.c:1207
#13 0x08060dac in execode (p=0xb7cde898, dont_change_job=1, exiting=0, 
    context=0x812deb6 "eval") at ../../zsh-4.0/Src/exec.c:1028
#14 0x0805a2b0 in eval (argv=0xbfe8e7d8) at ../../zsh-4.0/Src/builtin.c:4928
#15 0x0805a568 in bin_emulate (nam=0xb7cde788 "emulate", argv=0xbfe8e7d0, 
    ops=0xbfe8e820, func=0) at ../../zsh-4.0/Src/builtin.c:5021

(rest uninteresting)

It's stuck in an infinite TTOU/CONT loop because for some reason it
wants to attachtty(), which it can't because it's not the process leader
(the parent shell still in the foreground is).

945                 setpgrp(0L, jobtab[thisjob].gleader);
946                 if (!(flags & ESUB_ASYNC))
947                     attachtty(jobtab[thisjob].gleader);

That particular code fragment dates from 2007, so that can't directly be
the problem, but I don't see any recent changes in exec.c that would have
an effect on when a job is made ASYNC.


  reply	other threads:[~2011-12-10  2:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-10  1:39 Ivan S. Freitas
2011-12-10  2:47 ` Bart Schaefer [this message]
2011-12-10  3:40   ` Bart Schaefer
2011-12-10 18:15     ` Peter Stephenson
2011-12-10 19:40   ` Peter Stephenson
2011-12-10 23:28     ` Peter Stephenson
2011-12-11 19:39       ` Peter Stephenson
2011-12-11 20:20         ` Peter Stephenson
2011-12-11 20:56           ` Peter Stephenson
2011-12-11 23:39             ` Bart Schaefer
2011-12-12 10:01               ` Peter Stephenson
2011-12-12 10:14                 ` Peter Stephenson
2011-12-12 15:44                 ` Bart Schaefer
2011-12-12 16:06                   ` Peter Stephenson
2011-12-12 18:10                     ` Bart Schaefer
2011-12-12 19:16                       ` Peter Stephenson
2011-12-11 22:37         ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=111209184747.ZM5000@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).