[PATCH] fhandler_tty deadlock patch

Igor Pechtchanski pechtcha@cs.nyu.edu
Sun Oct 20 20:15:00 GMT 2002


First off, this patch does fix the large paste problem.  Thanks for this!

However, there are a couple of problems with this patch.  For example,
this makes bash run from a command prompt (or a shortcut) treat every
character as a ^D.  Bash run from an xterm/rxvt works fine.  /bin/sh
ignores Enter (or ^J, or ^M).  Running 'bash -c "echo BLAH && exit"' from
a command prompt works, however, running "bash -c 'echo BLAH && exit'
results in

C:\cygwin\bin>bash -c 'echo BLAH && exit'
'exit'' is not recognized as an internal or external command,
operable program or batch file.


and "bash -c 'echo BLAH && exit '" (with a space after exit) echoes BLAH
and exits the originating command prompt.  Putting any character after the
space results in the same behavior.  I'm attaching an strace of bash
running under command with this problem.

Adding 'tty' to CYGWIN doesn't affect the outcome.  Setting TERM to
'cygwin' in xterm/rxvt doesn't reproduce the problem - this only happens
in a command shell.

I'm unable to track this down further.  Hope this helps.  Please let me
know if you need any additional info.

On Fri, 18 Oct 2002, Steve O wrote:

> Hi,
> This patch solves some deadlock issues which would prevent
> terminal programs such as rxvt and xterm from being able
> to handle large pastes or cat binary files.
> The fix involves two mechanisms, adding a buffer for
> termios echoing, and allowing a pty_master write to
> write less than the entire buffer.
> There is one small bug remaining that I know of.  When the
> pty_slave changes from cooked to raw, the master doesn't seem to
> know to flush the line edit buffer until a key is pressed.
> Should be an easy fix, but I'm not sure how to best do it.
> -steve

      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Water molecules expand as they grow warmer" (C) Popular Science, Oct'02, p.51
-------------- next part --------------
A non-text attachment was scrubbed...
Name: steve_o-paste-bash.strace.bz2
Type: application/octet-stream
Size: 12394 bytes
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20021020/a76452d8/attachment.obj>

More information about the Cygwin-patches mailing list