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

Running tour example crashes #48

Closed
cassc opened this issue Nov 8, 2019 · 4 comments
Closed

Running tour example crashes #48

cassc opened this issue Nov 8, 2019 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@cassc
Copy link

cassc commented Nov 8, 2019

$ RUST_BACKTRACE=full cargo run --example tour
   Compiling iced v0.1.0-alpha.1 (/opt/user/projects/rust/iced)
    Finished dev [unoptimized + debuginfo] target(s) in 8.73s
     Running `target/debug/examples/tour`
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:378:21
stack backtrace:
   0:     0x55788f0bf524 - backtrace::backtrace::libunwind::trace::h924a2d8576118736
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1:     0x55788f0bf524 - backtrace::backtrace::trace_unsynchronized::h74a88d3cf8e9a73f
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2:     0x55788f0bf524 - std::sys_common::backtrace::_print_fmt::hd0a3b38a8cacdd34
                               at src/libstd/sys_common/backtrace.rs:77
   3:     0x55788f0bf524 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h900e23881de8b515
                               at src/libstd/sys_common/backtrace.rs:61
   4:     0x55788f0e18fc - core::fmt::write::hb62ff58e7d34938d
                               at src/libcore/fmt/mod.rs:1028
   5:     0x55788f0bc6c7 - std::io::Write::write_fmt::h1145a99f1b56dffb
                               at src/libstd/io/mod.rs:1412
   6:     0x55788f0c1a5e - std::sys_common::backtrace::_print::h07f05d3309624875
                               at src/libstd/sys_common/backtrace.rs:65
   7:     0x55788f0c1a5e - std::sys_common::backtrace::print::hb74628deb996392c
                               at src/libstd/sys_common/backtrace.rs:50
   8:     0x55788f0c1a5e - std::panicking::default_hook::{{closure}}::h734c09947ffbd003
                               at src/libstd/panicking.rs:188
   9:     0x55788f0c1761 - std::panicking::default_hook::h908a92137d0058d0
                               at src/libstd/panicking.rs:205
  10:     0x55788f0c2155 - std::panicking::rust_panic_with_hook::h650d4fa2f01dd14f
                               at src/libstd/panicking.rs:468
  11:     0x55788f0c1cf2 - std::panicking::continue_panic_fmt::h5a2e12ad03a05116
                               at src/libstd/panicking.rs:375
  12:     0x55788f0c1be6 - rust_begin_unwind
                               at src/libstd/panicking.rs:302
  13:     0x55788f0dd84a - core::panicking::panic_fmt::h2085bf231b704859
                               at src/libcore/panicking.rs:84
  14:     0x55788f0dd789 - core::panicking::panic::h661d298fb9656deb
                               at src/libcore/panicking.rs:49
  15:     0x55788ed50bb8 - core::option::Option<T>::unwrap::h696c273354b9d247
                               at /rustc/d6e4028a0db6b13d9a603baad109d6c902802c03/src/libcore/macros.rs:12
  16:     0x55788ee4fb4a - wgpu_request_adapter
                               at /home/user/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/wgpu-native-0.4.0/src/instance.rs:474
  17:     0x55788ec33a2e - wgpu::Adapter::request::h27ad7906023de13e
                               at /home/user/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/wgpu-0.4.0/src/lib.rs:545
  18:     0x55788e8a7a49 - iced_wgpu::renderer::Renderer::new::hd64e44c0cfaceb9b
                               at wgpu/src/renderer.rs:52
  19:     0x55788e8a95fd - <iced_wgpu::renderer::Renderer as iced_native::renderer::windowed::Windowed>::new::h1187b1c0a75e7ebf
                               at wgpu/src/renderer.rs:408
  20:     0x55788e2b1ad4 - iced_winit::application::Application::run::h9e52d075590b103d
                               at /opt/user/projects/rust/iced/winit/src/application.rs:45
  21:     0x55788e30524f - iced::Application::run::hc8dd05cc18aeb769
                               at /opt/user/projects/rust/iced/src/lib.rs:19
  22:     0x55788e27902e - tour::main::h631a4a9956d12f72
                               at examples/tour.rs:12
  23:     0x55788e29a320 - std::rt::lang_start::{{closure}}::hde72aaacb5a38ea1
                               at /rustc/d6e4028a0db6b13d9a603baad109d6c902802c03/src/libstd/rt.rs:61
  24:     0x55788f0c1b83 - std::rt::lang_start_internal::{{closure}}::hcf6da9c99990640b
                               at src/libstd/rt.rs:48
  25:     0x55788f0c1b83 - std::panicking::try::do_call::h17432816cf89d4ed
                               at src/libstd/panicking.rs:287
  26:     0x55788f0c5f9a - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80
  27:     0x55788f0c270d - std::panicking::try::h0e688f45fe70b693
                               at src/libstd/panicking.rs:265
  28:     0x55788f0c270d - std::panic::catch_unwind::hbb42d3798dc91a2f
                               at src/libstd/panic.rs:396
  29:     0x55788f0c270d - std::rt::lang_start_internal::h4acffefca599d770
                               at src/libstd/rt.rs:47
  30:     0x55788e29a2f9 - std::rt::lang_start::h14dfe4dc38d8df1b
                               at /rustc/d6e4028a0db6b13d9a603baad109d6c902802c03/src/libstd/rt.rs:61
  31:     0x55788e27f13a - main
  32:     0x7f8b6f1ca153 - __libc_start_main
  33:     0x55788e2691ae - _start
  34:                0x0 - <unknown>
@hecrj hecrj added the bug Something isn't working label Nov 8, 2019
@hecrj hecrj added this to the 0.1.0 milestone Nov 8, 2019
@hecrj
Copy link
Member

hecrj commented Nov 8, 2019

Thanks for the report!

The panic is most likely caused by a lack of compatible graphics adapters. The unhelpful error message is a wgpu issue: gfx-rs/wgpu#368

Could you share more details about your environment? If you are on Linux, ensure you have Vulkan drivers installed (you may also need Vulkan utilities).

@cassc
Copy link
Author

cassc commented Nov 8, 2019

Than you!

I am using Arch Linux. I installed Vulkan following ArchWiki . Now the example runs successfully, but all the texts are displayed as squares.

@cassc
Copy link
Author

cassc commented Nov 8, 2019

After changing this line https://github.com/hecrj/iced/blob/b31a80f2c0ca198f1bf0206618654415d2da460e/wgpu/src/renderer.rs#L68 to some font title I found using fc-list and now text shows correctly.

.load(&[font::Family::Title("方正华隶简体".to_string()), font::Family::Serif])

Thank you!

@cassc cassc closed this as completed Nov 8, 2019
@hecrj
Copy link
Member

hecrj commented Nov 8, 2019

Now the example runs successfully, but all the texts are displayed as squares.

This is a hard problem to solve. It is part of the roadmap (see #33).

The author of skribo did some interesting research that may be useful once we decide to tackle this: https://github.com/linebender/skribo/blob/master/docs/script_matching.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants