On Wednesday 20 July 2005 16:39, Ruaidhri Power wrote:
> I've just upgraded UML,

> and came across this problem: when starting the 
> guest, output stops after "VFS: Mounted root (ext3 filesystem)
> readonly." - at that point the guest takes 100% CPU, consuming both user
> and system time.

> The host is Debian sarge, running vanilla 2.6.12 with the
> skas-2.6.12-v8.2 patch.  The guest is vanilla 2.6.12 with Paolo's
> 2.6.12-bs7 patch, though I've verified the problem still occurs without
> that patch.  I can post the host and guest's .configs if needed.

> The problem occurs on my own images which previously worked on older UML
> versions, and I've also tried one of the images from the Sourceforge
> site.
Which was the old UML version? Which is your guest distro?
Also, have you tested the old UML releases on this new host kernel version? 
Since UML address space is getting shrinked down to 32M, I fear address space 
randomization (introduced in 2.6.12) may be playing a role.

Another thing to check is if you have changed some UML config option when 
recompiling, like for instance HIGHMEM or SMP or 3_LEVEL_PAGETABLES.

> Has anyone any idea why this is happening?  If not, how should I go
> about debugging it to help the UML developers?

> The complication is that this is a headless box.  I've added `debug' to
> the kernel command line, but I don't get an xterm with gdb in.

Apart checking that you have UML utilities installed (which I think is true, 
just to make sure), probably you'd need to try an older GDB (like 
5.something). GDB 6.x triggers some problem with UML TT support.

> Yes, 
> xterm and gdb are installed and I've run xlogo to test that X11
> forwarding is working.

> Running gdb as `gdb linux' doesn't seem to work 
> because I keep receiving SIGTRAPs.

> I've heard debugging in skas mode is 
> hard, any pointers here?
It's not hard, it's just that recent GDBs get confused when UML execve()'s 
itself... Since that's only needed for TT mode (and even there it's just 
cosmetical), that can be deleted easily, and GDB then works well. It's in the 
attached patch.

> Thanks in advance for any help you can give.  Guest output follows:
>
>   [EMAIL PROTECTED]:~$ linux ubd1=swap eth0=tuntap,,,x.x.x.29 mem=768M
>   Checking for /proc/mm...found
>   Checking for the skas3 patch in the host...found
>   Checking PROT_EXEC mmap in /tmp...OK

>   Kernel virtual memory size shrunk to 32505856 bytes
Ok, here it's going to use just 32M of kernel memory rather than 768M... Did 
it happen even before?

>   Linux version 2.6.12-bs7 ([EMAIL PROTECTED]) (gcc version 3.3.5 (Debian
> 1:3.3.5-13)) #1 Wed Jul 20 12:32:41 IST 2005 Built 1 zonelists

-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
---

 linux-2.6.git-paolo/arch/um/Kconfig          |   10 ++++++++++
 linux-2.6.git-paolo/arch/um/kernel/main.c    |    2 +-
 linux-2.6.git-paolo/arch/um/kernel/um_arch.c |    6 +++---
 3 files changed, 14 insertions(+), 4 deletions(-)

diff -puN arch/um/kernel/main.c~uml-fix-host-debug-on-TT-binaries arch/um/kernel/main.c
--- linux-2.6.git/arch/um/kernel/main.c~uml-fix-host-debug-on-TT-binaries	2005-07-18 18:53:19.000000000 +0200
+++ linux-2.6.git-paolo/arch/um/kernel/main.c	2005-07-18 18:53:19.000000000 +0200
@@ -97,7 +97,7 @@ int main(int argc, char **argv, char **e
 		exit(1);
 	}
 
-#ifdef UML_CONFIG_MODE_TT
+#ifdef UML_CONFIG_CMDLINE_ON_HOST
 	/* Allocate memory for thread command lines */
 	if(argc < 2 || strlen(argv[1]) < THREAD_NAME_LEN - 1){
 
diff -puN arch/um/kernel/um_arch.c~uml-fix-host-debug-on-TT-binaries arch/um/kernel/um_arch.c
--- linux-2.6.git/arch/um/kernel/um_arch.c~uml-fix-host-debug-on-TT-binaries	2005-07-18 18:53:19.000000000 +0200
+++ linux-2.6.git-paolo/arch/um/kernel/um_arch.c	2005-07-18 18:53:19.000000000 +0200
@@ -123,7 +123,7 @@ unsigned long start_vm;
 unsigned long end_vm;
 int ncpus = 1;
 
-#ifdef CONFIG_MODE_TT
+#ifdef CONFIG_CMDLINE_ON_HOST
 /* Pointer set in linux_main, the array itself is private to each thread,
  * and changed at address space creation time so this poses no concurrency
  * problems.
@@ -138,7 +138,7 @@ long physmem_size = 32 * 1024 * 1024;
 
 void set_cmdline(char *cmd)
 {
-#ifdef CONFIG_MODE_TT
+#ifdef CONFIG_CMDLINE_ON_HOST
 	char *umid, *ptr;
 
 	if(CHOOSE_MODE(honeypot, 0)) return;
@@ -366,7 +366,7 @@ int linux_main(int argc, char **argv)
 
 	setup_machinename(system_utsname.machine);
 
-#ifdef CONFIG_MODE_TT
+#ifdef CONFIG_CMDLINE_ON_HOST
 	argv1_begin = argv[1];
 	argv1_end = &argv[1][strlen(argv[1])];
 #endif
diff -puN arch/um/Kconfig~uml-fix-host-debug-on-TT-binaries arch/um/Kconfig
--- linux-2.6.git/arch/um/Kconfig~uml-fix-host-debug-on-TT-binaries	2005-07-18 18:53:19.000000000 +0200
+++ linux-2.6.git-paolo/arch/um/Kconfig	2005-07-18 18:53:19.000000000 +0200
@@ -51,6 +51,16 @@ config MODE_TT
 	use only skas mode (and the host has the skas patch applied to it),
 	then it is OK to say N here.
 
+config CMDLINE_ON_HOST
+	bool
+	depends on MODE_TT && !DEBUG_INFO
+	default y
+	help
+	This controls whether arguments in guest processes should be shown at all.
+	I'm disabling this when TT mode is enabled because it creates problems
+	with host debugging, on recent GDB versions (starting from the execvp
+	point).
+
 config STATIC_LINK
 	bool "Force a static link"
 	default n
_

Reply via email to