Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello World App crashes with 'Illegal Instruction' in 32-bit environment on a 64-bit SoC #58414

Closed
venkag opened this issue Feb 13, 2019 · 8 comments
Labels
O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state

Comments

@venkag
Copy link

venkag commented Feb 13, 2019

I am trying to build Hello World Application and run on a cortex-a53 based processor. The userspace environment is 32-bit (with the all libraries, binaries built in 32-bit mode). The Kernel however, is built in 64-bit mode.

Code:

$ cat hello.rs
fn main() {
println!("Hello World!");
}

Compile

$ rustc --target arm-unknown-linux-gnueabi -C target-cpu=cortex-a53 hello.rs

The output is that the string 'Hello World!' prints and crashes during the cleanup phase with 'illegal instruction'. gdb points to atomic_sub. I am suspecting that there is alignment issue with the memory pointers. One example of the GDB backtrace is:

gdb Backtrace

#0 atomic_sub () at /rustc/9fda7c2237db910e41d6a712e9a2139b352e558b/src/libcore/sync/atomic.rs:2077
2077 /rustc/9fda7c2237db910e41d6a712e9a2139b352e558b/src/libcore/sync/atomic.rs: No such file or directory.
(gdb) quit

@parched
Copy link
Contributor

parched commented Feb 13, 2019

Can you print the instruction that is failing and dump the registers with GDB?

Does it happen when you don't specify the target-cpu?

What linux distribution and architecture are you using? armv7-unknown-linux-gnueabihf is possibly the target you really want.

@scottmcm scottmcm added the O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state label Feb 13, 2019
@venkag
Copy link
Author

venkag commented Feb 13, 2019

It happens even when taret-cpu is not set.

Linux Distribution is OpenWRT and Procerros has Brahma53 processor module that implements ARMv8-A complaint architecture.

(gdb) info all-registers
r0 0x0 0
r1 0x1 1
r2 0xab18a020 2870517792
r3 0x0 0
r4 0x0 0
r5 0x0 0
r6 0xab172c74 2870422644
r7 0x0 0
r8 0xffe911f0 4293464560
r9 0xab18a550 2870519120
r10 0xab188e40 2870513216
r11 0xffe91288 4293464712
r12 0x1 1
sp 0xffe911f0 0xffe911f0
lr 0x1 1
pc 0xab159834 0xab159834 std::io::stdio::_print::hca3615e2c19cbb93+500
cpsr 0x60000010 1610612752
d0 value not available
d1 value not available
... value not available

(gdb) backtrace
#0 atomic_sub () at /rustc/9fda7c2237db910e41d6a712e9a2139b352e558b/src/libcore/sync/atomic.rs:2077
#1 fetch_sub () at /rustc/9fda7c2237db910e41d6a712e9a2139b352e558b/src/libcore/sync/atomic.rs:1519
#2 drop<std::sys_common::remutex::ReentrantMutex<core::cell::RefCell<std::io::buffered::LineWriter<std::io::stdio::Maybestd::io::stdio::StdoutRaw>>>> () at /rustc/9fda7c2237db910e41d6a712e9a2139b352e558b/src/liballoc/sync.rs:960
#3 real_drop_in_place<alloc::sync::Arc<std::sys_common::remutex::ReentrantMutex<core::cell::RefCell<std::io::buffered::LineWriter<std::io::stdio::Maybestd::io::stdio::StdoutRaw>>>>> ()
at /rustc/9fda7c2237db910e41d6a712e9a2139b352e558b/src/libcore/ptr.rs:204
#4 real_drop_in_placestd::io::stdio::Stdout () at /rustc/9fda7c2237db910e41d6a712e9a2139b352e558b/src/libcore/ptr.rs:204
#5 {{closure}}std::io::stdio::Stdout () at src/libstd/io/stdio.rs:695
#6 try_with<core::cell::RefCell<core::option::Option<alloc::boxed::Box>>,closure,core::result::Result<(), std::io::error::Error>> () at src/libstd/thread/local.rs:309
#7 print_tostd::io::stdio::Stdout () at src/libstd/io/stdio.rs:688
#8 std::io::stdio::print::hca3615e2c19cbb93 () at src/libstd/io/stdio.rs:709
#9 0xab154c5c in hello::main::h5570a636a13636e8 ()
#10 0xab154ae4 in std::rt::lang_start::
$u7b$$u7b$closure$u7d$$u7d$::h654985c2b7f96540 ()
#11 0xab15fb6c in {{closure}} () at src/libstd/rt.rs:59
#12 std::panicking::try::do_call::hf93a787b72e1d226 () at src/libstd/panicking.rs:310
#13 0xab16984c in __rust_maybe_catch_panic () at src/libpanic_unwind/lib.rs:102
#14 0xab160498 in try<i32,closure> () at src/libstd/panicking.rs:289
#15 catch_unwind<closure,i32> () at src/libstd/panic.rs:398
#16 std::rt::lang_start_internal::h7b3bd8c78881c37d () at src/libstd/rt.rs:58
#17 0xab154abc in std::rt::lang_start::h0268d04b9985a2bf ()
#18 0xab154c9c in main ()
(gdb)

@parched
Copy link
Contributor

parched commented Feb 13, 2019

Ok, and when you type disassemble in gdb what do you get?

@venkag
Copy link
Author

venkag commented Feb 13, 2019

Here is the disassemble output:

(gdb) disassemble
Dump of assembler code for function std::io::stdio::print::hca3615e2c19cbb93:
0xab159640 <+0>: push {r4, r5, r6, r7, r8, r9, r11, lr}
0xab159644 <+4>: sub sp, sp, #88 ; 0x58
0xab159648 <+8>: ldm r0, {r2, r3, r4, r5, r6, r7}
0xab15964c <+12>: mov r8, sp
0xab159650 <+16>: mov r1, r8
0xab159654 <+20>: mov r0, #6
0xab159658 <+24>: stm r1, {r2, r3, r4, r5, r6, r7}
0xab15965c <+28>: str r0, [sp, #28]
0xab159660 <+32>: ldr r0, [pc, #1040] ; 0xab159a78 std::io::stdio::_print::hca3615e2c19cbb93+1080
0xab159664 <+36>: add r0, pc, r0
0xab159668 <+40>: str r0, [sp, #24]
0xab15966c <+44>: ldr r0, [pc, #976] ; 0xab159a44 std::io::stdio::_print::hca3615e2c19cbb93+1028
0xab159670 <+48>: add r0, pc, r0
0xab159674 <+52>: bl 0xab154798
0xab159678 <+56>: ldrb r0, [r0, #17]
0xab15967c <+60>: cmp r0, #0
0xab159680 <+64>: beq 0xab159698 std::io::stdio::_print::hca3615e2c19cbb93+88
0xab159684 <+68>: mov r0, #0
0xab159688 <+72>: str r0, [sp, #44] ; 0x2c
0xab15968c <+76>: mov r0, #4
0xab159690 <+80>: str r0, [sp, #40] ; 0x28
0xab159694 <+84>: b 0xab159880 std::io::stdio::_print::hca3615e2c19cbb93+576
0xab159698 <+88>: ldr r0, [pc, #936] ; 0xab159a48 std::io::stdio::_print::hca3615e2c19cbb93+1032
0xab15969c <+92>: add r0, pc, r0
0xab1596a0 <+96>: bl 0xab154798
0xab1596a4 <+100>: ldrb r0, [r0, #16]
0xab1596a8 <+104>: cmp r0, #0
0xab1596ac <+108>: bne 0xab159714 std::io::stdio::_print::hca3615e2c19cbb93+212
0xab1596b0 <+112>: ldr r0, [pc, #964] ; 0xab159a7c std::io::stdio::_print::hca3615e2c19cbb93+1084
0xab1596b4 <+116>: ldr r0, [pc, r0]
0xab1596b8 <+120>: cmp r0, #0
0xab1596bc <+124>: beq 0xab1596e8 std::io::stdio::_print::hca3615e2c19cbb93+168
0xab1596c0 <+128>: ldr r0, [pc, #904] ; 0xab159a50 std::io::stdio::_print::hca3615e2c19cbb93+1040
0xab1596c4 <+132>: add r0, pc, r0
0xab1596c8 <+136>: bl 0xab154798
0xab1596cc <+140>: mov r1, r0
0xab1596d0 <+144>: ldr r0, [pc, #936] ; 0xab159a80 std::io::stdio::_print::hca3615e2c19cbb93+1088
0xab1596d4 <+148>: ldr r2, [pc, #936] ; 0xab159a84 std::io::stdio::_print::hca3615e2c19cbb93+1092
0xab1596d8 <+152>: add r0, pc, r0
0xab1596dc <+156>: add r2, pc, r2
0xab1596e0 <+160>: bl 0xab154504
0xab1596e4 <+164>: b 0xab159700 std::io::stdio::_print::hca3615e2c19cbb93+192
0xab1596e8 <+168>: ldr r0, [pc, #860] ; 0xab159a4c std::io::stdio::_print::hca3615e2c19cbb93+1036
0xab1596ec <+172>: add r0, pc, r0
0xab1596f0 <+176>: bl 0xab154798
0xab1596f4 <+180>: ldr r1, [pc, #908] ; 0xab159a88 std::io::stdio::_print::hca3615e2c19cbb93+1096
0xab1596f8 <+184>: add r1, pc, r1
0xab1596fc <+188>: bl 0xab15eba0 std::sys_common::thread_local::register_dtor_fallback::h94e34bf3c42c0f50
0xab159700 <+192>: ldr r0, [pc, #844] ; 0xab159a54 std::io::stdio::_print::hca3615e2c19cbb93+1044
0xab159704 <+196>: add r0, pc, r0
0xab159708 <+200>: bl 0xab154798
0xab15970c <+204>: mov r1, #1
0xab159710 <+208>: strb r1, [r0, #16]
0xab159714 <+212>: ldr r0, [pc, #828] ; 0xab159a58 std::io::stdio::_print::hca3615e2c19cbb93+1048
0xab159718 <+216>: add r0, pc, r0
0xab15971c <+220>: bl 0xab154798
0xab159720 <+224>: ldr r0, [r0]
0xab159724 <+228>: cmp r0, #1
0xab159728 <+232>: bne 0xab159758 std::io::stdio::_print::hca3615e2c19cbb93+280
0xab15972c <+236>: ldr r0, [pc, #812] ; 0xab159a60 std::io::stdio::_print::hca3615e2c19cbb93+1056
0xab159730 <+240>: add r0, pc, r0
0xab159734 <+244>: bl 0xab154798
0xab159738 <+248>: ldr r0, [r0, #4]
0xab15973c <+252>: cmp r0, #0
0xab159740 <+256>: bne 0xab159804 std::io::stdio::_print::hca3615e2c19cbb93+452
0xab159744 <+260>: ldr r0, [pc, #792] ; 0xab159a64 std::io::stdio::_print::hca3615e2c19cbb93+1060
0xab159748 <+264>: add r0, pc, r0
0xab15974c <+268>: bl 0xab154798
0xab159750 <+272>: ldr r9, [r0, #8]
0xab159754 <+276>: b 0xab159778 std::io::stdio::_print::hca3615e2c19cbb93+312
0xab159758 <+280>: ldr r0, [pc, #764] ; 0xab159a5c std::io::stdio::_print::hca3615e2c19cbb93+1052
0xab15975c <+284>: add r0, pc, r0
0xab159760 <+288>: bl 0xab154798
0xab159764 <+292>: mov r9, #0
0xab159768 <+296>: mov r1, #1
0xab15976c <+300>: stm r0, {r1, r9}
0xab159770 <+304>: str r9, [r0, #8]
0xab159774 <+308>: str r9, [r0, #12]
0xab159778 <+312>: ldr r0, [pc, #744] ; 0xab159a68 std::io::stdio::_print::hca3615e2c19cbb93+1064
0xab15977c <+316>: add r0, pc, r0
0xab159780 <+320>: bl 0xab154798
0xab159784 <+324>: mvn r1, #0
0xab159788 <+328>: cmp r9, #0
0xab15978c <+332>: str r1, [r0, #4]!
0xab159790 <+336>: str r0, [sp, #44] ; 0x2c
0xab159794 <+340>: add r0, r0, #4
0xab159798 <+344>: str r0, [sp, #40] ; 0x28
0xab15979c <+348>: beq 0xab1597f0 std::io::stdio::_print::hca3615e2c19cbb93+432
0xab1597a0 <+352>: ldr r0, [pc, #708] ; 0xab159a6c std::io::stdio::_print::hca3615e2c19cbb93+1068
0xab1597a4 <+356>: add r0, pc, r0
0xab1597a8 <+360>: bl 0xab154798
0xab1597ac <+364>: mov r3, r8
0xab1597b0 <+368>: ldr r12, [r0, #12]
0xab1597b4 <+372>: add r2, sp, #64 ; 0x40
0xab1597b8 <+376>: ldm r3, {r0, r1, r4, r5, r6, r7}
0xab1597bc <+380>: mov lr, r2
0xab1597c0 <+384>: stm lr, {r0, r1, r4, r5, r6, r7}
0xab1597c4 <+388>: ldr r3, [r12, #24]
0xab1597c8 <+392>: add r0, sp, #56 ; 0x38
0xab1597cc <+396>: mov r1, r9
0xab1597d0 <+400>: blx r3
0xab1597d4 <+404>: ldr r0, [pc, #660] ; 0xab159a70 std::io::stdio::_print::hca3615e2c19cbb93+1072
0xab1597d8 <+408>: add r0, pc, r0
0xab1597dc <+412>: bl 0xab154798
0xab1597e0 <+416>: ldr r1, [r0, #4]
0xab1597e4 <+420>: add r1, r1, #1
0xab1597e8 <+424>: str r1, [r0, #4]
0xab1597ec <+428>: b 0xab159864 std::io::stdio::_print::hca3615e2c19cbb93+548
0xab1597f0 <+432>: ldr r0, [pc, #636] ; 0xab159a74 std::io::stdio::_print::hca3615e2c19cbb93+1076
0xab1597f4 <+436>: add r0, pc, r0
0xab1597f8 <+440>: bl 0xab154798
0xab1597fc <+444>: mov r1, #0
0xab159800 <+448>: str r1, [r0, #4]
0xab159804 <+452>: bl 0xab158e50 std::io::stdio::stdout::h0afc55fe207cb8dc
0xab159808 <+456>: str r0, [sp, #40] ; 0x28
0xab15980c <+460>: mov r12, r8
0xab159810 <+464>: mov r9, r0
0xab159814 <+468>: add r2, sp, #64 ; 0x40
0xab159818 <+472>: ldm r12, {r0, r3, r4, r5, r6, r7}
0xab15981c <+476>: mov r1, r2
0xab159820 <+480>: stm r1, {r0, r3, r4, r5, r6, r7}
0xab159824 <+484>: add r0, sp, #56 ; 0x38
0xab159828 <+488>: add r1, sp, #40 ; 0x28
0xab15982c <+492>: bl 0xab1590d0 <
$LT$std..io..stdio..Stdout$u20$as$u20$std..io..Write$GT$::write_fmt::h5d8cf71a7da5ae57>
0xab159830 <+496>: mov r0, #0
=> 0xab159834 <+500>: mcr 15, 0, r0, cr7, cr10, {5}
0xab159838 <+504>: ldrex r0, [r9]
0xab15983c <+508>: sub r1, r0, #1
0xab159840 <+512>: strex r2, r1, [r9]
0xab159844 <+516>: cmp r2, #0
0xab159848 <+520>: bne 0xab159838 std::io::stdio::_print::hca3615e2c19cbb93+504
0xab15984c <+524>: cmp r0, #1
0xab159850 <+528>: bne 0xab159864 std::io::stdio::_print::hca3615e2c19cbb93+548
0xab159854 <+532>: mov r0, #0
0xab159858 <+536>: mcr 15, 0, r0, cr7, cr10, {5}
0xab15985c <+540>: add r0, sp, #40 ; 0x28
0xab159860 <+544>: bl 0xab154f8c <$LT$alloc..sync..Arc$LT$T$GT$$GT$::drop_slow::h2ecc4c27b36f3959>
0xab159864 <+548>: ldr r0, [sp, #56] ; 0x38
0xab159868 <+552>: ldr r1, [sp, #60] ; 0x3c
0xab15986c <+556>: str r1, [sp, #44] ; 0x2c
0xab159870 <+560>: uxtb r2, r0
0xab159874 <+564>: cmp r2, #4
0xab159878 <+568>: str r0, [sp, #40] ; 0x28
0xab15987c <+572>: bne 0xab159934 std::io::stdio::_print::hca3615e2c19cbb93+756
0xab159880 <+576>: bl 0xab158e50 std::io::stdio::stdout::h0afc55fe207cb8dc
0xab159884 <+580>: str r0, [sp, #56] ; 0x38
0xab159888 <+584>: add r2, sp, #64 ; 0x40
0xab15988c <+588>: ldm r8, {r1, r3, r4, r5, r6, r7}
0xab159890 <+592>: mov r9, r0
0xab159894 <+596>: mov r0, r2
0xab159898 <+600>: stm r0, {r1, r3, r4, r5, r6, r7}
0xab15989c <+604>: add r0, sp, #32
0xab1598a0 <+608>: add r1, sp, #56 ; 0x38
0xab1598a4 <+612>: bl 0xab1590d0 <
$LT$std..io..stdio..Stdout$u20$as$u20$std..io..Write$GT$::write_fmt::h5d8cf71a7da5ae57>
0xab1598a8 <+616>: mov r0, #0
0xab1598ac <+620>: mcr 15, 0, r0, cr7, cr10, {5}
0xab1598b0 <+624>: ldrex r0, [r9]
0xab1598b4 <+628>: sub r1, r0, #1
0xab1598b8 <+632>: strex r2, r1, [r9]
0xab1598bc <+636>: cmp r2, #0
0xab1598c0 <+640>: bne 0xab1598b0 std::io::stdio::_print::hca3615e2c19cbb93+624
0xab1598c4 <+644>: cmp r0, #1
0xab1598c8 <+648>: bne 0xab1598dc std::io::stdio::_print::hca3615e2c19cbb93+668
0xab1598cc <+652>: mov r0, #0
0xab1598d0 <+656>: mcr 15, 0, r0, cr7, cr10, {5}
0xab1598d4 <+660>: add r0, sp, #56 ; 0x38
0xab1598d8 <+664>: bl 0xab154f8c <_$LT$alloc..sync..Arc$LT$T$GT$$GT$::drop_slow::h2ecc4c27b36f3959>
0xab1598dc <+668>: ldrb r0, [sp, #40] ; 0x28
0xab1598e0 <+672>: and r1, r0, #7
0xab1598e4 <+676>: cmp r1, #4
0xab1598e8 <+680>: bhi 0xab1598f4 std::io::stdio::_print::hca3615e2c19cbb93+692
0xab1598ec <+684>: cmp r0, #2
0xab1598f0 <+688>: bne 0xab15993c std::io::stdio::_print::hca3615e2c19cbb93+764
0xab1598f4 <+692>: ldr r5, [sp, #44] ; 0x2c
0xab1598f8 <+696>: ldm r5, {r0, r1}
0xab1598fc <+700>: ldr r1, [r1]
0xab159900 <+704>: blx r1
0xab159904 <+708>: ldr r0, [r5, #4]
0xab159908 <+712>: ldr r1, [r0, #4]
0xab15990c <+716>: cmp r1, #0
0xab159910 <+720>: beq 0xab159920 std::io::stdio::_print::hca3615e2c19cbb93+736
0xab159914 <+724>: ldr r2, [r0, #8]
0xab159918 <+728>: ldr r0, [r5]
0xab15991c <+732>: bl 0xab154cac <__rust_dealloc>
0xab159920 <+736>: mov r0, r5
0xab159924 <+740>: mov r1, #12
0xab159928 <+744>: mov r2, #4
0xab15992c <+748>: bl 0xab154cac <__rust_dealloc>
0xab159930 <+752>: b 0xab15993c std::io::stdio::_print::hca3615e2c19cbb93+764
0xab159934 <+756>: str r0, [sp, #32]
0xab159938 <+760>: str r1, [sp, #36] ; 0x24
0xab15993c <+764>: ldrb r0, [sp, #32]
0xab159940 <+768>: cmp r0, #3
0xab159944 <+772>: addeq sp, sp, #88 ; 0x58
0xab159948 <+776>: popeq {r4, r5, r6, r7, r8, r9, r11, pc}
0xab15994c <+780>: ldr r0, [sp, #32]
0xab159950 <+784>: ldr r1, [sp, #36] ; 0x24
0xab159954 <+788>: str r1, [sp, #60] ; 0x3c
0xab159958 <+792>: add r1, sp, #40 ; 0x28
0xab15995c <+796>: str r0, [sp, #56] ; 0x38
0xab159960 <+800>: ldr r0, [pc, #292] ; 0xab159a8c std::io::stdio::_print::hca3615e2c19cbb93+1100
0xab159964 <+804>: ldr r0, [pc, r0]
0xab159968 <+808>: str r0, [sp, #52] ; 0x34
0xab15996c <+812>: add r0, sp, #56 ; 0x38
0xab159970 <+816>: str r0, [sp, #48] ; 0x30
0xab159974 <+820>: ldr r0, [pc, #276] ; 0xab159a90 std::io::stdio::_print::hca3615e2c19cbb93+1104
0xab159978 <+824>: add r0, pc, r0
0xab15997c <+828>: str r0, [sp, #44] ; 0x2c
0xab159980 <+832>: add r0, sp, #24
0xab159984 <+836>: str r0, [sp, #40] ; 0x28
0xab159988 <+840>: mov r0, #2
0xab15998c <+844>: str r0, [sp, #84] ; 0x54
0xab159990 <+848>: str r1, [sp, #80] ; 0x50
0xab159994 <+852>: str r0, [sp, #76] ; 0x4c
0xab159998 <+856>: ldr r1, [pc, #244] ; 0xab159a94 std::io::stdio::_print::hca3615e2c19cbb93+1108
0xab15999c <+860>: add r1, pc, r1
0xab1599a0 <+864>: str r1, [sp, #72] ; 0x48
0xab1599a4 <+868>: str r0, [sp, #68] ; 0x44
0xab1599a8 <+872>: ldr r0, [pc, #232] ; 0xab159a98 std::io::stdio::_print::hca3615e2c19cbb93+1112
0xab1599ac <+876>: add r0, pc, r0
0xab1599b0 <+880>: str r0, [sp, #64] ; 0x40
0xab1599b4 <+884>: ldr r1, [pc, #224] ; 0xab159a9c std::io::stdio::_print::hca3615e2c19cbb93+1116
0xab1599b8 <+888>: add r0, sp, #64 ; 0x40
0xab1599bc <+892>: add r1, pc, r1
0xab1599c0 <+896>: bl 0xab15fb80 std::panicking::begin_panic_fmt::hf946e5e7aa3496df
0xab1599c4 <+900>: ; instruction: 0xe7ffdefe
0xab1599c8 <+904>: mov r4, r0
0xab1599cc <+908>: ldm r5, {r0, r1}
0xab1599d0 <+912>: bl 0xab1568f4 alloc::alloc::box_free::h03cc9cb92030d653
0xab1599d4 <+916>: mov r0, r5
0xab1599d8 <+920>: bl 0xab15690c alloc::alloc::box_free::h2765089cb184fe8b
0xab1599dc <+924>: b 0xab159a38 std::io::stdio::_print::hca3615e2c19cbb93+1016
0xab1599e0 <+928>: mov r4, r0
0xab1599e4 <+932>: add r0, sp, #40 ; 0x28
0xab1599e8 <+936>: bl 0xab1556e8 core::ptr::real_drop_in_place::h2c4cafce33700501
0xab1599ec <+940>: b 0xab159a38 std::io::stdio::_print::hca3615e2c19cbb93+1016
0xab1599f0 <+944>: mov r4, r0
0xab1599f4 <+948>: add r0, sp, #40 ; 0x28
0xab1599f8 <+952>: bl 0xab155930 core::ptr::real_drop_in_place::h7f4ebdf459ff0fe9
0xab1599fc <+956>: b 0xab159a38 std::io::stdio::_print::hca3615e2c19cbb93+1016
0xab159a00 <+960>: mov r4, r0
0xab159a04 <+964>: add r0, sp, #56 ; 0x38
0xab159a08 <+968>: bl 0xab155930 core::ptr::real_drop_in_place::h7f4ebdf459ff0fe9
0xab159a0c <+972>: b 0xab159a38 std::io::stdio::_print::hca3615e2c19cbb93+1016
0xab159a10 <+976>: mov r4, r0
0xab159a14 <+980>: add r0, sp, #56 ; 0x38
0xab159a18 <+984>: bl 0xab155b84 core::ptr::real_drop_in_place::hfa10616964a6f4d1
0xab159a1c <+988>: b 0xab159a38 std::io::stdio::_print::hca3615e2c19cbb93+1016
0xab159a20 <+992>: mov r4, r0
0xab159a24 <+996>: ldrb r0, [sp, #40] ; 0x28
0xab159a28 <+1000>: cmp r0, #4
0xab159a2c <+1004>: beq 0xab159a38 std::io::stdio::_print::hca3615e2c19cbb93+1016
0xab159a30 <+1008>: add r0, sp, #40 ; 0x28
0xab159a34 <+1012>: bl 0xab15563c core::ptr::real_drop_in_place::h217bb8fbabcc2511
0xab159a38 <+1016>: mov r0, r4
0xab159a3c <+1020>: bl 0xab1547b0
0xab159a40 <+1024>: ; instruction: 0xe7ffdefe
0xab159a44 <+1028>: andeq pc, r2, r12, lsl #18
0xab159a48 <+1032>: andeq pc, r2, r0, ror #17
0xab159a4c <+1036>: muleq r2, r0, r8
0xab159a50 <+1040>: ; instruction: 0x0002f8b8
0xab159a54 <+1044>: andeq pc, r2, r8, ror r8 ;
0xab159a58 <+1048>: andeq pc, r2, r4, ror #16
0xab159a5c <+1052>: andeq pc, r2, r0, lsr #16
0xab159a60 <+1056>: andeq pc, r2, r12, asr #16
0xab159a64 <+1060>: andeq pc, r2, r4, lsr r8 ;
0xab159a68 <+1064>: andeq pc, r2, r0, lsl #16
0xab159a6c <+1068>: ldrdeq pc, [r2], -r8
0xab159a70 <+1072>: andeq pc, r2, r4, lsr #15
0xab159a74 <+1076>: andeq pc, r2, r8, lsl #15
0xab159a78 <+1080>: andeq r9, r1, r7, lsl #29
0xab159a7c <+1084>: strdeq pc, [r2], -r8
0xab159a80 <+1088>: ; instruction: 0xffffdf6c
0xab159a84 <+1092>: andeq pc, r2, r12, lsr #18
0xab159a88 <+1096>: ; instruction: 0xffffdf4c
0xab159a8c <+1100>: andeq pc, r2, r8, ror #12
0xab159a90 <+1104>: ; instruction: 0xffffb868
0xab159a94 <+1108>: ldrdeq r9, [r1], -r0
0xab159a98 <+1112>: andeq lr, r2, r12, lsl r1
0xab159a9c <+1116>: andeq lr, r2, r12, lsl r1
End of assembler dump.
(gdb)
(gdb)

Thanks!

@parched
Copy link
Contributor

parched commented Feb 13, 2019

Ok yes, it's an old CP15 barrier, you should be fine if you just use armv7-unknown-linux-gnueabihf then.

@huydng
Copy link

huydng commented Feb 21, 2019

Instead of using armv7-unknown-linux-gnueabihf, we opted to enable CP15 barrier emulation in the kernel and it no longer crashes. Do you see any problem with this approach?

Thanks for your help!

@parched
Copy link
Contributor

parched commented Feb 21, 2019

The float ABIs are different so if your c libraries are built with the hard float ABI you will have issues. You'll also have a less optimal Rust std library with arm-unknown-linux-gnueabi because that will only have Armv6 instructions.

@sanxiyn
Copy link
Member

sanxiyn commented Mar 19, 2019

CP15 barrier emulation should be enabled in the kernel if you are using CP15 barrier target. Closing.

@sanxiyn sanxiyn closed this as completed Mar 19, 2019
alex added a commit to alex/rustup that referenced this issue Sep 22, 2023
…rland

aarch64 always has neon enabled, and thus it's not included in /proc/cpuinfo. Previously, we'd fall back to arm when running with a 32-bit userland, even though armv7 is perfectly appropriate in this case.

This would then run into the issue described in rust-lang/rust#58414 with "CP15 barrier emulation".

This PR fixes that.
alex added a commit to alex/rustup that referenced this issue Sep 23, 2023
…rland

On aarch64, neon will not be present in /proc/cpuinfo, instead asimd is there. Previously, we'd fall back to arm when running with a 32-bit userland, even though armv7 is perfectly appropriate in this case.

This would then run into the issue described in rust-lang/rust#58414 with "CP15 barrier emulation".

This PR fixes that.
rami3l pushed a commit to rust-lang/rustup that referenced this issue Oct 5, 2023
…rland

On aarch64, neon will not be present in /proc/cpuinfo, instead asimd is there. Previously, we'd fall back to arm when running with a 32-bit userland, even though armv7 is perfectly appropriate in this case.

This would then run into the issue described in rust-lang/rust#58414 with "CP15 barrier emulation".

This PR fixes that.
AJ-Ianozi pushed a commit to AJ-Ianozi/getada-download that referenced this issue Oct 12, 2023
…rland

On aarch64, neon will not be present in /proc/cpuinfo, instead asimd is there. Previously, we'd fall back to arm when running with a 32-bit userland, even though armv7 is perfectly appropriate in this case.

This would then run into the issue described in rust-lang/rust#58414 with "CP15 barrier emulation".

This PR fixes that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state
Projects
None yet
Development

No branches or pull requests

5 participants