從oops資訊尋找出錯程式碼

來源:互聯網
上載者:User

 

 

(1)從oops crash的地方開始查起,首先找到指標訪問錯誤的程式碼

a)重新編譯核心時,選上kernel hacking--->compile the kernel with debug info

                                                                     ---->kernel
debugging

使得核心包含調試資訊,

b)然後從Oops資訊中找到“PC is at
free_block+0x8c/0x168”

##########################################################

Unable to handle kernel paging request at
virtual address 000c0604 //非法指標地址

pgd = 40004000

[000c0604] *pgd=00000000

Internal error: Oops: 817 [#1]

Modules linked in:

CPU: 0   
Not tainted  (2.6.27.18 #221)

PC is at free_block+0x78/0x168                                   //當前指令地址

LR is at release_console_sem+0x19c/0x1b8           //函數返回地址

##########################################################

從system_map中查到free_block地址0x40097ac0,+0x78得到0x40097B38

c)在核心根目錄運行arm-wrs-linux-gnueabi-armv6jel_vfp-uclibc_small-gdb
vmlinux

就可以得到出錯行

 

 

[root@kqyang-hikvision
linux-2.6.27_svn_quyong]# arm-wrs-linux-gnueabi-armv6jel_vfp-uclibc_small-gdb
vmlinux

GNU gdb
(Wind River Linux Sourcery G++ 4.3-85) 6.8.50.20080821-cvs

Copyright
(C) 2008 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 "--host=i686-pc-linux-gnu
--target=arm-wrs-linux-gnueabi".

For bug
reporting instructions, please see:

<support@windriver.com>...

(gdb) l
*0x40097B38

0x40097b38 is in free_block (include/linux/list.h:93).

88       * the prev/next entries already!

89       */

90       #include <linux/kernel.h>

91      static inline void __list_del(struct
list_head * prev, struct list_head * next)

92      {

93              next->prev = prev;

94              prev->next = next;

95      }

96

97      /**

(gdb)

 

另外,有個關於oops分析的文章不錯,地址如下:

http://blog.chinaunix.net/space.php?uid=11134731&do=blog&cuid=1166585

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.