[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Terminal settings restoration bug in busybox-1.9.2 and current SVN
From:       Mike Crowe <mac () mcrowe ! com>
Date:       2008-07-28 13:04:35
Message-ID: 20080728130435.GA20352 () mcrowe ! com
[Download RAW message or body]

Ash no longer seems to be able to recover the tty when an application
which is set the tty to raw mode crashes.

Steps to reproduce:

1. Run busybox ash.

2. Run busybox vi (no filename is necessary.)

3. From elsewhere kill -9 the vi process (this simulates vi crashing
without getting a chance to tidy up.)

4. Note that the ash prompt is displayed as expected but nothing
happens as a result of typing (except pressing Ctrl-C makes the prompt
appear again). Attempting to type "stty sane" blind doesn't seem to
work.

I've reproduced this in busybox-1.9.2 cross-compiled for MIPS and the
current state of SVN compiled natively on Debian Etch. busybox-1.2.2.1
seems to at least recover well enough that I can type "stty sane".

It seems that the terminal becomes unresponsive because a special
handler near the top of libbb/lineedit.c:read_line_input.c just calls
fgets if it detects that terminal echo is disabled. If the terminal is
not set up to correctly translate CR then this call won't (normally)
return. :(

I can work around this by losing this special handler but is there a
better solution?

TIA

Mike.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic