Re: Killing a stuck Unix socket process
Re: Killing a stuck Unix socket process
- Subject: Re: Killing a stuck Unix socket process
- From: "Justin C. Walker" <email@hidden>
- Date: Thu, 01 Sep 2011 22:03:23 -0700
On Sep 1, 2011, at 20:58 , Andrew White wrote:
> I managed to get into a situation where a process incorrectly using a Unix datagram socket is stuck, as in I can't kill it. I've even tried sending it a 'kill -9' as root and it remains in the process list. I've killed the controlling terminal and that left the parent gdb process inherited by 'init', and so I killed the gdb process and now my process is inherited by init. But it remains in state 'U' in the process table.
>
> Does anyone know how one gets into this situation, and how one gets out of it?
The 'U' state is ("man ps") uninterruptible, so, as you found out, you can't kill it. Generally, this means that the process has a thread executing in kernel mode and is waiting on a resource that never comes available. One reason it's uninterruptible is that, if killed, something the process holds (like a lock) might never get released. Typical scenarios include "priority inversion" and "deadlock".
Also, it's not nice to kill gdb while debugging :-} Gdb has privileged access to your process's address space and can leave that space (both kernel and user) in a bad state.
I can't tell from what you've said exactly what happened, but I don't think you can recover, short of rebooting.
Justin
--
Justin C. Walker, Curmudgeon-at-Large
() The ASCII Ribbon Campaign
/\ Help Cure HTML Email
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden