-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Illegal Instruction from rust installation #100161
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
Comments
This issue is found in Rustup. Can someone transfer this there? Unfortunately quite a lot of action happens right after that message. It may be due to SHA2 acceleration, or it may even have been a malformed instruction. rust-lang/rustup#595 But it may also be due to OpenSSL. Would you please run this in the shell? cat /proc/cpuinfo | grep 'flags' | uniq |
cat /proc/cpuinfo | grep 'flags' | uniq flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm nopl cpuid tsc_known_freq pni cx16 hypervisor lahf_lm svm abm sse4a 3dnowprefetch vmmcall |
I also found this in dmsg: |
...why the hell would it advertise it supports SSE4a but it wouldn't advertise support for SSE3 or SSSE3? I mean it looks normal aside from that... If you run with |
Not quite sure what exactly you want me to do:
I have called called 'ulimit -c unlimited', installed gdb and started
it with the downloaded rustup-init executable with the following
output:
...
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
1
info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
[New Thread 0x7ffff7a67700 (LWP 19681)]
[New Thread 0x7ffff7866700 (LWP 19682)]
Thread 1 "rustup-init" received signal SIGILL, Illegal instruction.
0x000055555596d208 in sha2::sha512::x86::sha512_compress_x86_64_avx2 ()
(gdb)
…On Sun, 2022-08-07 at 03:02 -0700, Jubilee wrote:
...why the hell would it advertise it supports SSE4a but it wouldn't
advertise support for SSE3 or SSSE3? I mean it looks normal aside
from that...
If you run with ulimit -c unlimited you should be able to get a core
dump and then attach gdb to it in order to determine which
instruction was in fact located at that address during that
execution. Very peculiar.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I am having a similar issue when installing Rust in my 10+ old laptop (running
|
This issue is most likely due to RustCrypto/hashes#386 which has been fixed in Checking for |
Can anybody tell me how can I install rust on my pc? I always got the error: Illegal instruction... |
Here a backtrace:
|
@lu-zero Yes, it's well-known fact. And what next? |
The root problem is in https://github.com/RustCrypto/utils/blob/master/cpufeatures/src/x86.rs cpufeatures should use stdarch detection when built in std instead of relying on its minimalistic approach. Long story short, there is a disagreement on what is in the cpu registers, what the kernel wants to support and what the virtualization system offers. What is your PC exactly? |
I'm newbie in Rust. Cargo, rustc, rustup all these words are new for me. I've just wanted to start learning this prog language but faced with this problem. |
that's not a PC and qemu and virtualbox are very different how did you manage to configure either of them to trigger the sigill? |
@lu-zero Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm
constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popc
nt tsc_deadline_timer aes f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbas
e tsc_adjust bmi1 hle smep bmi2 erms invpcid rtm rdseed adx smap clflushopt clwb arat md_clear flush_l1d arch_capabilities |
You'd need a tiny program based on https://github.com/RustCrypto/utils/tree/master/cpufeatures to confirm it still misdetects avx2, install rustup on real hardware to build it (getting binaries from unknown sources is never a great idea) |
Ok. Thx |
it can corrupt your installation and give "illegal instruction". try command now you can use a "Standalone installers" stable version https://forge.rust-lang.org/infra/other-installation-methods.html#standalone-installers unzip and then look for "install.sh"
open a new terminal
After 3 days "Rustup corrupted my installations, and I managed to install it" "Pentium M" i686 now has Rust :D |
@sparkillay I knew it. I suspected that somewhere should be a resource with that. Thanks! |
Hi I can also report the I have a Q6600. Modern arch (Ryzen 2400G) is not affected. Is there a way to update that specific lib which does the check? I'd like to understand and maybe help. |
I have this issue with latest rustup-init in a ubuntu VM. Here is the detail information:
|
@gardell , update cpufeatures to 0.2.5 in rustup was merged in this commit but it is not part of current rustup version (1.25.2) I have some workaround for Qemu users. Despite I use Intel procesor I pass argument -cpu Opteron_G5 and omit avx2 issue. @DenisSemakin until the new version will not be released, The W/A deals with the issue. |
Is there any way to solve this problem now? `$ cat /proc/cpuinfo | grep 'flags' flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 smep bmi2 invpcid rdseed adx smap clflushopt dtherm arat pln pts |
hello, also seeing a SIGILL error (illegal instruction) when attempting to install on PPC64 (POWER5+)
|
These issues do not seem to be with rustc, properly speaking, so I am going to close this, sorry. |
Hello can we please re-open this? To reproduce (without POWER hardware) you can grep the objdump for 'vxor' which is optional AltiVec instruction, which AFAIK is not present on some IBM servers or embedded platforms etc:
|
The PowerPC64 target is defined to include Altivec support1. As I understand it, POWER servers for some time have full support for Altivec. Many architectures have highly "off-spec" embedded implementations which de facto are separate CPU architectures, so it is not surprising if the embedded chips do not support it. Footnotes
|
Thanks for looking at this @workingjubilee -- can the rust installer be built without optimisations that break compatibility like this? It seems like a compiler flag issue? Building rust from sources is also impacted by this unfortunately, SIGILL also results running |
Compatibility with what? You have not named the actual hardware you even want to run anything on. There are x86-64 chips that rustc and Rustup cannot easily run on either, because those x86 chips are also wildly off-spec. |
Debian on POWER5 (IBM 9406-520) -- no AltiVec and definately not off-spec, IBM made the architecture... |
The x86-64 CPUs I am referring to which cannot run common x86-64 binaries were made by none other than Intel. And no, not as a quirk of Intel64 vs. AMD64. Rather, the first "Xeon Phi" CPUs were deliberately nonconformant and only implemented AVX instructions, not SSE. I hope you can see, from that, that the lines a compiler has to draw as to what it does for default support are often very arbitrary. The problem you are running into cannot be fixed by merely changing how Rustup is built, because then Rustup would download rustc binaries that use Altivec instructions. Likewise, much like C compilers are built with other C compilers, generally, the Rust compiler is built with a Rust compiler. I see you already have #110278 open for that, so please pursue it there. |
Sorry for the confusion, I've been posting on the wrong issue! |
Operating System: Kali GNU/Linux Rolling |
@corvinux Hm. Your CPU is likely being identified as i686 incorrectly when it should be i586, since it doesn't support SSE2 (incorrect, I know, but it's what we expect). |
|
I am getting an Illegal Instruction when trying to install rust on a VPS running debian 10:
Linux version 5.10.0-16-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.127-1 (2022-06-30)
I tried this code:
I expected to see this happen: installation of rust
Instead, this happened:
The text was updated successfully, but these errors were encountered: