Rustup install fails with "Illegal instruction" on x86_64 Debian

I'm trying to install rustup on a seemingly ordinary Debian machine, and the installer fails with :

Current installation options:


   default host triple: x86_64-unknown-linux-gnu
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

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'
Illegal instruction

Again, this machine is an ordinary x86_64 Debian Bullseye machine, with no particular quirk that I can think of (except being a KVM guest, but this shouldn't be relevant, I guess ?). How can I debug this ?

You could try running ulimit -c unlimited, then attempting to install rustup and finally loading the core file in a debugger to get a backtrace. The core file is likely in the current directory and named like core.<pid>.

1 Like

Loading the core in gdb allowed to identify the faulty instruction :

Program terminated with signal SIGILL, Illegal instruction.
#0  0x0000564468f13208 in sha2::sha512::x86::sha512_compress_x86_64_avx2 ()

which in turn led me to this rust issue : Illegal Instruction from rust installation · Issue #100161 · rust-lang/rust · GitHub. Most likely, I can work around this by either waiting for a fix in the next rustup release, or using a prior version. Thanks a lot !

1 Like