vulkano: Bug after resizing window containing swap chain

I created a program using windows and the swapchain. The swapchain part is pretty similar to the triangle example. (I may upload it in git if you want to see. currently it’s just in pijul) The problem occurs after rendering, when calling this on some result: .then_signal_fence_and_flush().unwrap(); Then the window doesn’t update anymore, because it just stops there. When I wait some time, it generates an error message and a stack backtrace, I’ll include:

thread 'main' panicked at 'unexpected error: DeviceLost', /home/porky11/.cargo/registry/src/github.com-1ecc6299db9ec823/vulkano-0.7.1/src/lib.rs:161:17
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: DeviceLostError', /checkout/src/libcore/result.rs:906:4
stack backtrace:
   0:     0x55e535584b73 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::hcae9eaf44818c983
                               at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x55e53558127a - std::sys_common::backtrace::_print::h59558c687fc4cf51
                               at /checkout/src/libstd/sys_common/backtrace.rs:71
   2:     0x55e5355863a3 - std::panicking::default_hook::{{closure}}::h48460b9cd8e002ae
                               at /checkout/src/libstd/sys_common/backtrace.rs:60
                               at /checkout/src/libstd/panicking.rs:381
   3:     0x55e535586112 - std::panicking::default_hook::h9a7143460d24c4d8
                               at /checkout/src/libstd/panicking.rs:397
   4:     0x55e535586867 - std::panicking::rust_panic_with_hook::h76b4e13bdfc8824a
                               at /checkout/src/libstd/panicking.rs:577
   5:     0x55e535586734 - std::panicking::begin_panic::hb353b753134545f4
                               at /checkout/src/libstd/panicking.rs:538
   6:     0x55e535586639 - std::panicking::begin_panic_fmt::hd2175356d78b1606
                               at /checkout/src/libstd/panicking.rs:522
   7:     0x55e5355865ca - rust_begin_unwind
                               at /checkout/src/libstd/panicking.rs:498
   8:     0x55e5355b9ec0 - core::panicking::panic_fmt::he3a4d8a4eb6d8e51
                               at /checkout/src/libcore/panicking.rs:71
   9:     0x55e5353e4125 - core::result::unwrap_failed::h1e20c5e1271e9480
                               at /checkout/src/libcore/macros.rs:23
  10:     0x55e5353bbc0c - <core::result::Result<T, E>>::unwrap::hc51a84e6b2f7a038
                               at /checkout/src/libcore/result.rs:772
  11:     0x55e53543bcb4 - <vulkano::swapchain::swapchain::SwapchainAcquireFuture as core::ops::drop::Drop>::drop::hfb7c8a15bc202cf5
                               at /home/porky11/.cargo/registry/src/github.com-1ecc6299db9ec823/vulkano-0.7.1/src/swapchain/swapchain.rs:857
  12:     0x55e535283a44 - core::ptr::drop_in_place::h87026d0e346434d0
                               at /checkout/src/libcore/ptr.rs:61
  13:     0x55e535281b0d - core::ptr::drop_in_place::h674271dfb769cd7a
                               at /checkout/src/libcore/ptr.rs:61
  14:     0x55e535286481 - core::ptr::drop_in_place::hb66addcb9dd3c6f7
                               at /checkout/src/libcore/ptr.rs:61
  15:     0x55e53527e30a - core::ptr::drop_in_place::h28064aaaa8e17741
                               at /checkout/src/libcore/ptr.rs:61
  16:     0x55e535285e64 - core::ptr::drop_in_place::hb0ac5103cf5fc3b9
                               at /checkout/src/libcore/ptr.rs:61
  17:     0x55e5351cf358 - <vulkano::sync::future::fence_signal::FenceSignalFuture<F> as core::ops::drop::Drop>::drop::h7dfd7029212159fd
                               at /home/porky11/.cargo/registry/src/github.com-1ecc6299db9ec823/vulkano-0.7.1/src/sync/future/fence_signal.rs:454
  18:     0x55e53527dab4 - core::ptr::drop_in_place::h1c009b619754c078
                               at /checkout/src/libcore/ptr.rs:61
  19:     0x55e53533c449 - vulkano::sync::future::GpuFuture::then_signal_fence_and_flush::hb6185d0718f650a2
                               at /home/porky11/.cargo/registry/src/github.com-1ecc6299db9ec823/vulkano-0.7.1/src/sync/future/mod.rs:230
  20:     0x55e535370074 - planet_jump::main::h9003e67683d62038
                               at src/main.rs:391
  21:     0x55e53558d66c - __rust_maybe_catch_panic
                               at /checkout/src/libpanic_unwind/lib.rs:99
  22:     0x55e53558708b - std::rt::lang_start::hc743ffdb6d4ba404
                               at /checkout/src/libstd/panicking.rs:459
                               at /checkout/src/libstd/panic.rs:361
                               at /checkout/src/libstd/rt.rs:59
  23:     0x55e5353884c2 - main
  24:     0x7efd5f42ff69 - __libc_start_main
  25:     0x55e5351cdf69 - _start
  26:                0x0 - <unknown>
thread panicked while panicking. aborting.
Ungültiger Maschinenbefehl (Speicherabzug geschrieben)

(The last line means something like “invalid machine command (core dumped)”)

I don’t think, this is a error, that should be able to occur without unsafe code, even if I did something wrong (what I don’t think, because except of using different shaders and doing additional things, it’s the same as the triangle example)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (15 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve been debugging this for a bit and most GpuFuture implementations reset their state to “Pending” after an error. This means vulkano will try again and re-submit the one time command buffer when trying to drop these futures. I think this should be fixable by simply rembering the error state instead of a pending state (is this what poisonned is supposed to do?).

I’ll see if I can submit a fix soon.