public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* And another bug report for UML in latest Linux 2.6-BK repository.
@ 2004-11-16 14:03 Anton Altaparmakov
  2004-11-18  1:48 ` Jeff Dike
  0 siblings, 1 reply; 3+ messages in thread
From: Anton Altaparmakov @ 2004-11-16 14:03 UTC (permalink / raw)
  To: jdike; +Cc: user-mode-linux-devel, lkml

With my .config (quoted in my first bug report), just disabling SKAS
mode, makes UML compile but not work at all.  It goes like this before
it locks up:

linux umid=uml0 mem=256m ubd0=ubd0 ubd1=/usr/src/ntfs_hdd10
eth0=tuntap,uml0,fe:fd:dd:f8:a6:4e ssl=none con=xterm
xterm=gnome-terminal,-t,-x root=/dev/ubda1
Set 'uml0' persistent and owned by uid 29847
Starting uml...
Checking PROT_EXEC mmap in /tmp...OK
Kernel virtual memory size shrunk to 243269632 bytes
tracing thread pid = 29367
Linux version 2.6.10-rc2 (aia21@imp) (gcc version 3.3.4 (pre 3.3.5
20040809)) #1 Tue Nov 16 13:59:36 GMT 2004
Built 1 zonelists
Kernel command line: mem=256m ubd0=ubd0 ubd1=/usr/src/ntfs_hdd10
eth0=tuntap,uml0,fe:fd:dd:f8:a6:4e ssl=none con=xterm root=/dev/ubda1
PID hash table entries: 2048 (order: 11, 32768 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 254592k available
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Checking for host processor cmov support...Yes
Checking for host processor xmm support...No
Checking that ptrace can change system call numbers...OK
Checking syscall emulation patch for ptrace...check_ptrace : child
exited with exitcode 1, while expecting 0; status 0x100
missing
Checking that host ptys support output SIGIO...Yes
Checking that host ptys support SIGIO on close...No, enabling workaround
Checking for /dev/anon on the host...Not available (open failed with
errno 2)
NET: Registered protocol family 16
sleeping process 29410 got unexpected signal : 11

I now have to press Ctrl+C to get back to my shell.

Best regards,

	Anton
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/, http://www-stu.christs.cam.ac.uk/~aia21/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: And another bug report for UML in latest Linux 2.6-BK repository.
  2004-11-16 14:03 And another bug report for UML in latest Linux 2.6-BK repository Anton Altaparmakov
@ 2004-11-18  1:48 ` Jeff Dike
  2004-11-22 10:48   ` Martin Waitz
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Dike @ 2004-11-18  1:48 UTC (permalink / raw)
  To: Anton Altaparmakov; +Cc: user-mode-linux-devel, lkml

aia21@cam.ac.uk said:
> sleeping process 29410 got unexpected signal : 11
> I now have to press Ctrl+C to get back to my shell. 

This one is slightly subtle, but I believe that it is fixed by the following 
patch.

				Jeff


Index: 2.6.9/arch/um/kernel/tt/process_kern.c
===================================================================
--- 2.6.9.orig/arch/um/kernel/tt/process_kern.c	2004-11-16 12:14:15.000000000 -0500
+++ 2.6.9/arch/um/kernel/tt/process_kern.c	2004-11-17 18:24:25.000000000 -0500
@@ -65,7 +65,8 @@
 		panic("write of switch_pipe failed, err = %d", -err);
 
 	reading = 1;
-	if((from->exit_state == EXIT_ZOMBIE) || (from->exit_state == EXIT_DEAD))
+	if((from->exit_state == EXIT_ZOMBIE) ||
+	   (from->exit_state == EXIT_DEAD))
 		os_kill_process(os_getpid(), 0);
 
 	err = os_read_file(from->thread.mode.tt.switch_pipe[0], &c, sizeof(c));
@@ -82,7 +83,7 @@
 	prev_sched = current->thread.prev_sched;
 	if((prev_sched->exit_state == EXIT_ZOMBIE) ||
 	   (prev_sched->exit_state == EXIT_DEAD))
-		os_kill_ptraced_process(prev_sched->thread.mode.tt.extern_pid, 1);
+		os_kill_process(prev_sched->thread.mode.tt.extern_pid, 1);
 
 	/* This works around a nasty race with 'jail'.  If we are switching
 	 * between two threads of a threaded app and the incoming process 
Index: 2.6.9/arch/um/kernel/tt/tracer.c
===================================================================
--- 2.6.9.orig/arch/um/kernel/tt/tracer.c	2004-11-16 21:26:03.000000000 -0500
+++ 2.6.9/arch/um/kernel/tt/tracer.c	2004-11-17 18:21:47.000000000 -0500
@@ -271,10 +271,28 @@
 #endif
 		else if(WIFSIGNALED(status)){
 			sig = WTERMSIG(status);
-			if(sig != 9){
+			if(sig == SIGKILL){
+				/* This is to make sure that processes die
+				 * immediately without becoming zombies on
+				 * all hosts.  Before 2.6.9, kill(pid, SIGKILL)
+				 * was enough to make sure a process went away
+				 * immediately.  After 2.6.9, they don't run
+				 * any more, but they remain as zombies.  So,
+				 * a PTRACE_CONT is necessary in order to put
+				 * them in a normal run state so that they die.
+				 * I do a PTRACE_KILL here for good measure.
+				 * Might as well kill it by all available 
+				 * means.  These calls will likely fail when
+				 * they are not needed because the process has
+				 * already disappeared.  However, they don't
+				 * hurt.
+				 */
+				ptrace(PTRACE_KILL, pid, 0, 0);
+				ptrace(PTRACE_CONT, pid, 0, 0);
+			}
+			else
 				printf("Child %d exited with signal %d\n", pid,
 				       sig);
-			}
 		}
 		else if(WIFSTOPPED(status)){
 			proc_id = pid_to_processor_id(pid);
Index: 2.6.9/arch/um/os-Linux/process.c
===================================================================
--- 2.6.9.orig/arch/um/os-Linux/process.c	2004-11-16 12:14:15.000000000 -0500
+++ 2.6.9/arch/um/os-Linux/process.c	2004-11-17 18:27:52.000000000 -0500
@@ -95,9 +95,16 @@
 		
 }
 
+/* Kill off a ptraced child by all means available.  kill it normally first,
+ * then PTRACE_KILL it, then PTRACE_CONT it in case it's in a run state from
+ * which it can't exit directly.
+ */
+
 void os_kill_ptraced_process(int pid, int reap_child)
 {
+	kill(pid, SIGKILL);
 	ptrace(PTRACE_KILL, pid);
+	ptrace(PTRACE_CONT, pid);
 	if(reap_child)
 		CATCH_EINTR(waitpid(pid, NULL, 0));
 }


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: And another bug report for UML in latest Linux 2.6-BK repository.
  2004-11-18  1:48 ` Jeff Dike
@ 2004-11-22 10:48   ` Martin Waitz
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Waitz @ 2004-11-22 10:48 UTC (permalink / raw)
  To: Jeff Dike; +Cc: Anton Altaparmakov, user-mode-linux-devel, lkml

hoi :)

On Wed, Nov 17, 2004 at 08:48:16PM -0500, Jeff Dike wrote:
> aia21@cam.ac.uk said:
> > sleeping process 29410 got unexpected signal : 11
> > I now have to press Ctrl+C to get back to my shell. 
> 
> This one is slightly subtle, but I believe that it is fixed by the following 
> patch.

It fixes the problem for me. Please send the patch to Linus.

-- 
Martin Waitz

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-22 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-16 14:03 And another bug report for UML in latest Linux 2.6-BK repository Anton Altaparmakov
2004-11-18  1:48 ` Jeff Dike
2004-11-22 10:48   ` Martin Waitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox