iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
23.39k stars 1.07k forks source link

Crash on Wayland when calling iced::exit() #2482

Open shartrec opened 1 week ago

shartrec commented 1 week ago

Is your issue REALLY a bug?

Is there an existing issue for this?

Is this issue related to iced?

What happened?

On Wayland.

Following the multi-window example, after updating my app to version = "0.13.0-dev". I get

SIGSEGV (signal SIGSEGV: address not mapped to object (fault address: 0x14c))

after calling iced:exit()

I tried on xorg and don't get this error

What is the expected behavior?

Should not get SIGSEV.

Version

master

Operating System

Linux

Do you have any log output?

wl_map_insert_at 0x00007feef1defd2c
proxy_destroy 0x00007feef1defe85
wl_proxy_destroy 0x00007feef1deffaf
wayland_backend::sys::client_impl::InnerBackend::send_request mod.rs:758
wayland_backend::sys::client::Backend::send_request client_api.rs:234
wayland_client::conn::Connection::send_request conn.rs:201
wayland_protocols::wp::primary_selection::zv1::generated::client::zwp_primary_selection_device_manager_v1::ZwpPrimarySelectionDeviceManagerV1::destroy protocol_macro.rs:28
<smithay_client_toolkit::primary_selection::PrimarySelectionManagerState as core::ops::drop::Drop>::drop mod.rs:80
core::ptr::drop_in_place<smithay_client_toolkit::primary_selection::PrimarySelectionManagerState> mod.rs:515
core::ptr::drop_in_place<core::option::Option<smithay_client_toolkit::primary_selection::PrimarySelectionManagerState>> mod.rs:515
core::ptr::drop_in_place<smithay_clipboard::state::State> mod.rs:515
smithay_clipboard::worker::worker_impl worker.rs:102
smithay_clipboard::worker::spawn::{{closure}} worker.rs:23
std::sys_common::backtrace::__rust_begin_short_backtrace backtrace.rs:155
std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}} mod.rs:528
<core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once unwind_safe.rs:272
std::panicking::try::do_call panicking.rs:552
__rust_try 0x0000560a18de5feb
std::panicking::try panicking.rs:516
[Inlined] std::panic::catch_unwind panic.rs:146
std::thread::Builder::spawn_unchecked_::{{closure}} mod.rs:527
core::ops::function::FnOnce::call_once{{vtable.shim}} function.rs:250
[Inlined] <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once boxed.rs:2020
[Inlined] <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once boxed.rs:2020
std::sys::pal::unix::thread::Thread::new::thread_start thread.rs:108
start_thread 0x00007feef1b6e1b7
__clone3 0x00007feef1bf03cc
vladh commented 1 week ago

Can reproduce. Seems related to smithay-clipboard, in particular state.rs and client-toolkit/blob/master/src/primary_selection/mod.rs#L78.

shartrec commented 3 days ago

Looks like a known problem or at least related to. https://github.com/Smithay/smithay-clipboard/issues/52