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

Errors/Warnings on closing window #7567

Closed
SpecificProtagonist opened this issue Feb 8, 2023 · 7 comments
Closed

Errors/Warnings on closing window #7567

SpecificProtagonist opened this issue Feb 8, 2023 · 7 comments
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior
Milestone

Comments

@SpecificProtagonist
Copy link
Contributor

SpecificProtagonist commented Feb 8, 2023

Bevy version

978f7cd (have not bisected yet)

What you did

Closed the window (via window manager, not from game code), causing the app to exit.

Edit: The warnings and panic happen even with

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

I don't have a minimum reproducible example for the error message yet.

What went wrong

The app exited, but sometimes printed an error (with RUST_BACKTRACE=1):

2023-02-08T13:36:20.038214Z  INFO bevy_winit::system: Creating new window "Bevy App" (0v0)
2023-02-08T13:36:20.038578Z  INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1    
2023-02-08T13:36:20.134927Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3050 Laptop GPU", vendor: 4318, device: 9634, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "525.60.11", backend: Vulkan }
2023-02-08T13:36:22.336823Z  INFO bevy_winit::system: Closing window 0v0
2023-02-08T13:36:22.342249Z  INFO bevy_window::system: No windows are open, exiting
Memory block wasn't deallocated
2023-02-08T13:36:22.396101Z ERROR wgpu::backend::direct: Handling wgpu errors as fatal by default    
thread 'Compute Task Pool (3)' panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_texture
    parent device is lost

', /home/vj/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/wgpu-0.15.0/src/backend/direct.rs:3024:5
stack backtrace:

Sometimes it prints the following warnings instead (alt-shift-q being my window close keybind):

2023-02-08T13:23:50.816036Z  INFO bevy_winit::system: Creating new window "Bevy App" (0v0)
2023-02-08T13:23:50.816646Z  INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1    
2023-02-08T13:23:50.904747Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3050 Laptop GPU", vendor: 4318, device: 9634, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "525.60.11", backend: Vulkan }
2023-02-08T13:23:52.804462Z  INFO bevy_winit::system: Closing window 0v0
2023-02-08T13:23:52.807338Z  WARN bevy_winit: Window 0v0 is missing `Window` component, skipping event Focused(true)
2023-02-08T13:23:52.807661Z  WARN bevy_winit: Window 0v0 is missing `Window` component, skipping event ModifiersChanged(SHIFT | ALT)
2023-02-08T13:23:52.808054Z  WARN bevy_winit: Window 0v0 is missing `Window` component, skipping event CursorMoved { device_id: DeviceId(X(DeviceId(2))), position: PhysicalPosition { x: 607.0, y: 388.0 }, modifiers: SHIFT | ALT }
2023-02-08T13:23:52.809178Z  WARN bevy_winit: Window 0v0 is missing `Window` component, skipping event KeyboardInput { device_id: DeviceId(X(DeviceId(3))), input: KeyboardInput { scancode: 16, state: Pressed, virtual_keycode: Some(Q), modifiers: SHIFT | ALT }, is_synthetic: true }
2023-02-08T13:23:52.809319Z  WARN bevy_winit: Window 0v0 is missing `Window` component, skipping event KeyboardInput { device_id: DeviceId(X(DeviceId(3))), input: KeyboardInput { scancode: 42, state: Pressed, virtual_keycode: Some(LShift), modifiers: SHIFT | ALT }, is_synthetic: true }
2023-02-08T13:23:52.809502Z  WARN bevy_winit: Window 0v0 is missing `Window` component, skipping event KeyboardInput { device_id: DeviceId(X(DeviceId(3))), input: KeyboardInput { scancode: 56, state: Pressed, virtual_keycode: Some(LAlt), modifiers: SHIFT | ALT }, is_synthetic: true }
2023-02-08T13:23:52.809655Z  WARN bevy_winit: Window 0v0 is missing `Window` component, skipping event Destroyed
2023-02-08T13:23:52.813228Z  INFO bevy_window::system: No windows are open, exiting

Sometimes it panics (see below).
And sometimes it works fine.

@SpecificProtagonist SpecificProtagonist added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Feb 8, 2023
@alice-i-cecile alice-i-cecile added A-Windowing Platform-agnostic interface layer to run your app in and removed S-Needs-Triage This issue needs to be labelled labels Feb 8, 2023
@alice-i-cecile
Copy link
Member

I would start bisecting at Windows As Entities. Then check the stageless migration. Looks like an ambiguity?

@SpecificProtagonist
Copy link
Contributor Author

It's a bit tricky as it seems these two errors are unrelated and appear much less often under some configurations, but I managed to get a panic:

2023-02-08T14:04:57.844294Z  INFO bevy_winit::system: Closing window 0v0
thread 'main' panicked at 'No supported formats for surface', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_render/src/view/window.rs:197:50
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'internal error: entered unreachable code: sending into a closed channel', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:456:45
thread 'Compute Task Pool (3)' panicked at 'internal error: entered unreachable code: sending into a closed channel', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:456:45
thread 'Compute Task Pool (0)' panicked at 'internal error: entered unreachable code: sending into a closed channel', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:456:45
thread 'Compute Task Pool (2)' panicked at 'internal error: entered unreachable code: sending into a closed channel', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:456:45
thread 'Compute Task Pool (3)' panicked at 'A system has panicked so the executor cannot continue.: RecvError', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:190:60
thread 'Compute Task Pool (0)' panicked at 'internal error: entered unreachable code: sending into a closed channel', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:456:45
thread 'Compute Task Pool (2)' panicked at 'internal error: entered unreachable code: sending into a closed channel', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:456:45
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_tasks/src/task_pool.rs:368:49
thread 'main' panicked at 'internal error: entered unreachable code: sending into a closed channel', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:456:45
thread 'Compute Task Pool (1)' panicked at 'internal error: entered unreachable code: sending into a closed channel', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:456:45
thread 'Compute Task Pool (5)' panicked at 'internal error: entered unreachable code: sending into a closed channel', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:456:45
thread 'Compute Task Pool (4)' panicked at 'internal error: entered unreachable code: sending into a closed channel', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:456:45
thread 'Compute Task Pool (4)' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_render/src/pipelined_rendering.rs:136:45
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/vj/.cargo/git/checkouts/bevy-f7ffde730c324c74/978f7cd/crates/bevy_tasks/src/task_pool.rs:368:49

(backtrace)

@SpecificProtagonist
Copy link
Contributor Author

SpecificProtagonist commented Feb 8, 2023

Can reproduce both the panic and the warnings with App::new().add_plugins(DefaultPlugins), it's just much rarer.

@mockersf
Copy link
Member

mockersf commented Feb 8, 2023

Could you specify your OS, and if Linux if it's with x11 or wayland?

I saw x11 in the logs. I think it's the same as #7533 that I can't reproduce on macOS

@SpecificProtagonist
Copy link
Contributor Author

SpecificProtagonist commented Feb 8, 2023

Yep, it's on Linux and looks like the same error. Hopefully the parent device is lost error has the same cause.

@mockersf mockersf added this to the 0.10 milestone Feb 8, 2023
@hymm
Copy link
Contributor

hymm commented Feb 13, 2023

does #7628 fix this issue?

@SpecificProtagonist
Copy link
Contributor Author

SpecificProtagonist commented Feb 13, 2023

Unless I'm just getting very lucky, it does! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

No branches or pull requests

4 participants