rustup icon indicating copy to clipboard operation
rustup copied to clipboard

Premature exits when downloading toolchain components on Windows, error code 0xC0000005 `STATUS_ACCESS_VIOLATION`

Open debski-patrick opened this issue 10 months ago • 16 comments

Verification

  • [x] I searched for recent similar issues at https://github.com/rust-lang/rustup/issues?q=is%3Aissue+is%3Aopen%2Cclosed and found no duplicates.
  • [x] I am on the latest version of Rustup according to https://github.com/rust-lang/rustup/tags and am still able to reproduce my issue.

Problem

I'm currently not able to use either Cargo and Rustc for developing my project. I have Rustup 1.27.1 installed on my local machine. I tried to set environment variables and reinstalling it, and restarting the machine, but didn't find the solutions at all.

The error message was:

error: rustup could not choose a version of rustc to run, because one wasn't specified explicitly, and no default is configured.

Sharing a screenshot of my CLI as a proof. Please help me to resolve this issue ASAP.

Image

Steps

  1. Download a installation version (rustup-init.exe) from the official Rust website
  2. Run the setup application
  3. Verify the installation (rustc --version)

Possible Solution(s)

No response

Notes

No response

Rustup version

1.27.1

Installed toolchains

Default host: x86_64-pc-windows-msvc
rustup home:  C:\Users\AzureSphere\.rustup

OS version

Windows 11 24H2

debski-patrick avatar Feb 02 '25 22:02 debski-patrick

It seems like rustup install stable exited prematurely. Maybe it was killed by some security software?

Try doing rustup install stable & echo %errorlevel% and seeing if the result is non-zero.

ChrisDenton avatar Feb 03 '25 05:02 ChrisDenton

I'm getting "1" as a result. What should I do for now?

debski-patrick avatar Feb 04 '25 10:02 debski-patrick

Yeah, that means it's failing unexpectedly which likely means the process is being killed.

Do you know what security software you have installed? It's possible you could add an exclusion for rustup.exe.

ChrisDenton avatar Feb 04 '25 11:02 ChrisDenton

What is an example of security software you are talking?

debski-patrick avatar Feb 04 '25 23:02 debski-patrick

@debski-patrick It looks like another program is killing rustup, possibly an antivirus... If, say, rustup itself is the reason why the return code is 1 (abnormal), then it should have at least emitted a warning/error of some sort.

rami3l avatar Feb 05 '25 01:02 rami3l

Here are some of my apps that seem to be related to the security wise:

  • AnyDesk.exe
  • AnyViewer.exe
  • GlassWire 3.4.exe
  • Npcap.exe
  • PuTTY release 0.79 (64bit)
  • VMware Player
  • XAMPP

Which one do you think blocks installing Rust among the above?

debski-patrick avatar Feb 05 '25 04:02 debski-patrick

Rust is not compatible with the version of Windows you're running. Try to re-install your OS to Windows 10 and it will work fine.

azurespheredev avatar Feb 10 '25 10:02 azurespheredev

Rust is not compatible with the version of Windows you're running. Try to re-install your OS to Windows 10 and it will work fine.

It worked. Thank you! @azurespheredev

debski-patrick avatar Feb 10 '25 10:02 debski-patrick

I have the same issue, so the windows 11 is not support the rustup? Please let me know

codecrown-pro avatar Apr 21 '25 16:04 codecrown-pro

Both Windows 10 and 11 are supported. I personally use Windows 11. It would be super useful if someone with this problem could attach a debugger and see why the process is exiting prematurely.

One thing you can try, if it's failing when it should be downloading then maybe setting the environment variable RUSTUP_USE_CURL to 1 could help. Though that's purely a guess.

ChrisDenton avatar Apr 21 '25 16:04 ChrisDenton

Windows 11, via command prompt, it appears setting RUSTUP_USE_CURL=1 helps here.

Image Image

Finished successfully.

Image

bllackhu avatar Dec 01 '25 10:12 bllackhu

@djc Looks like this can be tracked in #3790 then. Reopening...

rami3l avatar Dec 01 '25 12:12 rami3l

@djc BTW do you think increasing the amount of log lines will help with your diagnosis?

rami3l avatar Dec 01 '25 12:12 rami3l

Might help. Do we have that in the release already? Would be great if we can get a minidump to narrow this down, too.

djc avatar Dec 01 '25 13:12 djc

Do we have that in the release already?

@djc tracing_subscriber is already online since the last release, so it really depends on whether the part you want to diagnose is printing useful stuff to the terminal or not, I believe.

@bllackhu Could you try changing the value of the RUSTUP_LOG environment variable to e.g. trace and see what you can get, like explained in https://rust-lang.github.io/rustup/dev-guide/tracing.html#console-based-tracing?

rami3l avatar Dec 01 '25 13:12 rami3l

Just to 2nd @ChrisDenton's suggestion from earlier this year, some kind of native crash information would be extremely beneficial in tracking down this problem if anyone who can reproduce this is able to provide it.

That could be a minidump from an already-crashed instance of rustup or an in-progress crash backtrace from a program like WinDbg attached to rustup once the segfault exception is raised. Even knowing the name of whichever function is causing the crash would be a good start since it at least narrows down where in rustls-platform-verifier is worth further examination.

complexspaces avatar Dec 01 '25 13:12 complexspaces