LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2011, 07:58 AM   #1
gsinde
LQ Newbie
 
Registered: Jan 2011
Posts: 11

Rep: Reputation: 0
Best Way to Begin Debugging Kernel Oops


I am running 2.6.30 on the AT91SAM9G45 and about twice a day, I get a Kernel Oops that is usually catastrophic. Although I have been doing embedded firmware for a long time, I only have a few months on Linux and was wondering what is the best way to begin to look at the Kernel Oops Dump (shown below). Is there a way to decode this other then the obvious. From my newbie eyes, it looks like the I2C (mdio) read on the Ethernet Phy during an interrupt cause a failure but since this is my first real problem to solve in Linux, I wanted to ask the experts first and then to ask how to enable and add debug commands properly into the kernel to debug the problem. Thanks, Gary

# Unable to handle kernel paging request at virtual address fffff100
pgd = c0004000
[fffff100] *pgd=7065a031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] PREEMPT
Modules linked in:
CPU: 0 Not tainted (2.6.30-e400-armv5l #90)
PC is at __irq_svc+0x48/0x8c
LR is at _text+0x4c/0x80
pc : [<c002da48>] lr : [<c002d04c>] psr: 00000093
sp : cf825f08 ip : 00000000 fp : cfa89b04
r10: 00000000 r9 : cf824000 r8 : 00000000
r7 : 00000001 r6 : 00000019 r5 : fffff000 r4 : ffffffff
r3 : cf824000 r2 : 00000002 r1 : cfa6b338 r0 : 00000001
Flags: nzcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
Control: 0005317f Table: 7fb5c000 DAC: 00000017
Process events/0 (pid: 4, stack limit = 0xcf824268)
Stack: (0xcf825f08 to 0xcf826000)
5f00: d0880000 00000002 d0880000 cfa6b300 cfa89c00 cfa89c28
5f20: 00000005 00000001 c01c8d74 cf825fa4 00000000 cfa89b04 cf825f50 cf825f50
5f40: c01ca168 c01ca764 60000013 ffffffff cfa89a00 00000000 cfa89b30 00000000
5f60: c01c8d74 c01c9564 cfa89a00 cfa89b04 cfa89b30 c0414400 c01c8d74 c01c8fe8
5f80: cf801880 cf824000 cf801880 c0414400 c01c8d74 c0058868 cf801888 00000000
5fa0: c03f4f18 00000000 cf812340 c005cc18 cf825fb0 cf825fb0 cf801880 cf824000
5fc0: c041aa70 c00586ec cf801880 00000000 00000000 00000000 00000000 c005c884
5fe0: 00000000 00000000 00000000 00000000 00000000 c0049714 fff7ffff ffbfffff
[<c002da48>] (__irq_svc+0x48/0x8c) from [<c01ca168>] (mdiobus_read+0x50/0x74)
[<c01ca168>] (mdiobus_read+0x50/0x74) from [<c01c9564>] (genphy_read_status+0xd4
/0x18c)
[<c01c9564>] (genphy_read_status+0xd4/0x18c) from [<c01c8fe8>] (phy_state_machin
e+0x274/0x450)
[<c01c8fe8>] (phy_state_machine+0x274/0x450) from [<c0058868>] (worker_thread+0x
17c/0x2f0)
[<c0058868>] (worker_thread+0x17c/0x2f0) from [<c005c884>] (kthread+0x54/0x8c)
[<c005c884>] (kthread+0x54/0x8c) from [<c0049714>] (do_exit+0x0/0x6fc)
[<c0049714>] (do_exit+0x0/0x6fc) from [<cf8121c8>] (0xcf8121c8)
Code: e5998004 e2887001 e5897004 e59f503c (e5950100)
---[ end trace 632a28868c477a32 ]---
note: events/0[4] exited with preempt_count 1
 
Old 02-24-2011, 11:49 AM   #2
gsinde
LQ Newbie
 
Registered: Jan 2011
Posts: 11

Original Poster
Rep: Reputation: 0
Since nobody has responded, I will keep updating this with valuable information.
The first thing I learned today is how to use GDB to determine the line of code from the Oops

You can start gdb on the vmlinux file and then use the info line command to detrmine a line of code from the Oops stack call list above:

~/Projects/e400-kernel$ gdb vmlinux
GNU gdb (GDB) 7.1-ubuntu
Reading symbols from /home/gsinde/Projects/e400-kernel/vmlinux...done.
(gdb) info line *(mdiobus_read + 0x50)
Line 244 of "drivers/net/phy/mdio_bus.c" starts at address 0xc01ca168 <mdiobus_read+80> and ends at 0xc01ca180 <mdiobus_read+104>.
(gdb) info line *(phy_state_machine + 0x274)
Line 885 of "drivers/net/phy/phy.c" starts at address 0xc01c8fe8 <$a+532> and ends at 0xc01c8ff0 <$a+540>.
(gdb)

More to come...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stepping into the world of kernel oops debugging kushalkoolwal Linux - Kernel 4 12-30-2010 12:04 PM
Need help to begin kernel programming techieanupam Linux - Kernel 3 12-16-2010 02:55 AM
Difference between kernel - debugging and application debugging topworld Linux - Software 2 03-30-2006 12:50 AM
Visual Debugging and Linux Kernel Debugging Igor007 Programming 0 09-30-2005 10:33 AM
Making a kernel change. Where do I begin? dman65 Programming 4 04-22-2005 02:40 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration