bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Panic in bevy_ecs, probably related to windowing

Open schnippl0r opened this issue 1 year ago • 4 comments

The following code causes bevy to panic

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins.set(WindowPlugin {
            primary_window: Some(Window::default()),
            exit_condition: bevy::window::ExitCondition::OnPrimaryClosed,
            close_when_requested: true,
        }))
        .run();
}
2023-03-07T15:16:55.444347Z  INFO bevy_winit::system: Creating new window "Bevy App" (0v0)
2023-03-07T15:16:55.445151Z  INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1
2023-03-07T15:16:55.483296Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 480 Graphics (RADV POLARIS10)", vendor: 4098, device: 26591, device_type: DiscreteGpu, driver: "radv", driver_info: "Mesa 23.0.0", backend: Vulkan }
2023-03-07T15:16:56.321835Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux rolling Arch Linux", kernel: "6.2.2-arch1-1", cpu: "Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz", core_count: "4", memory: "31.3 GiB" }
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/me/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.10.0/src/schedule/schedule.rs:1146:56
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

In Cargo.toml, set dependencies to only bevy = "0.10.0" and start with cargo run

schnippl0r avatar Mar 07 '23 15:03 schnippl0r

I have this same issue, I'm running wayland on NVIDIA. It only takes this to reproduce:

use bevy::prelude::*;

fn main() {
    App::new().add_plugins(DefaultPlugins).run();
}
2023-03-07T17:43:54.938639Z  INFO bevy_winit::system: Creating new window "Bevy App" (0v0)
2023-03-07T17:43:54.938973Z  INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1
2023-03-07T17:43:55.124443Z  INFO bevy_render::renderer: AdapterInfo { name: "NV136", vendor: 0, device: 0, device_type: Other, driver: "", driver_info: "", backend: Gl }
2023-03-07T17:43:55.357459Z ERROR wgpu_core::device: surface configuration failed: incompatible window kind
thread 'main' panicked at 'Error in Surface::configure: invalid surface', /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.15.1/src/backend/direct.rs:316:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'A system has panicked so the executor cannot continue.: RecvError', /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.10.0/src/schedule/executor/multi_threaded.rs:194:60
thread 'Compute Task Pool (3)' panicked at 'internal error: entered unreachable code: sending into a closed channel', /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.10.0/src/schedule/executor/multi_threaded.rs:459:45
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.10.0/src/task_pool.rs:376:49
thread 'Compute Task Pool (1)' panicked at 'internal error: entered unreachable code: sending into a closed channel', /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.10.0/src/schedule/executor/multi_threaded.rs:459:45
thread 'Compute Task Pool (1)' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_render-0.10.0/src/pipelined_rendering.rs:136:45
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.10.0/src/task_pool.rs:376:49

Bugbert avatar Mar 07 '23 17:03 Bugbert

That's not the same issue, and your log shows Bevy starting as X11... probably something to look into. Could you open another issue if you can't find something between Wayland and X11?

mockersf avatar Mar 07 '23 18:03 mockersf

I tested on an x11 session and there wasn't an issue. I put it here because the log looked a lot similar but looking again I can see it was panicking from different spot. Should I open a new issue?

Edit: I should also add that on wayland, a window did apear for a brief moment before it crashed so it likely succeeded in connecting to xwayland

Bugbert avatar Mar 07 '23 18:03 Bugbert

yep, reproduce on windows 10 too

2023-03-10T03:43:09.400986Z  INFO bevy_winit::system: Creating new window "Bevy App" (0v0)
2023-03-10T03:43:09.794907Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce GTX 1050", vendor: 4318, device: 7297, device_type: DiscreteGpu,driver: "", driver_info: "", backend: Dx12 }
2023-03-10T03:43:11.385306Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 10 Pro", kernel: "19045", cpu: "Intel(R) Core(TM) i5-9400 CPU @ 2.90GHz", core_count: "6", memory: "31.9 GiB" }
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', C:\Users\nicki\.cargo\registry\src\mirrors.ustc.edu.cn07d6cef1b9e54f94\bevy_ecs-0.10.0\src\schedule\schedule.rs:1146:56
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

pppKin avatar Mar 10 '23 03:03 pppKin

with this: use bevy::prelude::*; fn main() { App::new().add_plugins(DefaultPlugins).run(); }

same prob':

Finished dev [optimized + debuginfo] target(s) in 1.20s Running target\debug\syapk_bevy_gravity.exe 2023-03-10T08:33:25.965467Z INFO bevy_winit::system: Creating new window "Bevy App" (0v0) 2023-03-10T08:33:26.098325Z INFO bevy_render::renderer: AdapterInfo { name: "Intel(R) HD Graphics 620", vendor: 32902, device: 22806, device_type: IntegratedGpu, driver: "Intel Corporation", driver_info: "Intel driver", backend: Vulkan } 2023-03-10T08:33:30.215743Z INFO bevy_window::system: No windows are open, exiting 2023-03-10T08:33:30.219088Z INFO bevy_winit::system: Closing window 0v0

syapk avatar Mar 10 '23 08:03 syapk