Sometimes when my terminal freezes up and it will not let me type. I can not identify any causes, nor how to diagnose. Any suggestions?


GNOME Terminal 2.30.2 on Ubuntu 10.04

  • 2
    usually when the terminal freezes it is caused by another application in the background using too many resources, like the CPU or Disk I/O. If you run top in a terminal, you should be able to locate the problem easily. – RolandiXor Nov 30 '10 at 2:37
  • @roland - sounds like a catch-22, but good advice since sometimes when one terminal is frozen I can open another and it will work. – David LeBauer Nov 30 '10 at 2:38
  • I Know right? :) It is a bit of a catch-22, but it often works for me. – RolandiXor Nov 30 '10 at 2:46

A good general way to diagnose mysterious hangs:

  1. open a(nother) terminal, and use ps axo pid,wchan:32,cmd to find the other process id
  2. note the wchan column, which should tell you whether it's stuck in the kernel
  3. run sudo strace -p PID inserting the pid of that process; paste that into a bug report or question

If there's anything aside from just a dash in the wchan column, then the process is in the kernel doing something. Some typical values:

  • futex_wait_queue_me - waiting on a futex for another thread in the same process
  • poll_schedule_timeout - waiting for network or interprocess communication, or just sleeping for a while
  • pipe_wait - reading/writing a pipe

There are thousands of possibilities so I can't list them all. See What is the "Waiting Channel" of a process? for more.

  • Very useful for general purpose bug tracking. Can you please update your answer with some extensive description ? What message in wchan column indicates a program that is stuck in the kernel ? – Salih Emin Nov 30 '10 at 13:19
  • Thanks, Salih. Maybe we should have another question about how in general to diagnose hangs? – poolie Nov 30 '10 at 21:42
  • If people are curious about any other wchan values, please add a comment. – poolie Mar 14 '12 at 0:37
  • Any wchan means the process is waiting in the kernel. If it stays there for a long time and for no good reason like listening for network io, then it's stuck. ;) – poolie Dec 11 '15 at 6:08

Did you press Ctrl+S by any chance? It's the terminal pause key that stops all output until you press Ctrl-Q to resume.

  • what could be the reason behind providing the option to pause the terminal, just curious to know. – learner Apr 25 '20 at 4:51
  • 3
    Sometimes it's helpful, when an application is printing lots of output non-stop, and you want to make it pause so you can read it before it disappears off screen. It's also the same control character used for software flow control, when one device wants to tell the other device to slow down for a bit. – Marius Gedminas Apr 25 '20 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.