pid 1702:mds.c:send2Serv:106: send2Serv
Unable to handle kernel NULL pointer dereference at virtual address 0000000c
printing eip:
ca8f1503
*pde = 00000000
Oops: 0002
obcfs autofs ide-cd cdrom vmhgfs vmxnet keybdev mousedev hid input usb-uhci usbcore ext3 jbd BusLogic sd_mod scsi_mod
CPU: 0
EIP: 0060:[<ca8f1503>] Tainted: PF
EFLAGS: 00010086
EIP is at iscsi_initiator_queuecommand [obcfs] 0x73 (2.4.20-8)
eax: 00000000 ebx: 00000000 ecx: 00000000 edx: c8548000
esi: c79e7200 edi: 00000000 ebp: 00000000 esp: c857fecc
ds: 0068 es: 0068 ss: 0068
Process rm (pid: 1702, stackpage=c857f000)
Stack: ca91a259 c938e000 ca903e5e 00000246 00000000 00000000 00000000 00000000
ca8f03d0 ca8ec1c3 c79e7200 ca91a259 000000a8 00000053 00000001 00000000
00010006 00000000 00010000 00000000 00010000 00000000 c79e7000 c938e000
Call Trace: [<ca91a259>] .rodata.str1.1 [obcfs] 0x805 (0xc857fecc))
[<ca903e5e>] my_kmalloc [obcfs] 0x6e (0xc857fed4))
[<ca8f03d0>] unh_cmd_done [obcfs] 0x0 (0xc857feec))
[<ca8ec1c3>] osd_remove [obcfs] 0xb3 (0xc857fef0))
[<ca91a259>] .rodata.str1.1 [obcfs] 0x805 (0xc857fef8))
[<ca8e8e2e>] cfs_unlink [obcfs] 0x3de (0xc857ff2c))
[<ca933400>] iscsi_trace_buff [obcfs] 0x2000 (0xc857ff44))
[<c0153f32>] vfs_unlink [kernel] 0xe2 (0xc857ff68))
[<c0154187>] sys_unlink [kernel] 0x117 (0xc857ff84))
[<c0109537>] system_call [kernel] 0x33 (0xc857ffc0))
Code: 89 50 0c 8b 06 8b 58 0c 3b 1d 64 04 93 ca 0f 85 72 01 00 00
如假设内核产生上述oops,
1.第一次用objdump -d XXX.o > dump1.txt找到第一个函数的名称,如init_hash_table 其相对地址为0x000000
2.再cat /proc/ksym > ksym.txt,确定init_hash_table的vma地址 0xca8e6060(假如init_hash_table不在全局函数表中,可找其它函数,原理一样)
3.第二次使用objdump --source -d --adjust-vma=0xca8e6060 XXX.o > dump2.txt即可修正vma偏移,再利用EIP即可确定oops位置
(若,模块编译时没有-g选项则--source无效)
。。。。。。
ca8f14eb: 85 c0 test %eax,%eax
ca8f14ed: 0f 84 dd 01 00 00 je ca8f16d0 <iscsi_initiator_queuecommand+0x240>
ca8f14f3: 8b 15 00 00 00 00 mov 0x0,%edx
ca8f14f9: 85 d2 test %edx,%edx
ca8f14fb: 0f 84 cf 01 00 00 je ca8f16d0 <iscsi_initiator_queuecommand+0x240>
TRACE_ERROR("queuecommand called after shutdown\n");
retval = -1;
goto out;
}
//+++
Scp->host->hostdata=cfs_global_hostdata;
ca8f1501: 8b 06 mov (%esi),%eax
ca8f1503: 89 50 0c mov %edx,0xc(%eax)
/**//* get pointer to hostdata struct registered to the SCSI Mid-level */
/**//* Ming Zhang, mingz@ele.uri.edu */
#ifdef K26 //zw002!
hostdata = (struct iscsi_hostdata *)Scp->device->host->hostdata;
#else
hostdata = (struct iscsi_hostdata *)Scp->host->hostdata;
ca8f1506: 8b 06 mov (%esi),%eax
ca8f1508: 8b 58 0c mov 0xc(%eax),%ebx
#endif
if (unlikely(hostdata != cfs_global_hostdata)) {
ca8f150b: 3b 1d 00 00 00 00 cmp 0x0,%ebx
ca8f1511: 0f 85 72 01 00 00 jne ca8f1689 <iscsi_initiator_queuecommand+0x1f9>
TRACE_ERROR
("Hostdata struct %p not same as cfs_global_hostdata %p\n",
hostdata, cfs_global_hostdata);
retval = -1;
goto out;
。。。。