Premature exits when downloading toolchain components on Windows, error code 0xC0000005 `STATUS_ACCESS_VIOLATION`
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.
Steps
- Download a installation version (rustup-init.exe) from the official Rust website
- Run the setup application
- 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
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.
I'm getting "1" as a result. What should I do for now?
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.
What is an example of security software you are talking?
@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.
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?
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.
Rustis 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
I have the same issue, so the windows 11 is not support the rustup? Please let me know
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.
Windows 11, via command prompt, it appears setting RUSTUP_USE_CURL=1 helps here.
Finished successfully.
@djc Looks like this can be tracked in #3790 then. Reopening...
@djc BTW do you think increasing the amount of log lines will help with your diagnosis?
Might help. Do we have that in the release already? Would be great if we can get a minidump to narrow this down, too.
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?
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.