How does ‘stuck’ (in results of ‘top’) relate to ‘not responding’ (in Activity Monitor), ‘spin’ or ‘hang’

activity-monitorcommand linehang

In results of top commands, I sometimes see stuck.

Apple's top(1) OS X Manual Page does not explain this use of the word.

How, if it all, does stuck relate to the following?

  1. not responding – may be seen in Activity Monitor, in the Force Quit Applications dialogue of loginwindow, and so on
  2. .hang files – may be present at /Library/Logs/DiagnosticReports
  3. .spin files – may be present at /Library/Logs/DiagnosticReports

There's an an accepted answer for the first point. Answers relating to points 2 and 3 will be appreciated.

Best Answer

There is usually no correlation between a stuck process of top and a non-responding application:

  • stuck means that the process is currently un-interruptible which usually is the case if the process is waiting for a disk or network data block to be read (or similar low-level stuff). Technically speaking the process is executing in kernel space (aka Unix kernel) and can not be interrupted (so even a kill -9 wouldn't have any impact). Usually these stuck states only last milliseconds (as you can see in top as well because the number of stuck processes changes with every display cycle).
  • non-responding applications can be too busy to reply to any event OS X throws at them.

I see one situation where a stuck process corresponds to a non-responding application: A process can be stuck for a very long time, perhaps stuck endlessly, without any possibility to kill it. This usually is the result of some programming error, e.g. improper disconnection from a networked device then the kernel keeps trying to read from it. In cases like this even a forced termination will not remove the process.