News for hackers. Stuff that matters.
Re:Why doesn't `kill -9` always work? by jsnell on Sunday January 20, 2013 @07:53PM (#5089099)
So that whole section doesn't make a lot of sense to me. Running strace on an unkillable process tends to produce no output (if the process was actually making new system calls, it wouldn't be wedged). And worse, my experience is that attaching to a wedged process with ptrace() usually does nothing at all except also hang the attaching the process. This also applies to gdb.

And finally, even if attaching worked, getting a disassembly of the current PC (in this case the syscall trampoline) would tell nothing useful about what's going on.

Re:Why doesn't `kill -9` always work? by agwa on Sunday January 20, 2013 @08:20PM (#5089233)
I don't understand it either. The only syscalls going on there are reads from /dev/random and writes to /dev/null - both of those can be interrupted (in fact writes to /dev/null should be instantaneous).

I think the author may be conflating applications blocked in system calls (since reads from /dev/random will block if the system lacks entropy) with applications blocked in uninterruptible system calls.

Re:Why doesn't `kill -9` always work? by syncsynchalt on Monday January 21, 2013 @12:37AM (#5090054)
There are no reads from /dev/random successfully happening in the example (not after the first few blocks, anyway).

/dev/random reads from an entropy pool that is quickly exhausted and slowly filled. The kernel will lock a process in D state while waiting for entropy.

If you're expecting a stream of pseudo-random data then you can get that by directing /dev/urandom to /dev/null.

Re:Why doesn't `kill -9` always work? by agwa on Monday January 21, 2013 @12:21PM (#5092425)
> The kernel will lock a process in D state while waiting for entropy.

No it doesn't, at least not in Linux 3.0.57 or any other kernel I can remember for the last many years. It blocks if it needs entropy, but it's interruptible meaning it's in the S state, not the D state, and can be killed.