本文介绍了如何阅读,理解,分析和调试Linux内核恐慌?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑下面的linux内核转储的堆栈跟踪,您可以通过调用触发内核源码code恐慌恐慌(调试linux内核恐慌);

Consider the following linux kernel dump stack trace, you can trigger a panic from the kernel source code by calling panic("debugging a linux kernel panic");:

[<001360ac>] (unwind_backtrace+0x0/0xf8) from [<00147b7c>] (warn_slowpath_common+0x50/0x60)
[<00147b7c>] (warn_slowpath_common+0x50/0x60) from [<00147c40>] (warn_slowpath_null+0x1c/0x24)
[<00147c40>] (warn_slowpath_null+0x1c/0x24) from [<0014de44>] (local_bh_enable_ip+0xa0/0xac)
[<0014de44>] (local_bh_enable_ip+0xa0/0xac) from [<0019594c>] (bdi_register+0xec/0x150)


  • unwind_backtrace +为0x0 / 0xF8时什么 +为0x0 / 0xF8时表示?

  • 我怎么能看到 unwind_backtrace +为0x0 / 0xF8时
  • 中C code
  • 如何跨preT恐慌的内容?

    • In unwind_backtrace+0x0/0xf8 what the +0x0/0xf8 stands for?
    • How can I see the C code of unwind_backtrace+0x0/0xf8?
    • How to interpret the panic's content?
    • 推荐答案

      这只是一个普通的回溯,这些函数的调用以相反的顺序(第一个叫被称为由previous之一,并依此类推):

      It's just an ordinary backtrace, those functions are called in reverse order (first one called was called by the previous one and so on):

      unwind_backtrace+0x0/0xf8
      warn_slowpath_common+0x50/0x60
      warn_slowpath_null+0x1c/0x24
      ocal_bh_enable_ip+0xa0/0xac
      bdi_register+0xec/0x150
      

      bdi_register + 0xec /量0x150 是符号+偏移/长度有大约在的以及如何调试内核哎呀。也有在

      The bdi_register+0xec/0x150 is the symbol + the offset/length there's more information about that in Understanding a Kernel Oops and how you can debug a kernel oops. Also there's this excellent tutorial on Debugging the Kernel

      注:如由Eugene以下建议,你可能想尝试第一,它仍然需要一个图像虽然与调试符号,例如:

      Note: as suggested below by Eugene, you may want to try addr2line first, it still needs an image with debugging symbols though, for example

      addr2line -e vmlinux_with_debug_info 0019594c(+偏移量)

      这篇关于如何阅读,理解,分析和调试Linux内核恐慌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-07 17:03