Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic in bevy_ecs, probably related to windowing #7949

Closed
schnippl0r opened this issue Mar 7, 2023 · 5 comments · Fixed by #7950
Closed

Panic in bevy_ecs, probably related to windowing #7949

schnippl0r opened this issue Mar 7, 2023 · 5 comments · Fixed by #7950
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior
Milestone

Comments

@schnippl0r
Copy link

schnippl0r commented Mar 7, 2023

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 schnippl0r added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Mar 7, 2023
@mockersf mockersf added A-ECS Entities, components, systems, and events and removed S-Needs-Triage This issue needs to be labelled labels Mar 7, 2023
@mockersf mockersf added this to the 0.10.1 milestone Mar 7, 2023
@Bugbert
Copy link

Bugbert commented Mar 7, 2023

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

@mockersf
Copy link
Member

mockersf commented Mar 7, 2023

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?

@Bugbert
Copy link

Bugbert commented Mar 7, 2023

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

@pppKin
Copy link

pppKin commented Mar 10, 2023

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

@syapk
Copy link

syapk commented Mar 10, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants