[Bug 2899] [ARM] general alignment error

bugzilla at busybox.net bugzilla at busybox.net
Wed Dec 29 05:55:50 UTC 2010


--- Comment #1 from Denys Vlasenko <vda.linux at googlemail.com>  ---
You can find out which function contains unaligned access this way, if you have
build tree, not just busybox binary built by someone else.

Use busybox_unstripped binary from the build tree:

# gdb busybox_unstripped
GNU gdb 5.2
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) disassemble 0x8049b71
                  ^^^^^^^^^ use PC value here.

Dump of assembler code for function xmalloc_readlink_or_warn:
0x8049b46 <xmalloc_readlink_or_warn>:   push   %esi
0x8049b47 <xmalloc_readlink_or_warn+1>: push   %ebx
0x8049b48 <xmalloc_readlink_or_warn+2>: mov    %eax,%ebx
0x8049b4a <xmalloc_readlink_or_warn+4>: call   0x8049b01 <xmalloc_readlink>
0x8049b4f <xmalloc_readlink_or_warn+9>: mov    %eax,%esi
0x8049b51 <xmalloc_readlink_or_warn+11>:        test   %eax,%eax
0x8049b53 <xmalloc_readlink_or_warn+13>:        jne    0x8049b7e
0x8049b55 <xmalloc_readlink_or_warn+15>:        mov    0x812705c,%eax
0x8049b5a <xmalloc_readlink_or_warn+20>:        mov    (%eax),%eax
0x8049b5c <xmalloc_readlink_or_warn+22>:        mov    $0x8104fe7,%edx
0x8049b61 <xmalloc_readlink_or_warn+27>:        cmp    $0x16,%eax
0x8049b64 <xmalloc_readlink_or_warn+30>:        je     0x8049b6f
0x8049b66 <xmalloc_readlink_or_warn+32>:        push   %eax
0x8049b67 <xmalloc_readlink_or_warn+33>:        call   0x80eca20 <strerror>
0x8049b6c <xmalloc_readlink_or_warn+38>:        mov    %eax,%edx
0x8049b6e <xmalloc_readlink_or_warn+40>:        pop    %ecx
0x8049b6f <xmalloc_readlink_or_warn+41>:        push   %edx
0x8049b70 <xmalloc_readlink_or_warn+42>:        push   %ebx
0x8049b71 <xmalloc_readlink_or_warn+43>:        push   $0x8104ff5
0x8049b76 <xmalloc_readlink_or_warn+48>:        call   0x8048f94 <bb_error_msg>
0x8049b7b <xmalloc_readlink_or_warn+53>:        add    $0xc,%esp
0x8049b7e <xmalloc_readlink_or_warn+56>:        mov    %esi,%eax
0x8049b80 <xmalloc_readlink_or_warn+58>:        pop    %ebx
0x8049b81 <xmalloc_readlink_or_warn+59>:        pop    %esi
0x8049b82 <xmalloc_readlink_or_warn+60>:        ret
End of assembler dump.

Then find the source file where the function in question is defined. In this
example, it's xmalloc_readlink_or_warn and it is defined in libbb/xreadlink.c.

Then, run 

make libbb/xreadlink.s

in the build tree, and attach resulting .s file to this bug.

Repeat for every PC value where alignment fault is reported.

Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the busybox-cvs mailing list