From: <fer...@ct...> - 2007-09-12 19:57:22
|
Dear Jeff, >> On Wed, Sep 05, 2007 at 01:13:52PM +0200, Fermín Galán Márquez wrote: >>> I will try to do so, but I understand reading the documentation >>> (http://user-mode-linux.sourceforge.net/old/UserModeLinux-HOWTO-11.html#debugging) >>> that in order to get a stack trace I need to compile the UML kernel with >>> CONFIG_DEBUGSYM and CONFIG_PT_PROXY. >> That's obsolete. >> >> You need CONFIG_DEBUG_INFO and CONFIG_FRAME_POINTER which are both >> under Kernel Hacking. > > Ok, I'll try to compile a debug kernel and come back with a stack trace > in the next few days. This is the trace (as you can see I're repeated the experiment twice, the result is basically the same), hoping it could be useful to diagnose the problem and fix eventual bugs in the UML kernel. See below regarding the test procedure. (gdb) bt #0 0xb7f9d7f2 in ?? () from /lib/ld-linux.so.2 #1 0xb7f19ab0 in tcsetattr () from /lib/i686/cmov/libc.so.6 #2 0x080610d5 in generic_console_write (fd=7, buf=0x828fc13 "ip_tables: (C) 2000-2006 Netfilter Core Team\n", n=45) at arch/um/drivers/chan_user.c:37 #3 0x0806096e in console_write_chan (chans=0x82756f0, buf=0x828fc13 "ip_tables: (C) 2000-2006 Netfilter Core Team\n", len=45) at arch/um/drivers/chan_kern.c:352 #4 0x08060232 in uml_console_write (console=0x8275ca0, string=0x828fc13 "ip_tables: (C) 2000-2006 Netfilter Core Team\n", len=45) at arch/um/drivers/stdio_console.c:132 #5 0x0807595b in __call_console_drivers (start=3059, end=3104) at kernel/printk.c:331 #6 0x080759cf in _call_console_drivers (start=3059, end=3104, msg_log_level=4) at kernel/printk.c:361 #7 0x08075aa3 in call_console_drivers (start=3056, end=3104) at kernel/printk.c:404 #8 0x08075f85 in release_console_sem () at kernel/printk.c:827 #9 0x08075dcc in vprintk ( fmt=0xa83f2c8 "ip_tables: (C) 2000-2006 Netfilter Core Team\n", args=0x951bf10 "\200\t\204\n$?Q\tm?\b\b?\r\005\b") at kernel/printk.c:613 #10 0x08075bdf in printk ( fmt=0xa83f2c8 "ip_tables: (C) 2000-2006 Netfilter Core Team\n") at kernel/printk.c:507 #11 0x0a811062 in ?? () #12 0x0a83f2c8 in ?? () #13 0x0a840980 in ?? () #14 0x0951bf24 in ?? () #15 0x0808f16d in sys_init_module (umod=0x8050dc0, len=0, uargs=0x951bf70 "\214?Q\t\234?\006\bT?\205\t[\023") at kernel/module.c:2015 #16 0x0808f16d in sys_init_module (umod=0x40166000, len=156732, uargs=0x8050dc0 "9&\b??\002i??????E?") at kernel/module.c:2015 #17 0x0805f882 in handle_syscall (r=0x985c254) at arch/um/kernel/skas/syscall.c:38 #18 0x0806e09c in handle_trap (pid=4955, regs=0x985c254, local_using_sysemu=2) at arch/um/os-Linux/skas/process.c:173 #19 0x0806e48f in userspace (regs=0x985c254) at arch/um/os-Linux/skas/process.c:330 #20 0x0805f5a5 in fork_handler () at arch/um/kernel/skas/process.c:96 #21 0x00000000 in ?? () (gdb) bt #0 0xb7fc07f2 in ?? () from /lib/ld-linux.so.2 #1 0xb7f3cab0 in tcsetattr () from /lib/i686/cmov/libc.so.6 #2 0x080610d5 in generic_console_write (fd=7, buf=0x828fb7e "ip_tables: (C) 2000-2006 Netfilter Core Team\n", n=45) at arch/um/drivers/chan_user.c:37 #3 0x0806096e in console_write_chan (chans=0x82756f0, buf=0x828fb7e "ip_tables: (C) 2000-2006 Netfilter Core Team\n", len=45) at arch/um/drivers/chan_kern.c:352 #4 0x08060232 in uml_console_write (console=0x8275ca0, string=0x828fb7e "ip_tables: (C) 2000-2006 Netfilter Core Team\n", len=45) at arch/um/drivers/stdio_console.c:132 #5 0x0807595b in __call_console_drivers (start=2910, end=2955) at kernel/printk.c:331 #6 0x080759cf in _call_console_drivers (start=2910, end=2955, msg_log_level=4) at kernel/printk.c:361 #7 0x08075aa3 in call_console_drivers (start=2907, end=2955) at kernel/printk.c:404 #8 0x08075f85 in release_console_sem () at kernel/printk.c:827 #9 0x08075dcc in vprintk ( fmt=0xa83f2c8 "ip_tables: (C) 2000-2006 Netfilter Core Team\n", args=0x9c17f10 "\200\t\204\n$\177?\tm?\b\b?\r\005\b") at kernel/printk.c:613 #10 0x08075bdf in printk ( fmt=0xa83f2c8 "ip_tables: (C) 2000-2006 Netfilter Core Team\n") at kernel/printk.c:507 #11 0x0a811062 in ?? () #12 0x0a83f2c8 in ?? () #13 0x0a840980 in ?? () #14 0x09c17f24 in ?? () #15 0x0808f16d in sys_init_module (umod=0x8050dc0, len=0, uargs=0x9c17f70 "\214\177?\t\234?\006\bt\b\207\t?\017") at kernel/module.c:2015 #16 0x0808f16d in sys_init_module (umod=0x40166000, len=156732, uargs=0x8050dc0 "9&\b??\002i??????E?") at kernel/module.c:2015 #17 0x0805f882 in handle_syscall (r=0x9870874) at arch/um/kernel/skas/syscall.c:38 #18 0x0806e09c in handle_trap (pid=4031, regs=0x9870874, local_using_sysemu=2) at arch/um/os-Linux/skas/process.c:173 #19 0x0806e48f in userspace (regs=0x9870874) at arch/um/os-Linux/skas/process.c:330 #20 0x0805f5a5 in fork_handler () at arch/um/kernel/skas/process.c:96 #21 0x00000000 in ?? () The procedure to get the traces has been as follow (inspired in http://user-mode-linux.sourceforge.net/hacking.html). 1. Compile a 2.6.22.4 kernel with CONFIG_DEBUG_INFO and CONFIG_FRAME_POINTER enabled. 2. Run a vm with the following command line: ./linux ubd0=/tmp/root_fs_debug con=null con0=pts uml_dir=/tmp umid=run 3. Get the pts associated with the vm (i.e., /dev/pts/X) using 'uml_mconsole config con0' 4. Access to the vm with 'screen /dev/pts/X'. Then issue 'iptables -L'. The vm hangs and the top command run in the host shows a CPU usage around 100% for the linux process. 5. Attach gdb to the linux process using: gdb ./linux `cat /tmp/run/pid` 6. Get the bt (shown above) If this is not the right procedure (or if you need additional information), please tell me so and how has to be done. Best regards, -------------------- Fermín Galán Márquez CTTC - Centre Tecnològic de Telecomunicacions de Catalunya Parc Mediterrani de la Tecnologia, Av. del Canal Olímpic s/n, 08860 Castelldefels, Spain Room 1.02 Tel : +34 93 645 29 12 Fax : +34 93 645 29 01 Email address: fermin dot galan at cttc dot es |