Bevy segfaults when using wayland
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version
Bevy 0.8.1 + 0.9
## \[Optional\] Relevant system information
OS: Ubuntu 22.04.1 LTS, Wayland. The app is run natively
Adapter info printed by bevy:
```
2022-09-13T14:08:53.880285Z INFO bevy_render::renderer: AdapterInfo { name: "Intel(R) HD Graphics 620 (KBL GT2)", vendor: 32902, device: 22806, device_type: IntegratedGpu, backend: Vulkan }
```
## What you did
Create the following project:
```rust
// main.rs
use bevy::prelude::*;
fn main() {
App::new().add_plugins(DefaultPlugins).update();
}
```
```toml
#Cargo.toml
[package]
name = "bevy_crash"
version = "0.1.0"
edition = "2021"
[dependencies]
bevy = { version = "0.8", features = ["wayland"] }
```
And then `cargo run` it.
## What went wrong
The app was supposed to show a window, close it and exit. Instead of that, a segmentation fault occurs.
## Additional information
I have run the program with `gdb` connected and managed to get a backtrace:
```
#0 0x00007ffff7b1f85a in ?? () from /lib/x86_64-linux-gnu/libwayland-client.so
#1 0x00007ffff7b211bb in wl_proxy_marshal_array_flags () from /lib/x86_64-linux-gnu/libwayland-client.so
#2 0x00007ffff7b21caf in wl_proxy_marshal_flags () from /lib/x86_64-linux-gnu/libwayland-client.so
#3 0x00007fffd937038c in ?? () from /usr/lib/x86_64-linux-gnu/libvulkan_intel.so
#4 0x00007fffd9370536 in ?? () from /usr/lib/x86_64-linux-gnu/libvulkan_intel.so
#5 0x000055555750959d in ash::extensions::khr::swapchain::Swapchain::destroy_swapchain (self=0x7ffffffeb7e0, swapchain=..., allocation_callbacks=...)
at src/extensions/khr/swapchain.rs:29
#6 0x00005555573d0353 in wgpu_hal::vulkan::instance::{impl#5}::unconfigure (self=0x555559012970, device=0x5555592aab68) at src/vulkan/instance.rs:746
#7 0x0000555556ee7671 in wgpu_core::hub::Hub::clear (self=0x555559018538, surface_guard=0x555559018508, with_adapters=true)
at /home/innocentus/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-core-0.13.2/src/hub.rs:822
#8 0x0000555556edad33 in wgpu_core::hub::{impl#72}::drop (self=0x555559018430)
at /home/innocentus/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-core-0.13.2/src/hub.rs:1024
#9 0x00005555571e5907 in core::ptr::drop_in_place> ()
<...a bunch of nested drop_in_place calls...>
#49 0x0000555557e07ff9 in core::ptr::drop_in_place () at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/ptr/mod.rs:487
#50 0x00005555559fd334 in bevy_crash_app::main () at src/main.rs:4
```
~~I have no idea what's causing this, I suppose that `0.26.1` does something `0.26.0` didn't do before (or contains a bug of some sort). the segfault happens if you add `winit 0.26.0` as a dependency too~~
Contributor guide
Research direction
Reproduce the minimal project from src/main.rs with Bevy 0.8/0.9 and the wayland feature on Ubuntu 22.04 under Wayland. Start with the reported backtrace through ash's swapchain::destroy_swapchain and wgpu_hal::vulkan::instance::unconfigure; done means the application opens and exits without a segmentation fault.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop-dev, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100