在测试CIT过程中,插入USB,出现重启

(gdb) bt

#0 __vectors_start ()
at /home/XXX-buildsrv33/jenkins/workspace/UNIFIED_VERSION_BUILD/code/kernel-3.18/arch/arm/kernel/entry-armv.S:1218
#1 0xc0401564 in mt_mt65xx_led_set_cust (cust=0xdd2f7b98, level=255)
at /home/XXX-buildsrv33/jenkins/workspace/UNIFIED_VERSION_BUILD/code/kernel-3.18/drivers/misc/mediatek/leds/mt6735/leds.c:897
#2 0xc04015d4 in mt_mt65xx_led_work (work=0xdd2f7bb8)
at /home/XXX-buildsrv33/jenkins/workspace/UNIFIED_VERSION_BUILD/code/kernel-3.18/drivers/misc/mediatek/leds/mt6735/leds.c:920
#3 0xc0133ff4 in process_one_work (worker=0xdac2bf00, work=0xdd2f7bb8)
at /home/XXX-buildsrv33/jenkins/workspace/UNIFIED_VERSION_BUILD/code/kernel-3.18/kernel/workqueue.c:2055
Backtrace stopped: previous frame identical to this frame (corrupt stack?)


(gdb) 
从backtrace信息可以看出,crash发生在/drivers/misc/mediatek/leds/mt6735/leds.c文件的897行
(gdb) disassemble 0xc0401564

Dump of assembler code for function mt_mt65xx_led_set_cust:
0xc040136c <+0>: mov r12, sp
0xc0401370 <+4>: push

{r4, r5, r6, r11, r12, lr, pc}

0xc0401374 <+8>: sub r11, r12, #4
......
0xc0401558 <+492>: ldr r3, r4, #8
0xc040155c <+496>: mov r0, r5
0xc0401560 <+500>: blx r3
=> 0xc0401564 <+504>: str r0, r6, #164 ; 0xa4
0xc0401568 <+508>: ldr r0, [r4]
0xc040156c <+512>: ldr r1, pc, #32 ; 0xc0401594 
0xc0401570 <+516>: bl 0xc033fc9c 
......


查看对应寄存器信息:
(gdb) info registers 
r0 0xff 255
r1 0xff 255
r2 0xdb3e7eb8 3678305976
r3 0x1 1
r4 0xdd2f7b98 3710876568
r5 0xff 255
r6 0xc1053270 3238343280
r7 0xdde82700 3722979072
r8 0xc109ac78 3238636664
......
cpsr 0x40070013 1074200595
计算r6+164=0xc1053314
(gdb) x/xw 0xc1053314
0xc1053314 : 0x00000000

LED模块出现空指针访问,导致NE发生

/drivers/misc/mediatek/leds/mt6735/leds.c

ret = ((cust_set_brightness) (cust->data)) (level);

你可能感兴趣的:(NE,空指针,gdb)