From: Péter S. <pt...@gm...> - 2010-11-20 22:38:50
|
Hi, I'm running linux con0=fd:0,fd:1 </dev/null and I get 100% CPU usage before UML can mount the root file system. If I remove `</dev/null', it works like a charm. It seems that UML doesn't work if stdin is not a tty. Redirecting stdout always works. Locating the bottom of the address space ... 0x0 Locating the top of the address space ... 0xc0000000 Core dump limits : soft - 0 hard - NONE Checking that ptrace can change system call numbers...Checking that ptrace can change system call numbers...OK Checking syscall emulation patch for ptrace...Checking syscall emulation patch for ptrace...OK Checking advanced syscall emulation patch for ptrace...Checking advanced syscall emulation patch for ptrace...OK Checking for tmpfs mount on /dev/shm...OK Checking PROT_EXEC mmap in /dev/shm/...OK Checking for the skas3 patch in the host: - /proc/mm...not found - PTRACE_FAULTINFO...not found - /proc/mm...not found - PTRACE_FAULTINFO... - PTRACE_LDT...not found - PTRACE_LDT...UML running in SKAS0 mode Adding 28913664 bytes to physical memory to account for exec-shield gap [ 0.000000] Linux version 2.6.36 (root@narancs) (gcc version 4.1.2) #42 Sat Nov 20 23:23:55 CET 2010 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 12083 [ 0.000000] Kernel command line: con=null ssl=null con0=fd:0,fd:1 mem=20M ubdb=hello.in root=98:0 [ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes) [ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Memory: 18528k available [ 0.000000] Hierarchical RCU implementation. [ 0.000000] RCU-based detection of stalled CPUs is disabled. [ 0.000000] Verbose stalled-CPUs detection is disabled. [ 0.000000] NR_IRQS:15 [ 0.000000] Calibrating delay loop... 3512.72 BogoMIPS (lpj=17563648) [ 0.280000] pid_max: default: 32768 minimum: 301 [ 0.280000] Mount-cache hash table entries: 512 [ 0.280000] Checking for host processor cmov support...Yes [ 0.280000] Checking that host ptys support output SIGIO...Yes [ 0.280000] Checking that host ptys support SIGIO on close...No, enabling workaround [ 0.280000] Using 2.6 host AIO [ 0.280000] bio: create slab <bio-0> at 0 [ 0.280000] Switching to clocksource itimer [ 0.280000] Host TLS support detected [ 0.280000] Detected host type: i386 (GDT indexes 6 to 9) [ 0.280000] io scheduler noop registered [ 0.280000] io scheduler cfq registered (default) [ 0.280000] Initialized stdio console driver [ 0.280000] Console initialized on /dev/tty0 [ 0.280000] console [tty0] enabled [ 0.280000] Initializing software serial port version 1 [ 0.280000] ubda: unknown partition table [ 0.280000] ubdb: unknown partition table At this point it hangs unless stdin is s tty. Without </dev/null, it continues and mounts the root filesystem. I've tried to add some random printk()s to arch/um/drivers/chan_kern.c, and it seems that enable_chan is called only once, but it returns many times. Maybe there is a buffer overflow and a stack corruption somewhere? Thanks, Péter |