From owner-freebsd-questions@FreeBSD.ORG Fri Sep 19 18:12:14 2008 Return-Path: Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E590106564A for ; Fri, 19 Sep 2008 18:12:14 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (unknown [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id A797B8FC0A for ; Fri, 19 Sep 2008 18:12:13 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id m8JICBu9011473; Fri, 19 Sep 2008 20:12:11 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id m8JICBhB011472; Fri, 19 Sep 2008 20:12:11 +0200 (CEST) (envelope-from olli) Date: Fri, 19 Sep 2008 20:12:11 +0200 (CEST) Message-Id: <200809191812.m8JICBhB011472@lurza.secnetix.de> From: Oliver Fromme To: freebsd-questions@FreeBSD.ORG, stevefranks@ieee.org In-Reply-To: <539c60b90809191041p2490130exa024b1f84d44b2f3@mail.gmail.com> X-Newsgroups: list.freebsd-questions User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Fri, 19 Sep 2008 20:12:12 +0200 (CEST) Cc: Subject: Re: kill -KILL fails to kill process X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@FreeBSD.ORG, stevefranks@ieee.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Sep 2008 18:12:14 -0000 Steve Franks wrote: > Which I thought was impossible. Neophyte question, no doubt, but > googling was less than helpful (which probably means I'm fubar, no > doubt). Anyway, I have a certain common X app (xmms) that likes to > hang (since my last buildworld, it seems) when when it's right about > to open a file-choosing dialog. The only way to get rid of it is to > reboot. Now, given the behavior, I'd have to suspect something > underlying as the true source of the problem, but shouldn't kill kill > it anyway - I mean, isn't there some way to kill a process that's > stuck waiting on a child process? I haven't figured out how to "ps > -ax grep | some neublous file dialog process" yet...so I'm sort of > stuck wanting to kill the parent... If you can't kill a process (even with SIGKILL), it means that the process currently can't be put on the run queue, because only processes that are able to run can receive signals. Given that, such a situation usually has one of these three reasons: 1. The process hangs in "disk wait" (flag "D" in ps' STAT column). This often means there's a hardware problem with your disk or controller (or a driver bug), or a network problem if you use NFS. 2. The process was suspended (SIGSTOP). In this case there is the flag "T" in ps' STAT column. Try sending a SIGCONT to the process. 3. The process terminated, but the parent process failed to pick up the exit code. In this case, the process needs to retain an entry in the process table (shown by ps) in order to record the exit code until it is picked up, even though the process itself is gone. Such a "dead" entry in the process table is called a zombie process. In ps' STAT column there is the "Z" flag. This usually indicates a programming error (a.k.a. bug) in the parent process. You can get rid of the zombie by killing the parent process. Then the zombie will be inherited by the next process in the hierarchy (up to the init process 1 if required) which will then pick up the exit code and release the process entry. There can be other reasons on occasion, but those three are the most common ones. Simply look at the STAT column in the ps(1) output for the process in question. It will tell you the reason why the process is stuck. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd Passwords are like underwear. You don't share them, you don't hang them on your monitor or under your keyboard, you don't email them, or put them on a web site, and you must change them very often.