最近遇到一个程序崩溃,并不常见的SIGILL。 debug之。
Core was generated by `/usr/bin/xxxxx'.
Program terminated with signal SIGILL, Illegal instruction
gdb查看,崩溃在了free函数
(gdb) disassemble
Dump of assembler code for function free:
0xb6f408f0 <+0>: cmp r0, #0
0xb6f408f4 <+4>: bxeq lr
0xb6f408f8 <+8>: ldr r3, [r0, #-4]
0xb6f408fc <+12>: push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
0xb6f40900 <+16>: tst r3, #1
0xb6f40904 <+20>: bic r8, r3, #1
0xb6f40908 <+24>: sub sp, sp, #20
0xb6f4090c <+28>: sub r4, r0, #8
0xb6f40910 <+32>: bne 0xb6f40938 <free+72>
0xb6f40914 <+36>: ldr r3, [r0, #-8]
0xb6f40918 <+40>: sub r0, r4, r3
0xb6f4091c <+44>: tst r3, #1
0xb6f40920 <+48>: add r1, r8, r3
0xb6f40924 <+52>: beq 0xb6f4092c <free+60>
=> 0xb6f409