News for hackers. Stuff that matters.
Re:The right way to deal with frozen processes on Unix by trotsky on Friday September 21, 2012 @02:46PM (#4555120)
I'm not sure if that's darwin terminology, but calling a process that's blocking on io or in a tight loop "frozen" certainly isn't tradition in UNIX - you're much more likely to use hung or stuck. In linux specifically the term has a completely different meaning - "freezing" a process is intentional and involves putting the process into a cgroup and then removing all cpu shares to prevent it from executing - suspending the process and allowing for sleep/hibernation/etc.
Re:The right way to deal with frozen processes on Unix by jlgreco on Friday September 21, 2012 @03:13PM (#4555236)
The "frozen" terminology is amusing to me since I would normally say that processes in tight loops are "burning CPU".
Re:The right way to deal with frozen processes on Unix by SageRaven on Friday September 21, 2012 @04:13PM (#4555525)
I have always described such processes as "wedged".
Re:The right way to deal with frozen processes on Unix by bradleyland on Friday September 21, 2012 @11:46AM (#4554224)
I don't mean to disparage other Ruby application servers, but this is why I use Passenger. It's not that I believe other Ruby application servers aren't good, or that their authors don't understand Unix as well as the guys at Phusion, but there's a real dedication to stability and predictability inside Phusion that I don't see elsewhere.

You can acheive the same results with other app servers, but you're going to have to do a lot of the heavy lifting yourself. I'm not ashamed to admit that I have a lot more confidence in Passenger's solution than I do my own.

Re:The right way to deal with frozen processes on Unix by unixnoob on Friday September 21, 2012 @04:20PM (#4555552)
OK, total noob question here. Could we achieve the same thing with something like pgrphack from daemontools?

    pgrphack sh -c "processes" 
Kill the pid for the sh ("agent") and you thereby kill all the processes?

Again, sorry for the noob question. I'm still learning and making mistakes.

Re:The right way to deal with frozen processes on Unix by FooBarWidget on Saturday September 22, 2012 @07:12AM (#4557618)
No. To instruct kill() to kill a process group, you have to specified the PID of the process group leader as a negative number. Otherwise kill() will kill only a single process.
Re:The right way to deal with frozen processes on Unix by unixnoob on Sunday September 23, 2012 @04:04AM (#4560367)
But won't all the processes in my example have the PGID of sh?
Re:The right way to deal with frozen processes on Unix by FooBarWidget on Sunday September 23, 2012 @02:49PM (#4561687)
Yes they do, but that is irrelevant. kill(pid) kills the process specified by 'pid'. kill(-pid) kills the process group specified by 'pid'.
Re:The right way to deal with frozen processes on Unix by unixnoob on Sunday September 23, 2012 @04:48PM (#4561985)
What if I just use userland kill(1) utility? Is it possible to kill all processes under a PGID using kill(1)?

Say the PGID I get for sh is 321. If I do

    kill [signal] 321
that will not kill all the processes having PGID 321?

If it would not kill them, then couldn't we modify kill(1) to be able to call kill() with a negative integer as you describe?

Sorry for the noob questions. I am still learning and making mistakes.

Re:The right way to deal with frozen processes on Unix by ibotty on Friday September 21, 2012 @04:48PM (#4555697)
isn't frozen in usual unix terminology any SIGSTOPped process?
Re:The right way to deal with frozen processes on Unix by Evbn on Saturday September 22, 2012 @10:19AM (#4557891)
That's suspended to me.
Re:The right way to deal with frozen processes on Unix by bifrost on Friday September 21, 2012 @03:02PM (#4555189)
Its nice to see traditional debugging made easy, this is stuff that you try to teach people as a sysadmin/opsguy and they never pay attention. Yay!
Re:The right way to deal with frozen processes on Unix by X-Istence on Friday September 21, 2012 @01:11PM (#4554607)
The page is unfortunately not loading, and there doesn't seem to be a Google cache for the page.
Re:The right way to deal with frozen processes on Unix by FooBarWidget on Friday September 21, 2012 @01:18PM (#4554655)
There was a slight interruption of service, but the blog has been restored now. Our apologies for the inconvenience.
Re:The right way to deal with frozen processes on Unix by janerik on Friday September 21, 2012 @01:08PM (#4554590)
The server is not responding right now and Google Cache is empty. Any one got a copy of this?
Re:The right way to deal with frozen processes on Unix by dredmorbius on Friday September 21, 2012 @03:40PM (#4555369)
In related news, Hongli Lai has solved the halting problem.
Re:The right way to deal with frozen processes on Unix by geofft on Friday September 21, 2012 @05:34PM (#4555952)
You do realize that it's quite easy to solve the halting problem in most cases, right?

The halting problem is unsolvable because _very particular_ (and pathological) cases are unsolvable. If a process is in a loop between the same instructions at the same states, it's very easy to tell that it's not going to halt -- the only challenge is that you can't make this determination for all processes all the time.

Mathematically, note that the concept of an oracle for the halting problem is well-defined (and a useful concept).

Re:The right way to deal with frozen processes on Unix by dredmorbius on Saturday September 22, 2012 @05:36PM (#4559074)
I was mostly making a jibe at the notion that there is a single, correct, and reliable method for identifying stuck/hung processes.

There are in fact fairly reliable heuristics for noting when things are going pear-shaped. The edge cases get sticky though.