When I try to run an executable created by Rust 1.93.1 on, e.g., Windows 7, then I get this:
Now, I understand that Windows 7 is no longer officially supported as a target. But what exactly is the reason why we get an Access Violation (0xC0000005) error?
I could perfectly understand, if we would get a standard "The version of this file is not compatible with the version of Windows you're running" error message, because Windows detects that the .exe isn't compatible with my Windows version. However, this is not what is happening!
Actually, I have checked the PE header (NT header) of the .exe that Rust produces, and it turns out that the OS version and Sub-System version both are set to NT 6.0 in the .exe header – which is Windows Vista! So, at least from what the .exe header claims, the executable file is supposed to run on Windows Vista or later. That seems rather strange ![]()
Anyhow, even with a "wrong" minimum required Windows version indicated in the .exe header, it should not crash with an Access Violation error, right? Actually, what you would be expecting is an error message like "The application cannot start because entry point SomeFunctionThatDidNotExistInWindows7 could not be found in KERNEL32.DLL".
And, indeed, Dependency Walker confirms that an missing entry point is the real reason why the .exe file produces by Rust cannot run on the Windows 7 machine:
Why the Access Violation error, then? Seems a bit fishy ![]()
Again: I understand that .exe produced by Rust 1.93.1 won't run on Windows 7, since this target is not supported anymore, but I want to understand the technical reason why we get the Access Violation – rather than a proper loader error complaining about the missing entry point.
Regards.



