Skip to content

Built binaries crash with illegal hardware instruction on BCM2708 cpu (raspberry pi) #31787

Closed
@lilydjwg

Description

@lilydjwg

Cross build a "Hello World" program generated by cargo, and it fails to run.

I use the rustc and rust-std-nightly-arm-unknown-linux-gnueabihf.tar.gz from https://static.rust-lang.org/dist/

>>> rustc --version
rustc 1.8.0-nightly (57c357d89 2016-02-16)

The crash in gdb:

Program received signal SIGILL, Illegal instruction.
0x7f559c5c in jemalloc_constructor ()
(gdb) bt
#0  0x7f559c5c in jemalloc_constructor ()
#1  0x7f5879f0 in __libc_csu_init ()
#2  0xb6e3ab74 in __libc_start_main () from /usr/lib/libc.so.6
#3  0x7f559d94 in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Dump of assembler code for function jemalloc_constructor:
   0x7f559c50 <+0>:     ldr     r3, [pc, #212]  ; (0x7f559d28 <jemalloc_constructor+216>)
   0x7f559c52 <+2>:     push    {r4, lr}
   0x7f559c54 <+4>:     add     r3, pc
   0x7f559c56 <+6>:     ldr     r4, [pc, #212]  ; (0x7f559d2c <jemalloc_constructor+220>)
   0x7f559c58 <+8>:     ldrb    r0, [r3, #0]
   0x7f559c5a <+10>:    add     r4, pc
=> 0x7f559c5c <+12>:    cbz     r0, 0x7f559c68 <jemalloc_constructor+24>
   0x7f559c5e <+14>:    ldr     r1, [pc, #208]  ; (0x7f559d30 <jemalloc_constructor+224>)
   0x7f559c60 <+16>:    add     r1, pc
   0x7f559c62 <+18>:    ldr     r2, [r1, #0]

/proc/cpuinfo:

processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 2.00
Features        : half thumb fastmult vfp edsp java tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 000d
Serial          : 000000000d4fede5

The gcc toolchain used to link the program can build runnable C program on this pi.

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions