rendy icon indicating copy to clipboard operation
rendy copied to clipboard

Illegal hardware instruction when running triangle example with recent nightly

Open zesterer opened this issue 6 years ago • 8 comments

Hi,

I'm using rustc 1.33.0-nightly (a2b0f247b 2018-12-30). My graphics chipset is Intel® HD Graphics 5500 (Broadwell GT2).

When running cargo run --example triangle --features vulkan, I get the following output (the window opens briefly before crashing with the following - I assume this isn't intended):

image

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: OutOfDate', src/libcore/result.rs:999:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `3883100`,
 right: `0`', memory/src/allocator/dedicated.rs:174:9
stack backtrace:
   0:     0x556040c8c583 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h94831b6369ea0bc6
                               at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1:     0x556040c87ff8 - std::sys_common::backtrace::_print::h3eadd3a681120c3a
                               at src/libstd/sys_common/backtrace.rs:70
   2:     0x556040c8b032 - std::panicking::default_hook::{{closure}}::h51e50ca514fa5358
                               at src/libstd/sys_common/backtrace.rs:58
                               at src/libstd/panicking.rs:200
   3:     0x556040c8ada4 - std::panicking::default_hook::h6a9922be127f81dc
                               at src/libstd/panicking.rs:215
   4:     0x556040c8b740 - std::panicking::rust_panic_with_hook::heaf7eac5e1d620dd
                               at src/libstd/panicking.rs:478
   5:     0x556040c8b2c1 - std::panicking::continue_panic_fmt::ha149b879e772ad0e
                               at src/libstd/panicking.rs:385
   6:     0x556040c8b20e - std::panicking::begin_panic_fmt::h812c97985775db0f
                               at src/libstd/panicking.rs:340
   7:     0x556040c1a8f4 - <rendy_memory::allocator::dedicated::DedicatedAllocator as core::ops::drop::Drop>::drop::h47f43e0f59d656d7
                               at memory/src/allocator/dedicated.rs:174
   8:     0x55604014525e - core::ptr::real_drop_in_place::hc26a230528cc21d8
                               at /rustc/a2b0f247bf741a1a9729363dda8628a938f1fe58/src/libcore/ptr.rs:193
   9:     0x556040141d34 - core::ptr::real_drop_in_place::h91ad602ba8cb2a89
                               at /rustc/a2b0f247bf741a1a9729363dda8628a938f1fe58/src/libcore/ptr.rs:193
  10:     0x556040139ee7 - core::ptr::real_drop_in_place::h265e56aad1f8d811
                               at /rustc/a2b0f247bf741a1a9729363dda8628a938f1fe58/src/libcore/ptr.rs:193
  11:     0x5560402cc06f - <alloc::vec::Vec<T> as core::ops::drop::Drop>::drop::hc5eb4ae77e5b587d
                               at /rustc/a2b0f247bf741a1a9729363dda8628a938f1fe58/src/libcore/ptr.rs:183
                               at /rustc/a2b0f247bf741a1a9729363dda8628a938f1fe58/src/liballoc/vec.rs:2102
  12:     0x556040145df0 - core::ptr::real_drop_in_place::hcb5a6f737adcab4d
                               at /rustc/a2b0f247bf741a1a9729363dda8628a938f1fe58/src/libcore/ptr.rs:193
  13:     0x556040143e50 - core::ptr::real_drop_in_place::hb1b10c9c2cc0f9a5
                               at /rustc/a2b0f247bf741a1a9729363dda8628a938f1fe58/src/libcore/ptr.rs:193
  14:     0x55604013c1ed - core::ptr::real_drop_in_place::h42bfb6595f5c433a
                               at /rustc/a2b0f247bf741a1a9729363dda8628a938f1fe58/src/libcore/ptr.rs:193
  15:     0x556040147931 - core::ptr::real_drop_in_place::he126503329dbd7e6
                               at /rustc/a2b0f247bf741a1a9729363dda8628a938f1fe58/src/libcore/ptr.rs:193
  16:     0x556040145b11 - core::ptr::real_drop_in_place::hc8f176a163ac04fa
                               at /rustc/a2b0f247bf741a1a9729363dda8628a938f1fe58/src/libcore/ptr.rs:193
  17:     0x556040259326 - triangle::main::h5e41d72835494097
                               at rendy/examples/triangle/main.rs:263
  18:     0x55604027e03f - std::rt::lang_start::{{closure}}::hde7abb7342b4a879
                               at /rustc/a2b0f247bf741a1a9729363dda8628a938f1fe58/src/libstd/rt.rs:64
  19:     0x556040c8b142 - std::panicking::try::do_call::hceb5c183e4871fb5
                               at src/libstd/rt.rs:49
                               at src/libstd/panicking.rs:297
  20:     0x556040c8ffe9 - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:92
  21:     0x556040c8bd55 - std::rt::lang_start_internal::h20dfa5ca4123c042
                               at src/libstd/panicking.rs:276
                               at src/libstd/panic.rs:388
                               at src/libstd/rt.rs:48
  22:     0x55604027e018 - std::rt::lang_start::h8fe3e3c3beba6449
                               at /rustc/a2b0f247bf741a1a9729363dda8628a938f1fe58/src/libstd/rt.rs:64
  23:     0x5560402595a9 - main
  24:     0x7f24ae143222 - __libc_start_main
  25:     0x55604005c99d - _start
  26:                0x0 - <unknown>
thread panicked while panicking. aborting.
[1]    18130 illegal hardware instruction (core dumped)  cargo run --example triangle --features vulkan

zesterer avatar Jan 06 '19 01:01 zesterer

I also got a number of errors like that. I simply assumed it was due to unimplemented functionality, but I may be wrong.

64 avatar Jan 06 '19 06:01 64

I guess @64 is right. OutOfDate signals that Surface changed and Swapchain must be recreated, but this part is not implemented yet. Latter program panics during cleanup because not all resources were freed properly. So illegal hardware instruction is just a symptom caused by double panic. #30 should make things more clear by writing to log instead of panicing on leaks.

I assumed that OutOfDate cannot be returned unless you do something with the window.

zakarumych avatar Jan 06 '19 08:01 zakarumych

What about the buggy looking Vulkan output? Is that a chipset/driver issue, or an issue with rendy?

zesterer avatar Jan 06 '19 11:01 zesterer

@zesterer the background should be white. IDK which part is faulty. Presentation issues weren't reported except for iOS platform.

zakarumych avatar Jan 06 '19 15:01 zakarumych

What driver are you using?

zakarumych avatar Jan 06 '19 15:01 zakarumych

The latest (or close to latest) MESA + i915 (i.e: the default on virtually all Linux distributions).

zesterer avatar Jan 06 '19 21:01 zesterer

IIRC its Vulkan suport is still kinda buggy. Can you use drivers developed by Intel?

zakarumych avatar Jan 07 '19 07:01 zakarumych

Intel's driver is the i915 driver. They work with the Linux devs on maintaining it within the kernel tree.

zesterer avatar Jan 07 '19 15:01 zesterer