aevyrie / bevy_framepace

Framepacing and framelimiting for Bevy
https://crates.io/crates/bevy_framepace
Apache License 2.0
245 stars 23 forks source link

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

Open EkremDincel opened 1 month ago

EkremDincel commented 1 month ago

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 commented 1 month ago

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.