by craigfrancis » Sat Jan 26, 2013 7:39 pm
By request from `scientes_` in IRC, with the segfault issue with `make`, the following backtrace was obtained:
$this->bbcode_second_pass_code('', '
# gdb --args make
GNU gdb (GDB) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "armv6l-unknown-linux-gnueabihf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/make...(no debugging symbols found)...done.
')
$this->bbcode_second_pass_code('', '
(gdb) run
Starting program: /usr/bin/make
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0xb6f034b4 in strlen () from /usr/lib/libc.so.6
')
$this->bbcode_second_pass_code('', '
(gdb) bt
#0 0xb6f034b4 in strlen () from /usr/lib/libc.so.6
#1 0x00015ee4 in ?? ()
#2 0x00015ee4 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
')
$this->bbcode_second_pass_code('', '
(gdb) info registers
r0 0x0 0
r1 0x0 0
r2 0x6966 26982
r3 0x0 0
r4 0xae 174
r5 0x22 34
r6 0x7 7
r7 0x34a38 215608
r8 0xbeffdee8 3204439784
r9 0x33f10 212752
r10 0x0 0
r11 0xbeffe05c 3204440156
r12 0x3380c 210956
sp 0xbeffdee8 0xbeffdee8
lr 0x15ee4 89828
pc 0xb6f034b4 0xb6f034b4 <strlen+4>
cpsr 0x40000010 1073741840
')
$this->bbcode_second_pass_code('', '
(gdb) disassemble
Dump of assembler code for function strlen:
0xb6f034b0 <+0>: bic r1, r0, #3
=> 0xb6f034b4 <+4>: ldr r2, [r1], #4
0xb6f034b8 <+8>: ands r3, r0, #3
0xb6f034bc <+12>: rsb r0, r3, #0
0xb6f034c0 <+16>: beq 0xb6f034d8 <strlen+40>
0xb6f034c4 <+20>: orr r2, r2, #255 ; 0xff
0xb6f034c8 <+24>: subs r3, r3, #1
0xb6f034cc <+28>: orrgt r2, r2, #65280 ; 0xff00
0xb6f034d0 <+32>: subs r3, r3, #1
0xb6f034d4 <+36>: orrgt r2, r2, #16711680 ; 0xff0000
0xb6f034d8 <+40>: tst r2, #255 ; 0xff
0xb6f034dc <+44>: tstne r2, #65280 ; 0xff00
0xb6f034e0 <+48>: tstne r2, #16711680 ; 0xff0000
0xb6f034e4 <+52>: tstne r2, #-16777216 ; 0xff000000
0xb6f034e8 <+56>: addne r0, r0, #4
0xb6f034ec <+60>: ldrne r2, [r1], #4
0xb6f034f0 <+64>: bne 0xb6f034d8 <strlen+40>
0xb6f034f4 <+0>: tst r2, #255 ; 0xff
0xb6f034f8 <+4>: addne r0, r0, #1
0xb6f034fc <+8>: tstne r2, #65280 ; 0xff00
0xb6f03500 <+12>: addne r0, r0, #1
0xb6f03504 <+16>: tstne r2, #16711680 ; 0xff0000
0xb6f03508 <+20>: addne r0, r0, #1
0xb6f0350c <+24>: bx lr
End of assembler dump.
')