Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: need info about attachtty hanging
- X-seq: zsh-workers 924
- From: schaefer@xxxxxxxxxxxxxx (Barton E. Schaefer)
- To: "Richard J. Coleman" <coleman@xxxxxxxxxxxxxxx>, zsh-workers@xxxxxxxxxxxxxxx
- Subject: Re: need info about attachtty hanging
- Date: Sat, 13 Apr 1996 14:54:31 -0700
- In-reply-to: "Richard J. Coleman" <coleman@xxxxxxxxxxxxxxx> "need info about attachtty hanging" (Apr 13, 12:43am)
- References: <199604130443.AAA21733@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Reply-to: schaefer@xxxxxxxxxxxxxx
On Apr 13, 12:43am, Richard J. Coleman wrote:
} Subject: need info about attachtty hanging
}
} Several people have report zsh hanging in attachtty.
Not hanging -- infinite-looping. Not quite the same.
} Peter sent in a patch that changes
}
} if (kill(pgrp, 0) == -1)
}
} to
}
} if (pgrp != mypgrp && kill(pgrp, 0) == -1)
}
} Now I'm trying to understand what is going on.
Zsh gets EOF because the tty closes. Ignoreeof is set, so it keeps
reading input. attachtty() is called to make the top-level shell
the foreground process on the tty, which fails. Without the fix
above, attachtty() calls itself recursively, which fails again;
attachtty() has no automatic variables, so it doesn't consume any
stack space, and thus the recursion is infinite.
} 1) Where is attachtty being called from when it
} hanges (init_io, init_signals, etc...)?
My guess is it's from setterm() via refresh(), but it could be from
getkey() via any number of zle entry points. It doesn't really
make any difference; the fix above is needed no matter what.
Note that the "ep" static protects against such recursion in the
case where the initial kill() fails. The only time the kill() can
possibly fail is from entersubsh(), bin_fg(), or bin_read(), so
none of those is involved in this case.
} 2) Does anyone know why the original call to set the
} foreground process is failing?
Yeah: because the tty is closed -- the xterm window (or equivalent)
has gone away. *No* process can have that controlling terminal any
longer.
--
Bart Schaefer Vice President, Technology, Z-Code Software
schaefer@xxxxxxxxxx Division of NCD Software Corporation
http://www.well.com/www/barts
Messages sorted by:
Reverse Date,
Date,
Thread,
Author