STATUS_ACCESS_VIOLATION when trying to run hello world example

Good Day

Background:
I recently upgraded my system with a new motherboard+cpu+ram and did a clean install of windows 11 and am up to date with all updates. I installed rust from the official rust site.

Problem:
Any rust code that I try and run errors with
error: process didn't exit successfully: `target\debug\rusttest.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)

I even did a new cargo new to generate a hello world example to try and test and it gives the same issues.

The code:
src/main.rs

fn main() {
    println!("Hello, world!");
}

I tried this with cargo run

U:\code\rusttest> cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.00s
     Running `target\debug\rusttest.exe`
error: process didn't exit successfully: `target\debug\rusttest.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)

I did install visual studio with c++ support so I'm assuming something is going wrong with some dll or I'm missing something that I need. Anyone ever experience an issue like this before?

This seems to be a problem running on a particular disk. Running on a seperate drive eliminates the issue. Not deleting question in case anyone else runs into this issue

Hm, do you know if the disk is special in some way? Like is it a RAM drive or a network drive or something like that?

I copied the code folder to my C: drive and did a cargo run again. This time it worked without any issues.

Are you using a separate anti-virus application?

Does the fault occur without the println?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.