[opensuse-kernel] Need help with gdb debugging the kernel
to investigate https://bugzilla.kernel.org/show_bug.cgi?id=15786 on current openSUSE:Factory, I got asked to use gdb on the kernel I have these packages installed: # rpm -qa kernel-* kernel-desktop-debugsource-2.6.34-4.1.i586 kernel-desktop-devel-2.6.34-4.1.i586 kernel-source-2.6.34-4.1.noarch kernel-desktop-devel-debuginfo-2.6.34-4.1.i586 kernel-desktop-debuginfo-2.6.34-4.1.i586 kernel-devel-2.6.34-4.1.noarch kernel-firmware-20100227-2.2.noarch kernel-desktop-2.6.34-4.1.i586 I've uncompressed /boot/vmlinux-2.6.34-rc4-4-desktop.gz. Running gdb shows: # gdb vmlinux-2.6.34-rc4-4-desktop /proc/kcore GNU gdb (GDB) SUSE (7.0.1-2.5) Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i586-suse-linux". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /boot/vmlinux-2.6.34-rc4-4-desktop...Reading symbols from /usr/lib/debug/boot/vmlinux-2.6.34-rc4-4-desktop.debug...done. done. warning: core file may not match specified executable file. Core was generated by `root=/dev/disk/by-id/ata-ST9160411AS_5TG1MMND-part2 resume=/dev/disk/by-id/ata-S'. #0 0x00000000 in ?? () (gdb) p jiffies $1 = 0 (gdb) p loops_per_jiffy $2 = 0 Those values do not make sense to me at all. Also disassembling gives me only zeros: (gdb) disassemble /r apbt_cpuhp_notify Dump of assembler code for function apbt_cpuhp_notify: 0xc02240f0 <apbt_cpuhp_notify+0>: 00 00 add %al,(%eax) 0xc02240f2 <apbt_cpuhp_notify+2>: 00 00 add %al,(%eax) 0xc02240f4 <apbt_cpuhp_notify+4>: 00 00 add %al,(%eax) 0xc02240f6 <apbt_cpuhp_notify+6>: 00 00 add %al,(%eax) 0xc02240f8 <apbt_cpuhp_notify+8>: 00 00 add %al,(%eax) 0xc02240fa <apbt_cpuhp_notify+10>: 00 00 add %al,(%eax) 0xc02240fc <apbt_cpuhp_notify+12>: 00 00 add %al,(%eax) 0xc02240fe <apbt_cpuhp_notify+14>: 00 00 add %al,(%eax) 0xc0224100 <apbt_cpuhp_notify+16>: 00 00 add %al,(%eax) So, what am I doing wrong? Or what is broken? Andreas -- Andreas Jaeger, Program Manager openSUSE, aj@{novell.com,opensuse.org} Twitter: jaegerandi | Identica: jaegerandi SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Maxfeldstr. 5, 90409 Nürnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
Am 19.04.2010 20:12, schrieb Andreas Jaeger:
(gdb) disassemble /r apbt_cpuhp_notify Dump of assembler code for function apbt_cpuhp_notify: 0xc02240f0<apbt_cpuhp_notify+0>: 00 00 add %al,(%eax) 0xc02240f2<apbt_cpuhp_notify+2>: 00 00 add %al,(%eax) 0xc02240f4<apbt_cpuhp_notify+4>: 00 00 add %al,(%eax) 0xc02240f6<apbt_cpuhp_notify+6>: 00 00 add %al,(%eax) 0xc02240f8<apbt_cpuhp_notify+8>: 00 00 add %al,(%eax) 0xc02240fa<apbt_cpuhp_notify+10>: 00 00 add %al,(%eax) 0xc02240fc<apbt_cpuhp_notify+12>: 00 00 add %al,(%eax) 0xc02240fe<apbt_cpuhp_notify+14>: 00 00 add %al,(%eax) 0xc0224100<apbt_cpuhp_notify+16>: 00 00 add %al,(%eax)
Looks like gdb reads the wrong values from /proc/kcore. Could you give crash live debugging a try? Just invoking crash with the kernel should work: % crash -s /boot/vmlinux-2.6.34-rc4-4-desktop crash> p jiffies The disassemble feature of GDB should also work without /proc/kcore, just with the kernel image. Doesn't it? Regards, Bernhard -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
On Tuesday 20 April 2010 08:33:11 Bernhard Walle wrote:
Am 19.04.2010 20:12, schrieb Andreas Jaeger:
(gdb) disassemble /r apbt_cpuhp_notify Dump of assembler code for function apbt_cpuhp_notify: 0xc02240f0<apbt_cpuhp_notify+0>: 00 00 add %al,(%eax) 0xc02240f2<apbt_cpuhp_notify+2>: 00 00 add %al,(%eax) 0xc02240f4<apbt_cpuhp_notify+4>: 00 00 add %al,(%eax) 0xc02240f6<apbt_cpuhp_notify+6>: 00 00 add %al,(%eax) 0xc02240f8<apbt_cpuhp_notify+8>: 00 00 add %al,(%eax) 0xc02240fa<apbt_cpuhp_notify+10>: 00 00 add %al,(%eax) 0xc02240fc<apbt_cpuhp_notify+12>: 00 00 add %al,(%eax) 0xc02240fe<apbt_cpuhp_notify+14>: 00 00 add %al,(%eax) 0xc0224100<apbt_cpuhp_notify+16>: 00 00 add %al,(%eax)
Looks like gdb reads the wrong values from /proc/kcore.
Should I open a bugreport?
Could you give crash live debugging a try? Just invoking crash with the kernel should work:
% crash -s /boot/vmlinux-2.6.34-rc4-4-desktop crash> p jiffies
Does not work for me: crash -s /boot/vmlinux-2.6.34-rc4-4-desktop crash: cannot determine idle task addresses from init_tasks[] or runqueues[] crash: cannot resolve "init_task_union" Another bug report?
The disassemble feature of GDB should also work without /proc/kcore, just with the kernel image. Doesn't it?
Yes, that works and looks sane: gdb /boot/vmlinux-2.6.34-rc4-4-desktop ... (gdb) disassemble apbt_cpuhp_notify Dump of assembler code for function apbt_cpuhp_notify: 0xc02240f0 <+0>: push %ebp 0xc02240f1 <+1>: mov $0xc0a03fe0,%eax 0xc02240f6 <+6>: mov %esp,%ebp 0xc02240f8 <+8>: sub $0x14,%esp 0xc02240fb <+11>: mov %ebx,-0x8(%ebp) Andreas -- Andreas Jaeger, Program Manager openSUSE, aj@{novell.com,opensuse.org} Twitter: jaegerandi | Identica: jaegerandi SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Maxfeldstr. 5, 90409 Nürnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
Am 20.04.2010 10:30, schrieb Andreas Jaeger:
Looks like gdb reads the wrong values from /proc/kcore.
Should I open a bugreport?
Would be reasonable.
Could you give crash live debugging a try? Just invoking crash with the kernel should work:
% crash -s /boot/vmlinux-2.6.34-rc4-4-desktop crash> p jiffies
Does not work for me:
crash -s /boot/vmlinux-2.6.34-rc4-4-desktop crash: cannot determine idle task addresses from init_tasks[] or runqueues[]
crash: cannot resolve "init_task_union"
Looks like that's already fixed in the latest release:
5.0.3 - Fix for running against 2.6.34 and later kernels to recognize and handle changes in the kernel's per-cpu data symbol naming, which no longer prefixes "per_cpu__" to declared per-cpu symbol names. Without the patch, an x86_64 crash session fails completely during initialization with the error message "crash: cannot determine idle task addresses from init_tasks[] or runqueues[]", followed by "crash: cannot resolve init_task_union"; on architectures such as the x86, the session comes up to the "crash>" prompt, but displays warning messages such as "WARNING: duplicate idle tasks?", the "swapper" tasks are not found, and any command accessing per-cpu data fails. (anderson@redhat.com)
I updated the crash package in Kernel:kdump and sr'd to Factory. Please try with 5.0.3. Regards, Bernhard -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
On Tuesday 20 April 2010 21:17:53 Bernhard Walle wrote:
Am 20.04.2010 10:30, schrieb Andreas Jaeger:
Looks like gdb reads the wrong values from /proc/kcore.
Should I open a bugreport?
Would be reasonable.
OK, bnc#598461.
Looks like that's already fixed in the latest release:
5.0.3 - Fix for running against 2.6.34 and later kernels to recognize [...]
I saw your update - thanks, Andreas -- Andreas Jaeger, Program Manager openSUSE, aj@{novell.com,opensuse.org} Twitter: jaegerandi | Identica: jaegerandi SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Maxfeldstr. 5, 90409 Nürnberg, Germany GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
Andreas Jaeger píše v St 21. 04. 2010 v 14:54 +0200:
On Tuesday 20 April 2010 21:17:53 Bernhard Walle wrote:
Am 20.04.2010 10:30, schrieb Andreas Jaeger:
Looks like gdb reads the wrong values from /proc/kcore.
Should I open a bugreport?
Would be reasonable.
OK, bnc#598461.
Looks like that's already fixed in the latest release:
5.0.3 - Fix for running against 2.6.34 and later kernels to recognize [...]
I saw your update - thanks,
Yes, thank you, too. I knew I couldn't make and test the upgrade until the end of the month, so this has saved me the effort. Petr Tesarik L3 International -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
participants (3)
-
Andreas Jaeger
-
Bernhard Walle
-
Petr Tesarik