Skip to content

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

Open

Description

@andrew-ray-edelen

Verification

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

Activity

  1. ChrisDenton commented on Feb 3, 2025

    @ChrisDenton
    Member

    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.

  2. andrew-ray-edelen commented on Feb 4, 2025

    @andrew-ray-edelen
    Author

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

  3. ChrisDenton commented on Feb 4, 2025

    @ChrisDenton
    Member

    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.

  4. andrew-ray-edelen commented on Feb 4, 2025

    @andrew-ray-edelen
    Author

    What is an example of security software you are talking?

  5. rami3l commented on Feb 5, 2025

    @rami3l
    Member

    @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.

  6. andrew-ray-edelen commented on Feb 5, 2025

    @andrew-ray-edelen
    Author

    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?

  7. azurespheredev commented on Feb 10, 2025

    @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.

  8. andrew-ray-edelen commented on Feb 10, 2025

    @andrew-ray-edelen
    Author

    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

  9. codecrown-pro commented on Apr 21, 2025

    @codecrown-pro

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

  10. ChrisDenton commented on Apr 21, 2025

    @ChrisDenton
    Member

    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.

  11. bllackhu commented on Dec 1, 2025

    @bllackhu

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

    Image Image

    Finished successfully.

    Image
  12. rami3l commented on Dec 1, 2025

    @rami3l
    Member

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

  13. reopened this on Dec 1, 2025
  14. changed the title [-]rustup could not choose a version of rustc to run, because one wasn't specified explicitly, and no default is configured[/-] [+]Premature exits when downloading toolchain components on Windows, error code 0xC0000005 `STATUS_ACCESS_VIOLATION`[/+] on Dec 1, 2025
  15. rami3l commented on Dec 1, 2025

    @rami3l
    Member

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

  16. djc commented on Dec 1, 2025

    @djc
    Contributor

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

  17. rami3l commented on Dec 1, 2025

    @rami3l
    Member

    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?

  18. complexspaces commented on Dec 1, 2025

    @complexspaces

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions