From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.12] helo=sc8-sf-mx2.sourceforge.net) by sc8-sf-list1.sourceforge.net with esmtp (Exim 4.30) id 1CPQxQ-0008Rd-Or for user-mode-linux-devel@lists.sourceforge.net; Wed, 03 Nov 2004 11:38:12 -0800 Received: from smtp001.mail.ukl.yahoo.com ([217.12.11.32]) by sc8-sf-mx2.sourceforge.net with smtp (Exim 4.41) id 1CPQxP-0004LF-Qj for user-mode-linux-devel@lists.sourceforge.net; Wed, 03 Nov 2004 11:38:12 -0800 From: Blaisorblade Subject: Re: [uml-devel] [PATCH] UML: Use PTRACE_KILL instead of SIGKILL to kill host-OS processes (take #2) References: <20041103113736.GA23041@taniwha.stupidest.org> <1099482457.16445.1.camel@imp.csi.cam.ac.uk> <20041103120829.GA23182@taniwha.stupidest.org> In-Reply-To: <20041103120829.GA23182@taniwha.stupidest.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200411032028.44376.blaisorblade_spam@yahoo.it> Sender: user-mode-linux-devel-admin@lists.sourceforge.net Errors-To: user-mode-linux-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Id: The user-mode Linux development list List-Post: List-Help: List-Subscribe: , List-Archive: Date: Wed, 3 Nov 2004 20:28:44 +0100 To: user-mode-linux-devel@lists.sourceforge.net Cc: Chris Wedgwood , Jeff Dike , Anton Altaparmakov , Andrew Morton , lkml , Gerd Knorr On Wednesday 03 November 2004 13:08, Chris Wedgwood wrote: > On Wed, Nov 03, 2004 at 11:47:38AM +0000, Anton Altaparmakov wrote: > > You have two %d but only one argument. You seem to have forgotten > > an "old_pid, " in there. > kill(..., SIGKILL) doesn't work to kill host-OS processes created in > the exec path in TT mode --- for this we need PTRACE_KILL (it did work > in previous kernels, but not by design). Without this process will > accumulate on the host-OS (although the won't be visible inside UML). > Signed-off-by: Chris Wedgwood > --- > > Index: cw-current/arch/um/kernel/tt/exec_user.c > =================================================================== > --- cw-current.orig/arch/um/kernel/tt/exec_user.c 2004-11-03 > 02:10:18.064830204 -0800 +++ > cw-current/arch/um/kernel/tt/exec_user.c 2004-11-03 04:05:00.435843464 > -0800 @@ -35,7 +35,8 @@ > tracer_panic("do_exec failed to get registers - errno = %d", > errno); > > - kill(old_pid, SIGKILL); > + if (ptrace(PTRACE_KILL, old_pid, NULL, NULL)) > + printk("Warning: ptrace(PTRACE_KILL, %d, ...) saw %d\n", old_pid, > errno); > > if(ptrace_setregs(new_pid, regs) < 0) > tracer_panic("do_exec failed to start new proc - errno = %d", I'm going to test this. I thought that Gerd Knorr patch (which I sent cc'ing LKML and most of you) already solved this (I actually modified that one, replacing his SIGCONT kill()ing with a PTRACE_KILL, but I did this in the places he identified). I guess that old_pid should either already be dead there or going to die after a little, but I'm going to check (after I get UML to run in the current snapshot...) For now, please hold on this. -- Paolo Giarrusso, aka Blaisorblade Linux registered user n. 292729 ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel