I tried to use gdb on the kernel to analyze the TCP/IP stack. After the first
breakpoint I get a non-ending series of SIGTRAPs (I'm not sure whether it's for
every instruction or every line of code), which makes debugging impossible. The
behaviour persists also after deleting all breakpoints (ie. I cannot go back to
execute the kernel normally).

All ideas and suggestions are welcome. If this is a known problem, could you
point me to some web-site?

Thanks,
Urs


I use gdb 5.3post-0.20021129.18rh.

The host kernel and the UML kernel both have been compiled with gcc 3.2.3
20030502 (Red Hat Linux 3.2.3-47).

The host kernel is  a vanilla 2.6.11.5 with only the skas patch applied.

The UML kernel is a vanilla 2.6.6 kernel with only the UML patch applied. TT is
disabled. Kernel debugging and ptrace are enabled. All other debugging options
are disabled. Otherwise I use a pretty standard configuration.


Here's a complete gdb session transcript (I terminated the session by sending a
SIGTERM to the uml kernel):

GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) handle SIGUSR1 pass nostop noprint
Signal        Stop      Print   Pass to program Description
SIGUSR1       No        No      Yes             User defined signal 1
(gdb) handle SIGSEGV pass nostop noprint
Signal        Stop      Print   Pass to program Description
SIGSEGV       No        No      Yes             Segmentation fault
(gdb) break ip_output.c:299
Breakpoint 1 at 0x600e9257: file net/ipv4/ip_output.c, line 299.
(gdb) dir /home/hun/uml/usr/src/linux-2.6.6
Source directories searched: /home/hun/uml/usr/src/linux-2.6.6:$cdir:$cwd
(gdb) r ubd0=./uml_root_fs.img ubd1=./uml_swap.img eth0=tuntap,,,192.168.0.254
Starting program: /home/hun/uml/linux ubd0=./uml_root_fs.img ubd1=./uml_swap.img
eth0=tuntap,,,192.168.0.254
Checking for the skas3 patch in the host...found
Checking for /proc/mm...found
Linux version 2.6.6-1um ([EMAIL PROTECTED]) (gcc version 3.2.3 20030502
(Red Hat Linux 3.2.3-47)) #7 Mon May 2 08:27:49 CEST 2005
On node 0 totalpages: 8192
  DMA zone: 8192 pages, LIFO batch:2
  Normal zone: 0 pages, LIFO batch:1
  HighMem zone: 0 pages, LIFO batch:1
Built 1 zonelists
Kernel command line: ubd0=./uml_root_fs.img ubd1=./uml_swap.img
eth0=tuntap,,,192.168.0.254 root=98:0
PID hash table entries: 16 (order 4: 128 bytes)
Memory: 30400k available
Calibrating delay loop... 2385.51 BogoMIPS
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
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 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)
POSIX conformance testing by UNIFIX
NET: Registered protocol family 16
SCSI subsystem initialized
mconsole (version 2) initialized on /home/hun/.uml/DXGDfh/mconsole
ubd : Synchronous mode
Netdevice 0 : TUN/TAP backend - IP = 192.168.0.254
Initializing Cryptographic API
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
Universal TUN/TAP device driver 1.5 (C)1999-2002 Maxim Krasnyansky
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 4096)
Initializing IPsec netlink socket
NET: Registered protocol family 1
NET: Registered protocol family 17
Initializing software serial port version 1
Using anticipatory io scheduler
 ubda: unknown partition table
 ubdb: unknown partition table
Initializing stdio console driver
EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access will be enabled during recovery.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
INIT: version 2.84 booting

Gentoo Linux; http://www.gentoo.org/
 Copyright 2001-2004 Gentoo Technologies, Inc.; Distributed under the GPL

 * Mounting proc at /proc...  [ ok ]
 * Mounting sysfs at /sys...  [ ok ]
 * Mounting ramfs at /dev...  [ ok ]
 * Configuring system to use udev... *   Populating /dev with device nodes...
 *   Using /sbin/hotplug for udev management...
  [ ok ]
 * Mounting devpts at /dev/pts...  [ ok ]
 * Activating (possible) swap...Adding 524280k swap on /dev/ubd1.  Priority:-1
extents:1
  [ ok ]
 * Remounting root filesystem read-only (if necessary)...  [ ok ]
 * Checking root filesystem.../dev/ubd0: clean, 187415/786432 files,
385502/1572864 blocks
  [ ok ]
 * Remounting root filesystem read/write...  [ ok ]
 * You need to set /etc/hostname to a valid hostname
 * Setting hostname to localhost...  [ ok ]
 * Calculating module dependencies...  [ ok ]
 * Checking all filesystems...  [ ok ]
 * Mounting local filesystems...  [ ok ]
 * Activating (possibly) more swap...  [ ok ]
 * Caching service dependencies... * Setting system clock to hardware clock
[UTC]...  [ ok ]
 * Configuring kernel parameters...  [ ok ]
 * Updating environment...  [ ok ]
 * Cleaning /var/lock, /var/run...  [ ok ]
 * Cleaning /tmp directory...  [ ok ]
 * Setting user font...Couldnt open /dev/vc/1
Couldnt open /dev/vc/2
 * Failed to set user font
  [ !! ]

 * Loading key mappings...Couldnt get a file descriptor referring to the console
* Error loading key mappings
  [ !! ]

 * Bringing lo up...  [ ok ]
 * Initializing random number generator...  [ ok ]
INIT: Entering runlevel: 3
 * sysklogd -> start: syslogd...  [ ok ]
 * sysklogd -> start: klogd...  [ ok ]
 * Bringing eth0 up (192.168.0.1)...  [ ok ]
 *   Setting default gateway (192.168.0.254)...  [ ok ]
 * Mounting network filesystems...  [ ok ]
 * Starting sshd...  [ ok ]
 * Starting local...  [ ok ]

Breakpoint 1, ip_queue_xmit (skb=0x6112cb40, ipfragok=0)
    at net/ipv4/ip_output.c:299
warning: Source file is more recent than executable.

299             struct sock *sk = skb->sk;
(gdb) c
Continuing.

Breakpoint 1, ip_queue_xmit (skb=0x6112cb40, ipfragok=0)
    at net/ipv4/ip_output.c:299
299             struct sock *sk = skb->sk;
(gdb)
Continuing.

Breakpoint 1, ip_queue_xmit (skb=0x6112cb40, ipfragok=0)
    at net/ipv4/ip_output.c:299
299             struct sock *sk = skb->sk;
(gdb)
Continuing.

Breakpoint 1, ip_queue_xmit (skb=0x6112cb40, ipfragok=0)
    at net/ipv4/ip_output.c:299
299             struct sock *sk = skb->sk;
(gdb)
Continuing.

Breakpoint 1, ip_queue_xmit (skb=0x6112cb40, ipfragok=0)
    at net/ipv4/ip_output.c:299
299             struct sock *sk = skb->sk;
(gdb) del 1
(gdb) show break
Undefined show command: "break".  Try "help show".
(gdb) info break
No breakpoints or watchpoints.
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0x600e925a in ip_queue_xmit (skb=0x6112cb40, ipfragok=0)
    at net/ipv4/ip_output.c:299
299             struct sock *sk = skb->sk;
(gdb)
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
ip_queue_xmit (skb=0x6112cb40, ipfragok=0) at ip.h:164
164     ip.h: No such file or directory.
        in ip.h
(gdb)
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0x600e9265 in ip_queue_xmit (skb=0x6112cb40, ipfragok=0) at ip.h:164
164     in ip.h
(gdb)
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
ip_queue_xmit (skb=0x6112cb40, ipfragok=0) at net/ipv4/ip_output.c:301
301             struct ip_options *opt = inet->opt;
(gdb)
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0x600e926e in ip_queue_xmit (skb=0x6112cb40, ipfragok=0)
    at net/ipv4/ip_output.c:301
301             struct ip_options *opt = inet->opt;
(gdb) c
Continuing.

Program received signal SIGTERM, Terminated.
0x00921f79 in sigprocmask () from /lib/tls/libc.so.6
(gdb)
Continuing.

Program exited with code 01.
(gdb)






-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to