bevy_framepace icon indicating copy to clipboard operation
bevy_framepace copied to clipboard

Plugin causes crash on Windows 10: (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)

Open EkremDincel opened this issue 1 year ago • 3 comments

Minimal example that invokes the error:

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(bevy_framepace::FramepacePlugin); // Not adding the plugin solves the problem
}

Error message (there is no stacktrace or panic message even if debug is enabled):

error: process didn't exit successfully: `D:\Artifacts\rust_target\fast-debug\bevy_demo.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)

Adapter information:

AdapterInfo { name: "NVIDIA GeForce RTX 3060 Laptop GPU", vendor: 4318, device: 9504, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "560.94", backend: Vulkan }

Active toolchain is rustc 1.83.0-nightly (0ee7cb5e3 2024-09-10).

Below is the cargo.toml configuration I used:

[package]
name = "bevy_demo"
version = "0.1.0"
edition = "2021"

[dependencies]
bevy = { version = "0.14.2", features = ["dynamic_linking"] }
bevy_framepace = "0.17.1"

log = { version = "*", features = ["max_level_debug", "release_max_level_warn"] }


[profile.dev]
opt-level = 1

[profile.dev.build-override]
opt-level = 3

[profile.release.build-override]
opt-level = 3

[profile.dev.package."*"]
opt-level = 3

[profile.fast]
inherits = "release"
strip = true
lto = true
codegen-units = 1
panic = "unwind"

[profile.fast-debug]
inherits = "release"
split-debuginfo = "off"
debug = true
strip = false
lto = true
codegen-units = 1
panic = "unwind"

And this is the .cargo/config.toml:

[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
rustflags = [
  "-Zthreads=0",
]

Note: the crash happens only in the fast or fast-debug profile. The debug profile works without any problems.

EkremDincel avatar Sep 27 '24 16:09 EkremDincel

I came across similar issues with the same exit code for bevy in the internet but I am only experiencing the issue while using this plugin. I can render things just fine if I don't add the plugin.

EkremDincel avatar Sep 27 '24 16:09 EkremDincel

This sounds like some sort of race condition. All the plugin really does is a spin sleep.

aevyrie avatar Jan 05 '25 06:01 aevyrie

My friend had this exact same error and updating his NVIDIA drivers fixed the problem for him. It's worth a try

Coletronix avatar May 23 '25 22:05 Coletronix

Closing this as stale, no reports like this since.

aevyrie avatar Dec 12 '25 04:12 aevyrie