I have several long-running GNU screen sessions. I ssh to the box they're running on and run screen -d -r foo to detach them if they're connected anywhere else, and then attach them in my current window.99% of the time this works fine, but on occasion I get this:$ screen -d -r foo[2430.foo detached.]...and nothing happens; I can't get back to the shell at all. Trying in another window does the same thing, the only thing I can do is destroy that screen session (losing all the programs that were running in it) and recreate itWhy does this happen? How can I avoid it or reconnect successfully when it does happen?Edit: My .screenrc:startup_message offdefwritelock offbind q quitcaption always '%{gk}   (%n) %t                   %{y}%d %M %Y :: %c:%s                   %{b}%W%{d}'screen -t ZSHautodetach onshelltitle ZSHdefutf8 onEdit: The end of an strace log when trying to attach:readlink(/proc/self/fd/0, /dev/pts/14, 4095) = 11stat64(/dev/pts/14, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 14), ...}) = 0stat64(/dev/pts/14, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 14), ...}) = 0geteuid32()                             = 1000getegid32()                             = 1000open(/dev/pts/14, O_RDWR|O_NONBLOCK)  = 3geteuid32()                             = 1000getegid32()                             = 1000close(3)                                = 0ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0umask(0)                                = 022lstat64(/var/run/screen, {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0access(/var/run/screen/S-mrozekma, F_OK) = 0stat64(/var/run/screen/S-mrozekma, {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0umask(022)                              = 0uname({sys=Linux, node=etudes-2, ...}) = 0rt_sigaction(SIGHUP, {0x806e520, [], 0}, {SIG_DFL, [], 0}, 8) = 0geteuid32()                             = 1000getegid32()                             = 1000open(/var/run/screen/S-mrozekma, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3getdents(3, /* 6 entries */, 32768)     = 124stat64(/var/run/screen/S-mrozekma/2386.chat, {st_mode=S_IFIFO|0700, st_size=0, ...}) = 0geteuid32()                             = 1000getegid32()                             = 1000open(/var/run/screen/S-mrozekma/2386.chat, O_WRONLY|O_NONBLOCK) = 4geteuid32()                             = 1000getegid32()                             = 1000fcntl64(4, F_SETFL, O_RDONLY)           = 0geteuid32()                             = 1000getegid32()                             = 1000getdents(3, /* 0 entries */, 32768)     = 0close(3)                                = 0geteuid32()                             = 1000getegid32()                             = 1000setuid32(1000)                          = 0setgid32(1000)                          = 0stat64(/var/run/screen/S-mrozekma/2386.chat, {st_mode=S_IFIFO|0700, st_size=0, ...}) = 0getpid()                                = 30081write(4, \0gsm\4\0\0\0/dev/pts/14\0\0\0\0\0\0\0\0\0\0\0\0\0..., 12336
GNU screen freezes trying to reattach
ssh;gnu screen
Not sure if I had the same issue as you, but sometimes I've the similar screen behaviour every time I network was accidentaly disconnected.After a while ( about 10-15 minutes ) screen is available again for reconnection. After some invetigations, I've found a small note in the man page:   nonblock [on|off|numsecs]   Tell  screen  how to deal with user interfaces (displays) that cease to   accept output. This can happen if a user presses ^S or a TCP/modem con   nection gets cut but no hangup is received. If nonblock is off (this is   the default) screen waits until the display restarts to accept the out   put.  If  nonblock is on, screen waits until the timeout is reached (on   is treated as 1s). If the display  still  doesn't  receive  characters,   screen will consider it blocked and stop sending characters to it. If   at some time it restarts to accept characters, screen will unblock  the   display and redisplay the updated window contents.May be it'll help somebody, cause this is the only page about screen freezes after disconnetion google gave me.