# SSH hanging on tcsetattr: Interrupted system call

## d_m

So, this is a pretty crazy problem. I have been working on it for awhile with no luck (or only limited luck) so I'll post here.

The basic problem:

If I SSH from my linux box at work to the development server, the connection will sometimes hang. Certain commands tend to hang more frequently (often those that produce lots of output and/or IO) but any of them can hang. Once a command hangs on the development server, most commands will hang until I restart my box.

Detailed explanation:

The frequency of the problem depends on the command and the environment. If I run GNOME the problem almost always happens. In X (fvwm window manager) it happens less frequently, and from virtual consoles it doesn't seem to. The command that causes this to happen the most is CVS (on the dev server, syncing up with the cvs server); this will always hang in GNOME, and sometimes hang in X. The strange thing is that once this happens, I can shut down X and all those services, and it will still happen in the virtual console (until I reboot).

I have only seen this happen when SSHing to the development server (running Debian).

Using the "~ C-Z" escape sequence in SSH, I can jump out of the frozen session back to my machine (and "stop" SSH). If I check my machine, the ssh process is not misbehaving (using too much memory or too many cycles) and I can kill it. If I do, I see this:

```
tcsetattr: Interrupted system call

Killed by signal 15.
```

Some other things I have discovered: using "ForwardAgent yes" in my ssh config seems to make the problem happen more, but it will happen anyway.

Anyway, I am kind of at a loss. Based on the interrupted system call, it seems like there is a deadlock somewhere. Does anyone have any ideas?

I am running a patched version of vanilla-sources 2.6.16.1; the patches are mostly to the intel HD audio driver and to create a new framebuffer device. The machine in question is an Intel Mac Mini, but I'm not sure how that would affect things. The problem showed up about a month ago; I was running an unstable GNOME 2.14 and modular X at the time and thought they were responsible. I rebiult the box from scratch and it's basically all stable (and it's still happening)...

Anyway that's a mouthful. If anyone has any clues or ideas I'd really appreciate them.

EDIT: to be clear, when I say "hang" i mean their output hangs. if i got to someone else's machine and check it out, the command exited fine, and my bash process is sitting there waiting for input, but my side has paused output, and the cursor doesn't respond (nor does C-c or any other control character do anything). All I can do is close the xterm, or background SSH, or something.

----------

