-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Built binaries crash with illegal hardware instruction on BCM2708 cpu (raspberry pi) #31787
Comments
You didn't say enough about your rustc (host, target) - I suspect you picked up an armv7 version. You can try using |
Wait, I forgot Rust's SIGILL doesn't have to come from an actual illegal instruction. It's probably a sign of some unexpected crash related to jemalloc. Try a version of rustc that was built without jemalloc or add this to your program to use the system allocator: #![feature(alloc_system)]
extern crate alloc_system ; |
Looks like the faulting instruction is I guess this means that gcc emits these instructions by default, and I'm not sure if LLVM does (or if we should disable a feature here and there). The suggestion of trying @petevine as mentioned in the report the @lilydjwg does a simple "hello world" exhibit the crash you're seeing here? Or is the program at hand more complicated? |
Before posting the second time I'd checked the What's the mode gcc is using on the buildbot? (like armv6, thumb). |
@petevine my rustc is from the same place as rust-std, all with the same version. There's an "arm-unknown-linux-gnueabi" version in the std library and I tried that, it failed to link. I suppose it's because my toolchain is gnueabihf. @alexcrichton the hello world program crashes. A page from Google says "cbz" is from thumb2, and cpuinfo indicates my CPU doesn't support that. Adding
to my test crate and it works! So it's only jemalloc is using those "illegal" instructions? |
For some reason I was convinced Rpi had thumb2 (Rpi2 has) as cpuinfo doesn't differentiate between thumb and thumb2. You could also try those unofficial armv6 crates to see if jemalloc had been built without |
@petevine there are several versions of rpi (and I don't know which is the one I have...). I can't try the unofficial armv6 crates becausse I don't have an x86_64 rustc from the same commit and they don't provide one. My pi is not only very slow at compiling things but also has too little disk space... |
You definitely have the original Rpi (or Zero) as it doesn't support T2. If you found an unofficial armv6 nightly from the same day and it had library hashes matching your x86_64 ones you should be able to use them for cross-compilation. Or just wait until buildbot gets fixed. |
Right now the compiler's we're using actually default to armv7/thumb2 I believe, so this should help push them back to what the arm-unknown-linux-* targets are for. This at least matches that clang does for the `arm-unknown-linux-gnueabihf` target which is to map it to an armv6 architecture. Closes rust-lang#31787
@petevine I managed to get it cross compiled, but then it turned out that armv6 build does not have jemalloc:
@alexcrichton will there be built crates for me to test with? Or how can I build them without build rustc and all the stages? |
Unfortunately there's no great and easy way to do that right now |
Thanks @lilydjwg , I didn't know @warricksothr had disabled jemalloc in his builds too. |
Right now the compiler's we're using actually default to armv7/thumb2 I believe, so this should help push them back to what the arm-unknown-linux-* targets are for. This at least matches that clang does for the `arm-unknown-linux-gnueabihf` target which is to map it to an armv6 architecture. Closes rust-lang#31787
Hi there - what rust environment would I have to have in order to get this fix? I installed rust using rustup, and it's currently on rustc 1.17.0 (56124ba 2017-04-24). Should that be good enough? I'm asking because I'm seeing "illegal instruction" errors trying to run a arm-unknown-linux-musleabihf build on a Pi1. |
I thought I was hitting this with the cnbz instruction but it turns out that arm-linux-gnueabihf-gcc on Ubuntu produces armv7 binaries. see: #38570 |
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/
The crash in gdb:
/proc/cpuinfo
:The gcc toolchain used to link the program can build runnable C program on this pi.
The text was updated successfully, but these errors were encountered: