Hi

Try this please:

Index: tty.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/tty.c,v
retrieving revision 1.294
diff -u -p -r1.294 tty.c
--- tty.c       21 Aug 2017 21:02:58 -0000      1.294
+++ tty.c       23 Aug 2017 09:06:04 -0000
@@ -159,7 +159,7 @@ tty_read_callback(__unused int fd, __unu
        int              nread;
 
        nread = evbuffer_read(tty->in, tty->fd, -1);
-       if (nread == -1) {
+       if (nread == 0 || nread == -1) {
                event_del(&tty->event_in);
                return;
        }




On Wed, Aug 23, 2017 at 10:59:12AM +0200, Thomas Sattler wrote:
> Hi there ...
> 
> I stumbled upon an issue within tmux-2.5 and git.
> It can be triggered without a config file. It can
> be reproduced like this:
> 
>  - have a tmux session running at a remote machine
>  - ssh into that machine (with a different account)
>  - run 'exec su $THE_TMUX_USER'
>  - run 'tmux attach'
> 
> Now kill the terminal used for ssh/su/exec (i.e. do
> _not_ detach). The 'tmux attach' process still exists
> and the server you attached to now runs at 100% CPU.
> 
> Stracing the server shows these three in a loop:
> 
> poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=6, events=POLLIN},
> {fd=7, events=POLLIN}, {fd=5, events=POLLIN}], 5, 980) = 1 ([{fd=7,
> revents=POLLIN|POLLERR|POLLHUP}])
> ioctl(7, FIONREAD, [4096])              = -1 EIO (Input/output error)
> readv(7,
> [{"\266\27b#\0\0\0\0\1\0\0\0\0\0\0\0\30\0\4.\0or\4\265\27b#\0\0\0\0"...,
> 4096}], 1) = 0
> 
> You can kill the 'tmux attach' and the server recovers.
> 
> I could reproduce it on two different Debian machines:
> 
> On one machine I ssh into a user account, become root
> via 'exec su -' and then connected to root's session.
> On the other machine I directly ssh into root account
> and use 'exec su - $USER' to connect to that users
> tmux session.
> 
> Thomas
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "tmux-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send an email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to