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

ERROR_OUT_OF_DATE_KHR crash in blade, when running on x11 Linux #9628

Closed
1 task done
osa1 opened this issue Mar 21, 2024 · 8 comments
Closed
1 task done

ERROR_OUT_OF_DATE_KHR crash in blade, when running on x11 Linux #9628

osa1 opened this issue Mar 21, 2024 · 8 comments
Labels
bug [core label] linux panic / crash [core label]

Comments

@osa1
Copy link
Contributor

osa1 commented Mar 21, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

The issue happens in Zed as well, but a smaller repro is the "animation" example in gpui.

  • Run with cargo run --example animation.
  • Resize the window a few times.

Output:

   Compiling gpui v0.1.0 (/$HOME/editors/zed/crates/gpui)
    Finished dev [unoptimized + debuginfo] target(s) in 9.64s
     Running `/$HOME/editors/zed/target/debug/examples/animation`
thread 'main' panicked at /$HOME/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/61cbd6b/blade-graphics/src/vulkan/init.rs:801:18:
called `Result::unwrap()` on an `Err` value: ERROR_OUT_OF_DATE_KHR
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
   3: <core::result::Result<(u32, bool), ash::vk::enums::Result>>::unwrap
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1073:23
   4: <blade_graphics::hal::Context>::acquire_frame
             at /$HOME/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/61cbd6b/blade-graphics/src/vulkan/init.rs:798:13
   5: <gpui::platform::blade::blade_renderer::BladeRenderer>::draw
             at ./src/platform/blade/blade_renderer.rs:517:13
   6: <gpui::platform::linux::x11::window::X11Window as gpui::platform::PlatformWindow>::draw
             at ./src/platform/linux/x11/window.rs:493:9
   7: <gpui::window::WindowContext>::present
             at ./src/window.rs:1094:9
   8: <gpui::window::Window>::new::{closure#2}::{closure#1}::{closure#0}
             at ./src/window.rs:469:33
   9: <gpui::app::AppContext as gpui::Context>::update_window::<(), <gpui::window::Window>::new::{closure#2}::{closure#1}::{closure#0}>::{closure#0}
             at ./src/app.rs:1269:26
  10: <gpui::app::AppContext>::update::<core::result::Result<(), anyhow::Error>, <gpui::app::AppContext as gpui::Context>::update_window<(), <gpui::window::Window>::new::{closure#2}::{closure#1}::{closure#0}>::{closure#0}>
             at ./src/app.rs:354:22
  11: <gpui::app::AppContext as gpui::Context>::update_window::<(), <gpui::window::Window>::new::{closure#2}::{closure#1}::{closure#0}>
             at ./src/app.rs:1260:9
  12: <gpui::app::async_context::AsyncAppContext as gpui::Context>::update_window::<(), <gpui::window::Window>::new::{closure#2}::{closure#1}::{closure#0}>
             at ./src/app/async_context.rs:70:9
  13: <gpui::window::AnyWindowHandle>::update::<gpui::app::async_context::AsyncAppContext, (), <gpui::window::Window>::new::{closure#2}::{closure#1}::{closure#0}>
             at ./src/window.rs:2748:9
  14: <gpui::window::Window>::new::{closure#2}::{closure#1}
             at ./src/window.rs:466:25
  15: util::measure::<(), <gpui::window::Window>::new::{closure#2}::{closure#1}>
             at /$HOME/editors/zed/crates/util/src/util.rs:175:9
  16: <gpui::window::Window>::new::{closure#2}
             at ./src/window.rs:465:21
  17: <alloc::boxed::Box<dyn core::ops::function::FnMut<(), Output = ()>> as core::ops::function::FnMut<()>>::call_mut
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2022:9
  18: <gpui::platform::linux::x11::window::X11WindowState>::refresh
             at ./src/platform/linux/x11/window.rs:269:13
  19: <gpui::platform::linux::x11::client::X11Client>::handle_event
             at ./src/platform/linux/x11/client.rs:171:17
  20: <gpui::platform::linux::x11::client::X11Client>::new::{closure#0}
             at ./src/platform/linux/x11/client.rs:116:29
  21: <core::cell::RefCell<calloop::sources::DispatcherInner<calloop::sources::generic::Generic<calloop::sources::generic::FdWrapper<alloc::rc::Rc<x11rb::xcb_ffi::XCBConnection>>, x11rb::errors::ConnectionError>, <gpui::platform::linux::x11::client::X11Client>::new::{closure#0}>> as calloop::sources::EventDispatcher<()>>::process_events::{closure#0}
             at /$HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/calloop-0.12.4/src/sources/mod.rs:327:61
  22: <calloop::sources::generic::Generic<calloop::sources::generic::FdWrapper<alloc::rc::Rc<x11rb::xcb_ffi::XCBConnection>>, x11rb::errors::ConnectionError> as calloop::sources::EventSource>::process_events::<<core::cell::RefCell<calloop::sources::DispatcherInner<calloop::sources::generic::Generic<calloop::sources::generic::FdWrapper<alloc::rc::Rc<x11rb::xcb_ffi::XCBConnection>>, x11rb::errors::ConnectionError>, <gpui::platform::linux::x11::client::X11Client>::new::{closure#0}>> as calloop::sources::EventDispatcher<()>>::process_events::{closure#0}>
             at /$HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/calloop-0.12.4/src/sources/generic.rs:290:9
  23: <core::cell::RefCell<calloop::sources::DispatcherInner<calloop::sources::generic::Generic<calloop::sources::generic::FdWrapper<alloc::rc::Rc<x11rb::xcb_ffi::XCBConnection>>, x11rb::errors::ConnectionError>, <gpui::platform::linux::x11::client::X11Client>::new::{closure#0}>> as calloop::sources::EventDispatcher<()>>::process_events
             at /$HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/calloop-0.12.4/src/sources/mod.rs:326:9
  24: <calloop::loop_logic::EventLoop<()>>::dispatch_events
             at /$HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/calloop-0.12.4/src/loop_logic.rs:445:31
  25: <calloop::loop_logic::EventLoop<()>>::dispatch::<core::option::Option<core::time::Duration>>
             at /$HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/calloop-0.12.4/src/loop_logic.rs:559:9
  26: <calloop::loop_logic::EventLoop<()>>::run::<<gpui::platform::linux::platform::LinuxPlatform as gpui::platform::Platform>::run::{closure#0}, core::option::Option<core::time::Duration>>
             at /$HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/calloop-0.12.4/src/loop_logic.rs:596:13
  27: <gpui::platform::linux::platform::LinuxPlatform as gpui::platform::Platform>::run
             at ./src/platform/linux/platform.rs:136:9
  28: <gpui::app::App>::run::<animation::main::{closure#0}>
             at ./src/app.rs:142:9
  29: animation::main
             at ./examples/animation.rs:62:5
  30: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Environment

NA

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

@osa1 osa1 added admin read Pending admin review bug [core label] panic / crash [core label] triage Maintainer needs to classify the issue labels Mar 21, 2024
@Moshyfawn Moshyfawn added linux and removed triage Maintainer needs to classify the issue labels Mar 21, 2024
@JosephTLyons JosephTLyons removed the admin read Pending admin review label Mar 26, 2024
@ComputerDruid
Copy link

reported upstream in kvark/blade#104

@CalebHeydon
Copy link

It looks like a temporary fix was merged upstream: kvark/blade#110

On X11 (KDE), Zed is crashing whenever I try to resize the window. I tried updating the blade version to the latest commit myself, but it won't build now. I don't know enough Rust to have any idea how to fix it.

Compiling async-global-executor v2.3.1
error[E0277]: the trait bound `wayland::window::RawWindow: raw_window_handle::HasWindowHandle` is not satisfied
   --> crates/gpui/src/platform/linux/wayland/window.rs:116:21
    |
115 |                 gpu::Context::init_windowed(
    |                 --------------------------- required by a bound introduced by this call
116 |                     &raw,
    |                     ^^^^ the trait `raw_window_handle::HasWindowHandle` is not implemented for `wayland::window::RawWindow`
    |
    = help: the following other types implement trait `raw_window_handle::HasWindowHandle`:
              raw_window_handle::WindowHandle<'_>
              WaylandWindow
              platform::linux::x11::window::X11Window
              &H
              &mut H
note: required by a bound in `blade_graphics::hal::init::<impl blade_graphics::Context>::init_windowed`
   --> /home/caleb/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/a81f529/blade-graphics/src/vulkan/init.rs:629:12
    |
628 |     pub unsafe fn init_windowed<
    |                   ------------- required by a bound in this associated function
629 |         I: raw_window_handle::HasWindowHandle + raw_window_handle::HasDisplayHandle,
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `blade_graphics::hal::init::<impl Context>::init_windowed`

error[E0277]: the trait bound `wayland::window::RawWindow: raw_window_handle::HasDisplayHandle` is not satisfied
   --> crates/gpui/src/platform/linux/wayland/window.rs:116:21
    |
115 |                 gpu::Context::init_windowed(
    |                 --------------------------- required by a bound introduced by this call
116 |                     &raw,
    |                     ^^^^ the trait `raw_window_handle::HasDisplayHandle` is not implemented for `wayland::window::RawWindow`
    |
    = help: the following other types implement trait `raw_window_handle::HasDisplayHandle`:
              raw_window_handle::DisplayHandle<'a>
              WaylandWindow
              platform::linux::x11::window::X11Window
              &H
              &mut H
note: required by a bound in `blade_graphics::hal::init::<impl blade_graphics::Context>::init_windowed`
   --> /home/caleb/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/a81f529/blade-graphics/src/vulkan/init.rs:629:49
    |
628 |     pub unsafe fn init_windowed<
    |                   ------------- required by a bound in this associated function
629 |         I: raw_window_handle::HasWindowHandle + raw_window_handle::HasDisplayHandle,
    |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `blade_graphics::hal::init::<impl Context>::init_windowed`

error[E0277]: the trait bound `platform::linux::x11::window::RawWindow: raw_window_handle::HasWindowHandle` is not satisfied
   --> crates/gpui/src/platform/linux/x11/window.rs:222:21
    |
221 |                 gpu::Context::init_windowed(
    |                 --------------------------- required by a bound introduced by this call
222 |                     &raw,
    |                     ^^^^ the trait `raw_window_handle::HasWindowHandle` is not implemented for `platform::linux::x11::window::RawWindow`
    |
    = help: the following other types implement trait `raw_window_handle::HasWindowHandle`:
              raw_window_handle::WindowHandle<'_>
              WaylandWindow
              platform::linux::x11::window::X11Window
              &H
              &mut H
note: required by a bound in `blade_graphics::hal::init::<impl blade_graphics::Context>::init_windowed`
   --> /home/caleb/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/a81f529/blade-graphics/src/vulkan/init.rs:629:12
    |
628 |     pub unsafe fn init_windowed<
    |                   ------------- required by a bound in this associated function
629 |         I: raw_window_handle::HasWindowHandle + raw_window_handle::HasDisplayHandle,
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `blade_graphics::hal::init::<impl Context>::init_windowed`

error[E0277]: the trait bound `platform::linux::x11::window::RawWindow: raw_window_handle::HasDisplayHandle` is not satisfied
   --> crates/gpui/src/platform/linux/x11/window.rs:222:21
    |
221 |                 gpu::Context::init_windowed(
    |                 --------------------------- required by a bound introduced by this call
222 |                     &raw,
    |                     ^^^^ the trait `raw_window_handle::HasDisplayHandle` is not implemented for `platform::linux::x11::window::RawWindow`
    |
    = help: the following other types implement trait `raw_window_handle::HasDisplayHandle`:
              raw_window_handle::DisplayHandle<'a>
              WaylandWindow
              platform::linux::x11::window::X11Window
              &H
              &mut H
note: required by a bound in `blade_graphics::hal::init::<impl blade_graphics::Context>::init_windowed`
   --> /home/caleb/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/a81f529/blade-graphics/src/vulkan/init.rs:629:49
    |
628 |     pub unsafe fn init_windowed<
    |                   ------------- required by a bound in this associated function
629 |         I: raw_window_handle::HasWindowHandle + raw_window_handle::HasDisplayHandle,
    |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `blade_graphics::hal::init::<impl Context>::init_windowed`

For more information about this error, try `rustc --explain E0277`.
   Compiling kv-log-macro v1.0.7
error: could not compile `gpui` (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...

@DissolveDZ

This comment was marked as spam.

@CalebHeydon
Copy link

I noticed that if I build v0.130.6, it doesn't crash for me, so I think a recent change must have made the problem worse.

@CalebHeydon
Copy link

I've found a workaround. On KDE, you can right click on the taskbar icon and under more, click maximize. It will crash if you try to use the normal maximize button.

@DissolveDZ
Copy link
Contributor

I'm pretty sure this issue can be closed as of one of the latest commits, resizing now doesn't crash anymore, for me atleast

@CalebHeydon
Copy link

I can confirm that it's fixed now.

@mikayla-maki
Copy link
Contributor

Glad it's working for y'all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] linux panic / crash [core label]
Projects
None yet
Development

No branches or pull requests

7 participants