watershot icon indicating copy to clipboard operation
watershot copied to clipboard

Crash without Vulkan

Open jbeich opened this issue 2 years ago • 1 comments

Watershot uses wgpu crate which on Linux/BSD supports both OpenGL and Vulkan (default). wgpu with OpenGL works fine at least in Firefox and Fish Folk: Jumpy but fails in Watershot. If intentional this needs to be documented in README.md as older GPUs or non-x86 architectures may not have working Vulkan.

To reproduce remove /usr/share/vulkan/icd.d/*.json or deinstall vulkan-loader or vulkan-icd-loader packages. WGPU_BACKEND=opengl with working Vulkan doesn't trigger the crash.

$ watershot
[ERROR wgpu_hal::gles::egl] EGL 'EGLMAKECURRENT' code 0x3008: eglMakeCurrent
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: BadDisplay', watershot-0.2.0-2-g2d0c652/cargo-crates/wgpu-hal-0.16.1/src/gles/egl.rs:299:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[ERROR wgpu_hal::gles::egl] EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: BadDisplay', watershot-0.2.0-2-g2d0c652/cargo-crates/wgpu-hal-0.16.1/src/gles/egl.rs:299:14
stack backtrace:
   0:      0x8c24d782b80 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h128e70683e5723b7
   1:      0x8c24d7ae34f - core::fmt::write::h2f14e02752d076b7
   2:      0x8c24d763fd1 - std::io::Write::write_fmt::hf360b4aba9d08fc3
   3:      0x8c24d782985 - std::sys_common::backtrace::print::h9fa8f27445ca260a
   4:      0x8c24d7647d7 - std::panicking::default_hook::{{closure}}::hbe250059f67749e6
   5:      0x8c24d7644ae - std::panicking::default_hook::h0a187cf1b13338bf
   6:      0x8c24d7659e0 - std::panicking::rust_panic_with_hook::h7315e6bab25fcc65
   7:      0x8c24d782e67 - std::panicking::begin_panic_handler::{{closure}}::h386aa998b2757e4c
   8:      0x8c24d782c56 - std::sys_common::backtrace::__rust_end_short_backtrace::hfb96c18bfc3a70cd
   9:      0x8c24d765622 - rust_begin_unwind
  10:      0x8c24d7a6683 - core::panicking::panic_fmt::h9d11a335d4c9300c
  11:      0x8c24d7a2503 - core::result::unwrap_failed::ha2ee61cef2630e9f
  12:      0x8c24cff2ce7 - core::result::Result<T,E>::unwrap::h5b10927106d3eaac
                               at rustc-1.71.0-src/library/core/src/result.rs:1076:23
  13:      0x8c24cfbaa1d - wgpu_hal::gles::egl::EglContext::make_current::h14bd3e861bcf8ab2
                               at watershot-0.2.0-2-g2d0c652/cargo-crates/wgpu-hal-0.16.1/src/gles/egl.rs:297:9
  14:      0x8c24cfbad92 - wgpu_hal::gles::egl::AdapterContext::lock::{{closure}}::h1c7eee38630a60b9
                               at watershot-0.2.0-2-g2d0c652/cargo-crates/wgpu-hal-0.16.1/src/gles/egl.rs:411:13
  15:      0x8c24ced6e1e - core::option::Option<T>::map::h066ec694d885eb2c
                               at rustc-1.71.0-src/library/core/src/option.rs:1075:29
  16:      0x8c24cfbad26 - wgpu_hal::gles::egl::AdapterContext::lock::hb6ecadfba82141ea
                               at watershot-0.2.0-2-g2d0c652/cargo-crates/wgpu-hal-0.16.1/src/gles/egl.rs:410:19
  17:      0x8c24d014bae - wgpu_hal::gles::device::<impl wgpu_hal::Device<wgpu_hal::gles::Api> for wgpu_hal::gles::Device>::destroy_sampler::h1243cfa5d402b51f
                               at watershot-0.2.0-2-g2d0c652/cargo-crates/wgpu-hal-0.16.1/src/gles/device.rs:911:19
  18:      0x8c24caaacd0 - wgpu_core::hub::Hub<A,F>::clear::h7c7068e3dd4b0430
                               at watershot-0.2.0-2-g2d0c652/cargo-crates/wgpu-core-0.16.1/src/hub.rs:1093:21
  19:      0x8c24caa07bc - <wgpu_core::hub::Global<G> as core::ops::drop::Drop>::drop::h658a82ae448d11fe
                               at watershot-0.2.0-2-g2d0c652/cargo-crates/wgpu-core-0.16.1/src/hub.rs:1424:13
  20:      0x8c24cbd7a67 - core::ptr::drop_in_place<wgpu_core::hub::Global<wgpu_core::hub::IdentityManagerFactory>>::h8dd46e3f00592ec8
                               at rustc-1.71.0-src/library/core/src/ptr/mod.rs:497:1
  21:      0x8c24cbcfba4 - core::ptr::drop_in_place<wgpu::backend::direct::Context>::h2b62668dbb4f5f9a
                               at rustc-1.71.0-src/library/core/src/ptr/mod.rs:497:1
  22:      0x8c24cbd0110 - core::ptr::drop_in_place<dyn wgpu::context::DynContext>::hec71d69feadec9c9
                               at rustc-1.71.0-src/library/core/src/ptr/mod.rs:497:1
  23:      0x8c24cbf4bfb - alloc::sync::Arc<T>::drop_slow::h68bd994c26ef05dd
                               at rustc-1.71.0-src/library/alloc/src/sync.rs:1263:18
  24:      0x8c24cbf534d - <alloc::sync::Arc<T> as core::ops::drop::Drop>::drop::hdacff086d8c2fe7b
                               at rustc-1.71.0-src/library/alloc/src/sync.rs:1899:13
  25:      0x8c24cbd441b - core::ptr::drop_in_place<alloc::sync::Arc<dyn wgpu::context::DynContext>>::hfb14bf4ec46d67d1
                               at rustc-1.71.0-src/library/core/src/ptr/mod.rs:497:1
  26:      0x8c24c9d52d7 - core::ptr::drop_in_place<wgpu::BindGroup>::hb4a54b8a88d8c97e
                               at rustc-1.71.0-src/library/core/src/ptr/mod.rs:497:1
  27:      0x8c24c8d8431 - core::ptr::drop_in_place<watershot::rendering::Renderer>::h796d727b8792e500
                               at rustc-1.71.0-src/library/core/src/ptr/mod.rs:497:1
  28:      0x8c24c8b3919 - watershot::gui::h945d8e0e356f1264
                               at watershot-0.2.0-2-g2d0c652/src/main.rs:177:1
  29:      0x8c24c8b1c89 - watershot::main::hea9f55f4eb1c4f64
                               at watershot-0.2.0-2-g2d0c652/src/main.rs:33:26
  30:      0x8c24c8d349b - core::ops::function::FnOnce::call_once::h6a4c4bb0bfd20375
                               at rustc-1.71.0-src/library/core/src/ops/function.rs:250:5
  31:      0x8c24c92386e - std::sys_common::backtrace::__rust_begin_short_backtrace::h4f6dbe38327542d6
                               at rustc-1.71.0-src/library/std/src/sys_common/backtrace.rs:135:18
  32:      0x8c24c8b4cc1 - std::rt::lang_start::{{closure}}::h9903a531f48c65c6
                               at rustc-1.71.0-src/library/std/src/rt.rs:166:18
  33:      0x8c24d764877 - std::panicking::try::h09ab0ca6a50f9591
  34:      0x8c24d780adb - std::rt::lang_start_internal::h3e0793a574932966
  35:      0x8c24c8b4c9a - std::rt::lang_start::h5e046485b1630588
                               at rustc-1.71.0-src/library/std/src/rt.rs:165:17
  36:      0x8c24c8b3e3e - main
thread 'main' panicked at 'panic in a function that cannot unwind', library/core/src/panicking.rs:126:5
stack backtrace:
   0:      0x8c24d782b80 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h128e70683e5723b7
   1:      0x8c24d7ae34f - core::fmt::write::h2f14e02752d076b7
   2:      0x8c24d763fd1 - std::io::Write::write_fmt::hf360b4aba9d08fc3
   3:      0x8c24d782985 - std::sys_common::backtrace::print::h9fa8f27445ca260a
   4:      0x8c24d7647d7 - std::panicking::default_hook::{{closure}}::hbe250059f67749e6
   5:      0x8c24d7644ae - std::panicking::default_hook::h0a187cf1b13338bf
   6:      0x8c24d7659e0 - std::panicking::rust_panic_with_hook::h7315e6bab25fcc65
   7:      0x8c24d782e21 - std::panicking::begin_panic_handler::{{closure}}::h386aa998b2757e4c
   8:      0x8c24d782c56 - std::sys_common::backtrace::__rust_end_short_backtrace::hfb96c18bfc3a70cd
   9:      0x8c24d765622 - rust_begin_unwind
  10:      0x8c24d7a66c3 - core::panicking::panic_nounwind_fmt::h485344c4e327d78f
  11:      0x8c24d7a6767 - core::panicking::panic_nounwind::h79a4b821e551ec7b
  12:      0x8c24d7a68f3 - core::panicking::panic_cannot_unwind::heaa5e3f5558f7bbf
  13:      0x8c24c8b3489 - watershot::gui::h945d8e0e356f1264
                               at watershot-0.2.0-2-g2d0c652/src/main.rs:91:1
  14:      0x8c24c8b1c89 - watershot::main::hea9f55f4eb1c4f64
                               at watershot-0.2.0-2-g2d0c652/src/main.rs:33:26
  15:      0x8c24c8d349b - core::ops::function::FnOnce::call_once::h6a4c4bb0bfd20375
                               at rustc-1.71.0-src/library/core/src/ops/function.rs:250:5
  16:      0x8c24c92386e - std::sys_common::backtrace::__rust_begin_short_backtrace::h4f6dbe38327542d6
                               at rustc-1.71.0-src/library/std/src/sys_common/backtrace.rs:135:18
  17:      0x8c24c8b4cc1 - std::rt::lang_start::{{closure}}::h9903a531f48c65c6
                               at rustc-1.71.0-src/library/std/src/rt.rs:166:18
  18:      0x8c24d764877 - std::panicking::try::h09ab0ca6a50f9591
  19:      0x8c24d780adb - std::rt::lang_start_internal::h3e0793a574932966
  20:      0x8c24c8b4c9a - std::rt::lang_start::h5e046485b1630588
                               at rustc-1.71.0-src/library/std/src/rt.rs:165:17
  21:      0x8c24c8b3e3e - main
thread caused non-unwinding panic. aborting.
Abort trap

jbeich avatar Jul 22 '23 09:07 jbeich

Yeah I also noticed that Vulkan not being present didn't work, and that forcing OpenGL also failed but I don't exactly know what to do about it.

Kirottu avatar Jul 22 '23 18:07 Kirottu