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

Panic in minimal Application with default settings #2314

Open
2 tasks done
ibaryshnikov opened this issue Mar 8, 2024 · 4 comments
Open
2 tasks done

Panic in minimal Application with default settings #2314

ibaryshnikov opened this issue Mar 8, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@ibaryshnikov
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

Running the following app crashes

use iced::theme::Theme;
use iced::widget::text;
use iced::{Application, Command, Element, Settings};

struct App {}

#[derive(Debug, Clone)]
enum Message {}

impl Application for App {
    type Executor = iced::executor::Default;
    type Message = Message;
    type Theme = Theme;
    type Flags = ();

    fn new(_flags: ()) -> (App, Command<Message>) {
        (App {}, Command::none())
    }

    fn title(&self) -> String {
        "App".to_owned()
    }

    fn update(&mut self, _message: Message) -> Command<Message> {
        Command::none()
    }

    fn view(&self) -> Element<Message> {
        text("App").into()
    }
}

fn main() -> iced::Result {
    App::run(Settings::default())
}

Setting antialiasing to true fixes the issue

fn main() -> iced::Result {
    App::run(Settings {
        antialiasing: true,
        ..Settings::default()
    })
}

What is the expected behavior?

App runs with default settings

Version

crates.io release

Operating System

Linux

Do you have any log output?

thread 'main' panicked at /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.14/src/platform_impl/linux/x11/window.rs:1208:18:
Failed to call XMapRaised: XError { description: "BadMatch (invalid parameter attributes)", error_code: 8, request_code: 149, minor_code: 4 }

thread 'main' panicked at /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.14/src/platform_impl/linux/x11/window.rs:601:34:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
@ibaryshnikov ibaryshnikov added the bug Something isn't working label Mar 8, 2024
@Harzu
Copy link

Harzu commented Mar 11, 2024

I have the same problem

OS - Kubuntu 23.10
DE - KDE Plasma 5.27.8
Driver - NVIDIA 535
Platform - X11
ICED - 0.12

It could be problem with wgpu or vulkan because when I tried to run my up with WGPU_BACKEND=gl I run my app successfully.

I also tried to run my app on macos (metal) and everything was well

WGPU_BACKEND=vulkan cargo run --release
    Finished release [optimized] target(s) in 0.06s
     Running `/home/kemokempo/projects/main/iced_term/target/release/full_screen`
thread 'main' panicked at /home/kemokempo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/linux/x11/window.rs:1208:18:
Failed to call XMapRaised: XError { description: "BadMatch (invalid parameter attributes)", error_code: 8, request_code: 149, minor_code: 4 }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at /home/kemokempo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/linux/x11/window.rs:601:34:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
stack backtrace:
   0:     0x58247ed2c686 - std::backtrace_rs::backtrace::libunwind::trace::hbee8a7973eeb6c93
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x58247ed2c686 - std::backtrace_rs::backtrace::trace_unsynchronized::hc8ac75eea3aa6899
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x58247ed2c686 - std::sys_common::backtrace::_print_fmt::hc7f3e3b5298b1083
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x58247ed2c686 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbb235daedd7c6190
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x58247ed5a290 - core::fmt::rt::Argument::fmt::h76c38a80d925a410
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/rt.rs:142:9
   5:     0x58247ed5a290 - core::fmt::write::h3ed6aeaa977c8e45
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/mod.rs:1120:17
   6:     0x58247ed28cff - std::io::Write::write_fmt::h78b18af5775fedb5
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/io/mod.rs:1810:15
   7:     0x58247ed2c464 - std::sys_common::backtrace::_print::h5d645a07e0fcfdbb
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x58247ed2c464 - std::sys_common::backtrace::print::h85035a511aafe7a8
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x58247ed2dd47 - std::panicking::default_hook::{{closure}}::hcce8cea212785a25
  10:     0x58247ed2daa9 - std::panicking::default_hook::hf5fcb0f213fe709a
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:292:9
  11:     0x58247ed2e1d8 - std::panicking::rust_panic_with_hook::h095fccf1dc9379ee
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:779:13
  12:     0x58247ed2e0b2 - std::panicking::begin_panic_handler::{{closure}}::h032ba12139b353db
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:657:13
  13:     0x58247ed2cb86 - std::sys_common::backtrace::__rust_end_short_backtrace::h9259bc2ff8fd0f76
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18
  14:     0x58247ed2de10 - rust_begin_unwind
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
  15:     0x58247e532bf5 - core::panicking::panic_fmt::h784f20a50eaab275
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
  16:     0x58247e533143 - core::result::unwrap_failed::h03d8a5018196e1cd
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
  17:     0x58247e6e69b3 - winit::platform_impl::platform::x11::window::UnownedWindow::shared_state_lock::h8485adc425423e0f
  18:     0x58247e73e6e5 - <winit::window::Window as core::ops::drop::Drop>::drop::h55e274a8405df9c1
  19:     0x58247e5d5a64 - alloc::sync::Arc<T,A>::drop_slow::haa59d5c72b87db85
  20:     0x58247e53dbeb - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::h4323aeb2f15ddc8f
  21:     0x58247e59eaa9 - winit::platform_impl::platform::x11::EventLoop<T>::run_on_demand::h9f87d823d1f6098c
  22:     0x58247e53c983 - iced_winit::application::run::h0f3fdd6a699a3e36
  23:     0x58247e593344 - full_screen::main::h1b79200f5b5a65c3
  24:     0x58247e5b78c6 - std::sys_common::backtrace::__rust_begin_short_backtrace::heb6c56eba44ef7fd
  25:     0x58247e5a4d12 - std::rt::lang_start::{{closure}}::h10c4a4cb37f2106b
  26:     0x58247ed22c51 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h37600b1e5eea4ecd
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:284:13
  27:     0x58247ed22c51 - std::panicking::try::do_call::hb4bda49fa13a0c2b
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
  28:     0x58247ed22c51 - std::panicking::try::h8bbf75149211aaaa
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
  29:     0x58247ed22c51 - std::panic::catch_unwind::h8c78ec68ebea34cb
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
  30:     0x58247ed22c51 - std::rt::lang_start_internal::{{closure}}::hffdf44a19fd9e220
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:48
  31:     0x58247ed22c51 - std::panicking::try::do_call::hcb3194972c74716d
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
  32:     0x58247ed22c51 - std::panicking::try::hcdc6892c5f0dba4c
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
  33:     0x58247ed22c51 - std::panic::catch_unwind::h4910beb4573f4776
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
  34:     0x58247ed22c51 - std::rt::lang_start_internal::h6939038e2873596b
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:20
  35:     0x58247e594365 - main
  36:     0x7affecc28150 - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  37:     0x7affecc28209 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:360:3
  38:     0x58247e5336e5 - _start
  39:                0x0 - <unknown>
thread 'main' panicked at library/core/src/panicking.rs:163:5:
panic in a destructor during cleanup
thread caused non-unwinding panic. aborting.
[1]    39911 IOT instruction (core dumped)  WGPU_BACKEND=vulkan cargo run --release

I thought that problem with vulkan driver but after re-installation by the next guide result was the same

@Harzu
Copy link

Harzu commented Mar 12, 2024

Today, I tested this bug in the GNOME DE using an Intel integrated GPU/Nvidia GPU (4070) on both Wayland and X11 platforms, and everything worked well. Therefore, I suspected that the problem might be with the Vulkan settings

I experimented with some settings, and the following environment variables fixed the problem.

VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json VK_LAYER_PATH=/usr/share/vulkan/explicit_layer.d cargo run --release

@CarsonBurke
Copy link

Today, I tested this bug in the GNOME DE using an Intel integrated GPU on both Wayland and X11 platforms, and everything worked well. Therefore, I suspected that the problem might be with the Vulkan settings

I experimented with some settings, and the following environment variables fixed the problem.

VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json VK_LAYER_PATH=/usr/share/vulkan/explicit_layer.d cargo run --release

Assuming I'm an idiot... what file what i put this in?

@Harzu
Copy link

Harzu commented Apr 27, 2024

Today, I tested this bug in the GNOME DE using an Intel integrated GPU on both Wayland and X11 platforms, and everything worked well. Therefore, I suspected that the problem might be with the Vulkan settings
I experimented with some settings, and the following environment variables fixed the problem.

VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json VK_LAYER_PATH=/usr/share/vulkan/explicit_layer.d cargo run --release

Assuming I'm an idiot... what file what i put this in?

These are just environment variables you can put them to bash script or Makefile and you can also put them to .profile/.bashrc/.zshrc or other session profile files but you need to understand that adding to profile files could affect something else.

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

3 participants