全部。
我是内核新手。我想知道如何从 painc 获取有用的信息,例如哪一行或哪个函数是错误的。
例如,下面是一个关于usb hiddev
的panic-output
,如何读取它?谢谢。
BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
IP: [<ffffffff813b4aa1>] free_async+0xa1/0x100
PGD 2326c9067 PUD 230f4c067 PMD 0
Oops: 0000 [#1] SMP
last sysfs file: /sys/devices/pci0000:00/0000:00:1d.2/usb8/8-2/speed
CPU 3
Modules linked in: ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM iptable_mangle bridge stp l]
Pid: 2400, comm: lsusb Tainted: G I--------------- 2.6.32-296.el664fixes.3.x86_64 #1 Dell Inc. OptiPlN
RIP: 0010:[<ffffffff813b4aa1>] do_IRQ: 0.97 No irq handler for vector (irq -1)
[Firmware Bug]: the BIOS has corrupted hw-PMU resources (MSR 186 is 53003c)
�Mounting proc filesystem
Mounting sysfs filesystem
Creating /dev
Creating initial device nodes
setfont: KDFONTOP: Invalid argument
Free memory/Total memory (free %): 78672 / 114884 ( 68.4795 )
Loading dm-mod.ko module
Loading dm-log.ko module
Loading dm-region-hash.ko module
Loading dm-mirror.ko module
Loading dm-zero.ko module
Loading dm-snapshot.ko module
Loading freq_table.ko module
Loading mperf.ko module
Loading ipt_REJECT.ko module
Loading nf_defrag_ipv4.ko module
Loading ip_tables.ko module
Loading nf_conntrack.ko module
Loading ip6_tables.ko module
Loading ipv6.ko module
Loading fat.ko module
Loading macvlan.ko module
Loading tun.ko module
Loading kvm.ko module
Loading uinput.ko module
Loading parport.ko module
Loading dcdbas.ko module
Loading microcode.ko module
<小时/>
最佳答案
panic 本身实际上是相当准确的;
BUG:无法处理 0000000000000028 处的内核 NULL 指针取消引用 IP: [] free_async+0xa1/0x100
已经表明发生问题的函数是 free_async,该函数的长度正好是 0x100 字节,崩溃发生在偏移量 0xa1 处。您需要将该偏移量映射到确切的代码行,但这在某种程度上取决于您的环境如何执行此操作。
有时,手动代码审查已经会显示哪一行进行了指针操作,因此您只需审查该函数即可做到这一点。
那么下一个问题是,为什么那里有一个 NULL 指针?
关于linux - 如何从 panic 中定位错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12065302/