Skip to content

rustc fails to build trivial hello world program; cargo build always fails : exit code: 0xc0000005, STATUS_ACCESS_VIOLATION #135114

@abhijitsahu

Description

@abhijitsahu

Verification

Problem

Hi,

I have installed latest rustup-init.exe. Always i am getting build issue as below exit code: 0xc0000005, STATUS_ACCESS_VIOLATION. I have tried to reinstall couple of times still did not workout.

PS D:\rust-example> cargo new ex03
    Creating binary (application) `ex03` package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
PS D:\rust-example> cd .\ex03\

PS D:\rust-example\ex03> cargo --version
cargo 1.83.0 (5ffbef321 2024-10-29)

PS D:\rust-example\ex03> rustc --version
rustc 1.83.0 (90b35a623 2024-11-26)

PS D:\rust-example\ex03> cargo build
   Compiling ex03 v0.1.0 (D:\rust-example\ex03)
error: could not compile `ex03` (bin "ex03")

Caused by:
  process didn't exit successfully: `C:\Users\LENOVO\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\rustc.exe --crate-name ex03 --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=237 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --check-cfg cfg(docsrs) --check-cfg "cfg(feature, values())" -C metadata=3c538b4ef1d2d27e --out-dir D:\rust-example\ex03\target\debug\deps -C incremental=D:\rust-example\ex03\target\debug\incremental -L dependency=D:\rust-example\ex03\target\debug\deps` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)
PS D:\rust-example\ex03> 

Could you please help?

Steps

  1. Download and install rustup-init.exe from install exe from here
  2. Create a sample project cargo new ex03
  3. Perform cargo build

Issue: It never build success. Always getting error as exit code: 0xc0000005, STATUS_ACCESS_VIOLATION.

Possible Solution(s)

No response

Notes

I have tried to install stable-x86_64-pc-windows-gnu and checked however still did not worked out.

Windows Version:
Image
Image

Rustup version

cargo 1.83.0 (5ffbef321 2024-10-29)

Installed toolchains

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

stable-x86_64-pc-windows-msvc (default)
rustc 1.83.0 (90b35a623 2024-11-26)

OS version

Windows 11 Pro OS,  Version 24H2 (OS Build 26100.2605)

C:\Windows\System32>wmic os get osarchitecture
OSArchitecture
64-bit

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.O-windowsOperating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions