<<< Date Index >>>     <<< Thread Index >>>

Re: [Mutt] #1220: After telnet session dies, Mutt continues running,



#1220: After telnet session dies, Mutt continues running, gradually consuming 
all
CPU resources.

Comment (by vinc17):

 Here's a way to reproduce the bug under Mac OS X:
   1. Connect to the Mac OS X machine with ssh (e.g. ssh localhost).
   2. Run Mutt.
   3. Kill the sshd process with "kill -9".

 And to reproduce the bug under Linux:
   1. Connect to the Linux machine with ssh (e.g. ssh localhost).
   2. Run "setsid mutt..." (Mutt can no longer be used, but this is just to
 reproduce the bug in an easy way).
   3. Kill the sshd process with "kill -9".

 The problem is that getch() from curs_lib.c always returns -1 immediately,
 leading to an infinite loop. Under Mac OS X, errno contains alternatively
 0 and 5 (EIO: Input/output error), so that testing errno == EIO can be a
 way to fix the bug for Mac OS X (however, I'm not sure that EIO is always
 a fatal error); I'll attach a patch. But under Linux, errno is always 0. I
 don't know how to fix the bug there: ch == ERR and errno == 0 is also what
 is returned after a timeout. Perhaps one should check this condition and
 that getch returned immediately.

-- 
Ticket URL: <http://dev.mutt.org/trac/ticket/1220#comment:6>