emilk / egui

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
https://www.egui.rs/
Apache License 2.0
22.35k stars 1.61k forks source link

libwayland-client segfault introduced in a dep update #2952

Open flukejones opened 1 year ago

flukejones commented 1 year ago

Describe the bug

Some time after d486c76a9f146c12321b2a3fd0cedfe732e5783d an updated dep (winit?) is now causing a segfault. This happens only after I do a close and re-open of the window using run_and_return.

Thread 1 "rog-control-cen" received signal SIGSEGV, Segmentation fault.
0x00007ffff68cc3a9 in wl_list_insert () from /lib64/libwayland-client.so.0
Missing separate debuginfos, use: dnf debuginfo-install at-spi2-atk-2.48.0-1.fc38.x86_64 at-spi2-core-2.48.0-1.fc38.x86_64 atk-2.48.0-1.fc38.x86_64 bzip2-libs-1.0.8-13.fc38.x86_64 cairo-1.17.8-3.fc38.x86_64 cairo-gobject-1.17.8-3.fc38.x86_64 dbus-libs-1.14.6-1.fc38.x86_64 dconf-0.40.0-8.fc38.x86_64 elfutils-libelf-0.189-1.fc38.x86_64 expat-2.5.0-2.fc38.x86_64 fontconfig-2.14.2-1.fc38.x86_64 freetype-2.13.0-2.fc38.x86_64 fribidi-1.0.12-3.fc38.x86_64 gdk-pixbuf2-2.42.10-2.fc38.x86_64 glib2-2.76.1-1.fc38.x86_64 glibc-2.37-1.fc38.x86_64 graphite2-1.3.14-11.fc38.x86_64 gtk3-3.24.37-1.fc38.x86_64 harfbuzz-7.1.0-1.fc38.x86_64 json-glib-1.6.6-4.fc38.x86_64 libX11-1.8.4-1.fc38.x86_64 libX11-xcb-1.8.4-1.fc38.x86_64 libXau-1.0.11-2.fc38.x86_64 libXcomposite-0.4.5-9.fc38.x86_64 libXcursor-1.2.1-3.fc38.x86_64 libXdamage-1.1.5-9.fc38.x86_64 libXext-1.3.5-2.fc38.x86_64 libXfixes-6.0.0-5.fc38.x86_64 libXi-1.8-4.fc38.x86_64 libXinerama-1.1.5-2.fc38.x86_64 libXrender-0.9.11-2.fc38.x86_64 libappindicator-gtk3-12.10.1-1.fc38.x86_64 libblkid-2.38.1-4.fc38.x86_64 libcap-2.48-6.fc38.x86_64 libcloudproviders-0.3.1-7.fc38.x86_64 libdatrie-0.2.13-5.fc38.x86_64 libdbusmenu-16.04.0-21.fc38.x86_64 libdbusmenu-gtk3-16.04.0-21.fc38.x86_64 libdrm-2.4.114-2.fc38.x86_64 libedit-3.1-45.20221030cvs.fc38.x86_64 libepoxy-1.5.10-3.fc38.x86_64 libffi-3.4.4-2.fc38.x86_64 libgcc-13.0.1-0.12.fc38.x86_64 libglvnd-1.6.0-2.fc38.x86_64 libjpeg-turbo-2.1.4-2.fc38.x86_64 libmount-2.38.1-4.fc38.x86_64 libpciaccess-0.16-8.fc38.x86_64 libpng-1.6.37-14.fc38.x86_64 libstdc++-13.0.1-0.12.fc38.x86_64 libthai-0.1.29-4.fc38.x86_64 libtracker-sparql-3.5.0-1.fc38.x86_64 libwayland-client-1.22.0-1.fc38.x86_64 libwayland-cursor-1.22.0-1.fc38.x86_64 libwayland-egl-1.22.0-1.fc38.x86_64 libwayland-server-1.22.0-1.fc38.x86_64 libxcb-1.13.1-11.fc38.x86_64 libxkbcommon-1.5.0-2.fc38.x86_64 libxshmfence-1.3-12.fc38.x86_64 libzstd-1.5.5-1.fc38.x86_64 llvm-libs-16.0.0-2.fc38.x86_64 mesa-libEGL-23.0.2-2.fc38.x86_64 mesa-libgbm-23.0.2-2.fc38.x86_64 pango-1.50.14-1.fc38.x86_64 pixman-0.42.2-1.fc38.x86_64 sqlite-libs-3.40.1-2.fc38.x86_64 xz-libs-5.4.1-1.fc38.x86_64 zlib-1.2.13-3.fc38.x86_64
(gdb) bt
#0  0x00007ffff68cc3a9 in wl_list_insert () at /lib64/libwayland-client.so.0
#1  0x00007ffff68cdb7a in wl_display_read_events () at /lib64/libwayland-client.so.0
#2  0x000055555644ec70 in wayland_client::imp::event_queue::EventQueueInner::read_events (self=0x5555567e1160) at src/native_lib/event_queue.rs:118
#3  wayland_client::event_queue::ReadEventsGuard::read_events (self=...) at src/event_queue.rs:264
#4  0x0000555555e9ba2c in smithay_client_toolkit::event_loop::{impl#1}::process_events::{closure#0}<calloop::sources::{impl#4}::process_events::{closure_env#0}<winit::platform_impl::platform::wayland::event_loop::state::WinitState, smithay_client_toolkit::event_loop::WaylandSource, winit::platform_impl::platform::wayland::event_loop::{impl#1}::new::{closure_env#0}<eframe::native::run::UserEvent>>> () at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/smithay-client-toolkit-0.16.0/src/event_loop.rs:88
#5  calloop::sources::generic::{impl#2}::process_events<i32, std::io::error::Error, smithay_client_toolkit::event_loop::{impl#1}::process_events::{closure_env#0}<calloop::sources::{impl#4}::process_events::{closure_env#0}<winit::platform_impl::platform::wayland::event_loop::state::WinitState, smithay_client_toolkit::event_loop::WaylandSource, winit::platform_impl::platform::wayland::event_loop::{impl#1}::new::{closure_env#0}<eframe::native::run::UserEvent>>>>
    (self=<optimized out>, readiness=..., token=..., callback=...) at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/calloop-0.10.5/src/sources/generic.rs:121
#6  0x0000555555e7a98d in smithay_client_toolkit::event_loop::{impl#1}::process_events<calloop::sources::{impl#4}::process_events::{closure_env#0}<winit::platform_impl::platform::wayland::event_loop::state::WinitState, smithay_client_toolkit::event_loop::WaylandSource, winit::platform_impl::platform::wayland::event_loop::{impl#1}::new::{closure_env#0}<eframe::native::run::UserEvent>>> (self=<optimized out>, callback=..., readiness=..., token=...)
    at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/smithay-client-toolkit-0.16.0/src/event_loop.rs:84
#7  calloop::sources::{impl#4}::process_events<winit::platform_impl::platform::wayland::event_loop::state::WinitState, smithay_client_toolkit::event_loop::WaylandSource, winit::platform_impl::platform::wayland::event_loop::{impl#1}::new::{closure_env#0}<eframe::native::run::UserEvent>> (self=<optimized out>, readiness=..., token=..., data=<optimized out>) at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/calloop-0.10.5/src/sources/mod.rs:305
#8  0x0000555555e78456 in calloop::loop_logic::EventLoop<winit::platform_impl::platform::wayland::event_loop::state::WinitState>::dispatch_events<winit::platform_impl::platform::wayland::event_loop::state::WinitState>
    (self=0x5555567e8ce0, timeout=..., data=0x5555567e8d88) at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/calloop-0.10.5/src/loop_logic.rs:300
#9  0x0000555555e7907c in calloop::loop_logic::EventLoop<winit::platform_impl::platform::wayland::event_loop::state::WinitState>::dispatch<winit::platform_impl::platform::wayland::event_loop::state::WinitState, core::option::Option<core::time::Duration>>
    (self=0x5555567e8ce0, timeout=..., data=0x5555567e8d88) at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/calloop-0.10.5/src/loop_logic.rs:415
#10 0x0000555555e86fad in winit::platform_impl::platform::wayland::event_loop::EventLoop<eframe::native::run::UserEvent>::loop_dispatch<eframe::native::run::UserEvent, core::option::Option<core::time::Duration>> (self=<optimized out>, timeout=...)
    at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.28.3/src/platform_impl/linux/wayland/event_loop/mod.rs:598
#11 winit::platform_impl::platform::wayland::event_loop::EventLoop<eframe::native::run::UserEvent>::run_return<eframe::native::run::UserEvent, eframe::native::run::run_and_return::{closure_env#0}<eframe::native::run::glow_integration::GlowWinitApp>>
    (self=<optimized out>, callback=...) at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.28.3/src/platform_impl/linux/wayland/event_loop/mod.rs:327
#12 0x0000555555ea41de in winit::platform_impl::platform::EventLoop<eframe::native::run::UserEvent>::run_return<eframe::native::run::UserEvent, eframe::native::run::run_and_return::{closure_env#0}<eframe::native::run::glow_integration::GlowWinitApp>>
    (self=0x7ffff5e45b68, callback=...) at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.28.3/src/platform_impl/linux/mod.rs:785
#13 winit::platform::run_return::{impl#0}::run_return<eframe::native::run::UserEvent, eframe::native::run::run_and_return::{closure_env#0}<eframe::native::run::glow_integration::GlowWinitApp>> (self=0x7ffff5e45b68, event_handler=...)
    at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.28.3/src/platform/run_return.rs:51
#14 eframe::native::run::run_and_return<eframe::native::run::glow_integration::GlowWinitApp> (event_loop=0x7ffff5e45b68, winit_app=...) at src/native/run.rs:132
#15 eframe::native::run::glow_integration::run_glow::{closure#0} (event_loop=0x7ffff5e45b68, native_options=<error reading variable: Cannot access memory at address 0x0>) at src/native/run.rs:1038
#16 eframe::native::run::with_event_loop::{closure#0}<core::result::Result<(), eframe::Error>, eframe::native::run::glow_integration::run_glow::{closure_env#0}> (event_loop=<optimized out>) at src/native/run.rs:116
#17 std::thread::local::LocalKey<core::cell::RefCell<core::option::Option<winit::event_loop::EventLoop<eframe::native::run::UserEvent>>>>::try_with<core::cell::RefCell<core::option::Option<winit::event_loop::EventLoop<eframe::native::run::UserEvent>>>, eframe::native::run::with_event_loop::{closure_env#0}<core::result::Result<(), eframe::Error>, eframe::native::run::glow_integration::run_glow::{closure_env#0}>, core::result::Result<(), eframe::Error>> (self=<optimized out>, f=...)
    at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/thread/local.rs:445
#18 std::thread::local::LocalKey<core::cell::RefCell<core::option::Option<winit::event_loop::EventLoop<eframe::native::run::UserEvent>>>>::with<core::cell::RefCell<core::option::Option<winit::event_loop::EventLoop<eframe::native::run::UserEvent>>>, eframe::native::run::with_event_loop::{closure_env#0}<core::result::Result<(), eframe::Error>, eframe::native::run::glow_integration::run_glow::{closure_env#0}>, core::result::Result<(), eframe::Error>> (self=<optimized out>, f=...)
    at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/thread/local.rs:421
#19 0x0000555555ed0134 in eframe::native::run::with_event_loop<core::result::Result<(), eframe::Error>, eframe::native::run::glow_integration::run_glow::{closure_env#0}> (f=..., native_options=<error reading variable: Cannot access memory at address 0x0>)
    at src/native/run.rs:109
#20 eframe::native::run::glow_integration::run_glow (app_name=..., native_options=..., app_creator=...) at src/native/run.rs:1035
#21 0x0000555555ed7fb3 in eframe::run_native (app_name=..., native_options=..., app_creator=...) at src/lib.rs:161
#22 0x0000555555b37287 in rog_control_center::start_app (states=..., native_options=...) at rog-control-center/src/main.rs:254
#23 rog_control_center::main () at rog-control-center/src/main.rs:197
#24 0x0000555555b31b36 in core::ops::function::FnOnce::call_once<fn() -> core::result::Result<(), rog_control_center::error::Error>, ()> () at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/ops/function.rs:248
#25 std::sys_common::backtrace::__rust_begin_short_backtrace<fn() -> core::result::Result<(), rog_control_center::error::Error>, core::result::Result<(), rog_control_center::error::Error>> (f=0x5555570161c0)
    at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:122
#26 0x0000555555b31fd5 in std::rt::lang_start::{closure#0}<core::result::Result<(), rog_control_center::error::Error>> () at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/rt.rs:166
#27 0x000055555657698f in core::ops::function::impls::{impl#2}::call_once<(), (dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe)> () at library/core/src/ops/function.rs:283
#28 std::panicking::try::do_call<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe), i32> () at library/std/src/panicking.rs:492
#29 std::panicking::try<i32, &(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe)> () at library/std/src/panicking.rs:456
#30 std::panic::catch_unwind<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe), i32> () at library/std/src/panic.rs:137
#31 std::rt::lang_start_internal::{closure#2} () at library/std/src/rt.rs:148
#32 std::panicking::try::do_call<std::rt::lang_start_internal::{closure_env#2}, isize> () at library/std/src/panicking.rs:492
#33 std::panicking::try<isize, std::rt::lang_start_internal::{closure_env#2}> () at library/std/src/panicking.rs:456
#34 std::panic::catch_unwind<std::rt::lang_start_internal::{closure_env#2}, isize> () at library/std/src/panic.rs:137
#35 std::rt::lang_start_internal () at library/std/src/rt.rs:148
#36 0x0000555555b38bbf in main ()
#37 0x00007ffff6d2cb4a in __libc_start_call_main () at /lib64/libc.so.6
#38 0x00007ffff6d2cc0b in __libc_start_main_impl () at /lib64/libc.so.6
#39 0x0000555555b2f6f5 in _start ()
(gdb) q
A debugging session is active.

Desktop Operating System: Fedora Linux 38 KDE Plasma Version: 5.27.4 KDE Frameworks Version: 5.105.0 Qt Version: 5.15.9 Kernel Version: 6.3.0-0.rc7.20230420gitcb0856346a60.59.fc38.x86_64 (64-bit) Graphics Platform: Wayland Processors: 20 × 12th Gen Intel® Core™ i9-12900H Memory: 31.0 GiB of RAM Graphics Processor: Mesa Intel® Graphics System Version: 1.0

As I know which commit was good, I should be able to work from there with a git bisect and the serial-windows example.

flukejones commented 1 year ago

Commit b8e798777de519de3a1878798097ab2ab0bd4def is fine (next after the commit mentioned above), but the next commit and onwards cause the issue.

flukejones commented 1 year ago

eframe = { git = "https://github.com/emilk/egui", rev = "b8e798777de519de3a1878798097ab2ab0bd4def", features = ["wayland"]} also causes segfault..

flukejones commented 1 year ago

Yeah happens if "wayland" feature is enabled. Commits after b8e798777de519de3a1878798097ab2ab0bd4def seem to force the issue.

flukejones commented 1 year ago

Additional data from the serial-windows example:

Starting first window…
warning: queue 0x5609444234a0 destroyed while proxies still attached:
  wl_registry@21 still attached
warning: queue 0x7f0b20000cc0 destroyed while proxies still attached:
  zwp_primary_selection_offer_v1@4278190081 still attached
  wl_data_offer@4278190080 still attached
  zwp_primary_selection_device_v1@41 still attached
  zwp_primary_selection_device_manager_v1@24 still attached
  wl_data_device@40 still attached
  wl_data_device_manager@39 still attached
  wl_seat@38 still attached
  wl_registry@36 still attached
Starting second window…
warning: queue 0x560944cba300 destroyed while proxies still attached:
  wl_registry@52 still attached
Segmentation fault (core dumped)

The backtrace is the same:

Thread 1 "serial_windows" received signal SIGSEGV, Segmentation fault.
0x00007ffff7fb83a9 in wl_list_insert () from /lib64/libwayland-client.so
Missing separate debuginfos, use: dnf debuginfo-install elfutils-libelf-0.189-1.fc38.x86_64 expat-2.5.0-2.fc38.x86_64 glibc-2.37-1.fc38.x86_64 libX11-xcb-1.8.4-1.fc38.x86_64 libXau-1.0.11-2.fc38.x86_64 libdrm-2.4.114-2.fc38.x86_64 libedit-3.1-45.20221030cvs.fc38.x86_64 libffi-3.4.4-2.fc38.x86_64 libgcc-13.0.1-0.12.fc38.x86_64 libglvnd-1.6.0-2.fc38.x86_64 libglvnd-egl-1.6.0-2.fc38.x86_64 libpciaccess-0.16-8.fc38.x86_64 libselinux-3.5-1.fc38.x86_64 libstdc++-13.0.1-0.12.fc38.x86_64 libwayland-server-1.22.0-1.fc38.x86_64 libxcb-1.13.1-11.fc38.x86_64 libxkbcommon-1.5.0-2.fc38.x86_64 libxshmfence-1.3-12.fc38.x86_64 libzstd-1.5.5-1.fc38.x86_64 llvm-libs-16.0.0-2.fc38.x86_64 mesa-dri-drivers-23.0.2-2.fc38.x86_64 mesa-libEGL-23.0.2-2.fc38.x86_64 mesa-libgbm-23.0.2-2.fc38.x86_64 mesa-libglapi-23.0.2-2.fc38.x86_64 ncurses-libs-6.4-3.20230114.fc38.x86_64 pcre2-10.42-1.fc38.1.x86_64 wayland-devel-1.22.0-1.fc38.x86_64 zlib-1.2.13-3.fc38.x86_64
(gdb) bt
#0  0x00007ffff7fb83a9 in wl_list_insert () from /lib64/libwayland-client.so
#1  0x00007ffff7fb9b7a in wl_display_read_events () from /lib64/libwayland-client.so
#2  0x0000555556106110 in wayland_client::imp::event_queue::EventQueueInner::read_events (self=0x5555563a75b0) at src/native_lib/event_queue.rs:118
#3  wayland_client::event_queue::ReadEventsGuard::read_events (self=...) at src/event_queue.rs:264
#4  0x0000555555adf0e7 in smithay_client_toolkit::event_loop::{impl#1}::process_events::{closure#0}<calloop::sources::{impl#4}::process_events::{closure_env#0}<winit::platform_impl::platform::wayland::event_loop::state::WinitState, smithay_client_toolkit::event_loop::WaylandSource, winit::platform_impl::platform::wayland::event_loop::{impl#1}::new::{closure_env#0}<eframe::native::run::UserEvent>>> () at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/smithay-client-toolkit-0.16.0/src/event_loop.rs:88
#5  0x0000555555b19dab in calloop::sources::generic::{impl#2}::process_events<i32, std::io::error::Error, smithay_client_toolkit::event_loop::{impl#1}::process_events::{closure_env#0}<calloop::sources::{impl#4}::process_events::{closure_env#0}<winit::platform_impl::platform::wayland::event_loop::state::WinitState, smithay_client_toolkit::event_loop::WaylandSource, winit::platform_impl::platform::wayland::event_loop::{impl#1}::new::{closure_env#0}<eframe::native::run::UserEvent>>>> (self=0x5555563b1368, readiness=..., 
    token=..., callback=...) at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/calloop-0.10.5/src/sources/generic.rs:121
#6  0x0000555555adefe3 in smithay_client_toolkit::event_loop::{impl#1}::process_events<calloop::sources::{impl#4}::process_events::{closure_env#0}<winit::platform_impl::platform::wayland::event_loop::state::WinitState, smithay_client_toolkit::event_loop::WaylandSource, winit::platform_impl::platform::wayland::event_loop::{impl#1}::new::{closure_env#0}<eframe::native::run::UserEvent>>> (self=0x5555563b1348, readiness=..., token=..., callback=...)
    at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/smithay-client-toolkit-0.16.0/src/event_loop.rs:84
#7  0x0000555555ad9dcf in calloop::sources::{impl#4}::process_events<winit::platform_impl::platform::wayland::event_loop::state::WinitState, smithay_client_toolkit::event_loop::WaylandSource, winit::platform_impl::platform::wayland::event_loop::{impl#1}::new::{closure_env#0}<eframe::native::run::UserEvent>> (self=0x5555563b1340, readiness=..., token=..., data=0x5555563b1768) at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/calloop-0.10.5/src/sources/mod.rs:305
#8  0x0000555555c37445 in calloop::loop_logic::EventLoop<winit::platform_impl::platform::wayland::event_loop::state::WinitState>::dispatch_events<winit::platform_impl::platform::wayland::event_loop::state::WinitState> (self=0x5555563b16c0, timeout=..., 
    data=0x5555563b1768) at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/calloop-0.10.5/src/loop_logic.rs:300
#9  0x0000555555c39249 in calloop::loop_logic::EventLoop<winit::platform_impl::platform::wayland::event_loop::state::WinitState>::dispatch<winit::platform_impl::platform::wayland::event_loop::state::WinitState, core::option::Option<core::time::Duration>> (
    self=0x5555563b16c0, timeout=..., data=0x5555563b1768) at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/calloop-0.10.5/src/loop_logic.rs:415
#10 0x0000555555b3e898 in winit::platform_impl::platform::wayland::event_loop::EventLoop<eframe::native::run::UserEvent>::loop_dispatch<eframe::native::run::UserEvent, core::option::Option<core::time::Duration>> (self=0x5555563b16b0, timeout=...)
    at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.28.1/src/platform_impl/linux/wayland/event_loop/mod.rs:597
#11 0x0000555555b37549 in winit::platform_impl::platform::wayland::event_loop::EventLoop<eframe::native::run::UserEvent>::run_return<eframe::native::run::UserEvent, eframe::native::run::run_and_return::{closure_env#0}<eframe::native::run::glow_integration::GlowWinitApp>> (self=0x5555563b16b0, callback=...) at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.28.1/src/platform_impl/linux/wayland/event_loop/mod.rs:326
#12 0x0000555555ace570 in winit::platform_impl::platform::EventLoop<eframe::native::run::UserEvent>::run_return<eframe::native::run::UserEvent, eframe::native::run::run_and_return::{closure_env#0}<eframe::native::run::glow_integration::GlowWinitApp>> (
    self=0x7ffff7cb7be8, callback=...) at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.28.1/src/platform_impl/linux/mod.rs:785
#13 0x0000555555b6da5e in winit::platform::run_return::{impl#0}::run_return<eframe::native::run::UserEvent, eframe::native::run::run_and_return::{closure_env#0}<eframe::native::run::glow_integration::GlowWinitApp>> (self=0x7ffff7cb7be8, event_handler=...)
    at /home/luke/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.28.1/src/platform/run_return.rs:51
#14 0x0000555555ad0879 in eframe::native::run::run_and_return<eframe::native::run::glow_integration::GlowWinitApp> (event_loop=0x7ffff7cb7be8, winit_app=...) at crates/eframe/src/native/run.rs:132
#15 0x0000555555b4aed9 in eframe::native::run::glow_integration::run_glow::{closure#0} (event_loop=0x7ffff7cb7be8, native_options=...) at crates/eframe/src/native/run.rs:1038
#16 0x0000555555ad05e0 in eframe::native::run::with_event_loop::{closure#0}<core::result::Result<(), eframe::Error>, eframe::native::run::glow_integration::run_glow::{closure_env#0}> (event_loop=0x7ffff7cb7be0) at crates/eframe/src/native/run.rs:116
#17 0x0000555555c35253 in std::thread::local::LocalKey<core::cell::RefCell<core::option::Option<winit::event_loop::EventLoop<eframe::native::run::UserEvent>>>>::try_with<core::cell::RefCell<core::option::Option<winit::event_loop::EventLoop<eframe::native::run::UserEvent>>>, eframe::native::run::with_event_loop::{closure_env#0}<core::result::Result<(), eframe::Error>, eframe::native::run::glow_integration::run_glow::{closure_env#0}>, core::result::Result<(), eframe::Error>> (self=0x555556332828, f=...)
    at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/thread/local.rs:445
#18 0x0000555555c34c73 in std::thread::local::LocalKey<core::cell::RefCell<core::option::Option<winit::event_loop::EventLoop<eframe::native::run::UserEvent>>>>::with<core::cell::RefCell<core::option::Option<winit::event_loop::EventLoop<eframe::native::run::UserEvent>>>, eframe::native::run::with_event_loop::{closure_env#0}<core::result::Result<(), eframe::Error>, eframe::native::run::glow_integration::run_glow::{closure_env#0}>, core::result::Result<(), eframe::Error>> (self=0x555556332828, f=...)
    at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/thread/local.rs:421
#19 0x0000555555ad0390 in eframe::native::run::with_event_loop<core::result::Result<(), eframe::Error>, eframe::native::run::glow_integration::run_glow::{closure_env#0}> (native_options=..., f=...) at crates/eframe/src/native/run.rs:109
#20 0x0000555555b83a5e in eframe::native::run::glow_integration::run_glow (app_name=..., native_options=..., app_creator=...) at crates/eframe/src/native/run.rs:1035
#21 0x0000555555bc2845 in eframe::run_native (app_name=..., native_options=..., app_creator=...) at crates/eframe/src/lib.rs:161
#22 0x00005555559f7412 in serial_windows::main () at examples/serial_windows/src/main.rs:28
#23 0x00005555559f6d02 in core::ops::function::FnOnce::call_once<fn() -> core::result::Result<(), eframe::Error>, ()> () at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/ops/function.rs:248
#24 0x00005555559f7e65 in std::sys_common::backtrace::__rust_begin_short_backtrace<fn() -> core::result::Result<(), eframe::Error>, core::result::Result<(), eframe::Error>> (f=0x5555559f6d80 <serial_windows::main>)
    at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:122
#25 0x00005555559f6259 in std::rt::lang_start::{closure#0}<core::result::Result<(), eframe::Error>> () at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/rt.rs:166
#26 0x00005555562ed12f in core::ops::function::impls::{impl#2}::call_once<(), (dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe)> () at library/core/src/ops/function.rs:283
#27 std::panicking::try::do_call<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe), i32> () at library/std/src/panicking.rs:492
#28 std::panicking::try<i32, &(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe)> () at library/std/src/panicking.rs:456
#29 std::panic::catch_unwind<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe), i32> () at library/std/src/panic.rs:137
#30 std::rt::lang_start_internal::{closure#2} () at library/std/src/rt.rs:148
#31 std::panicking::try::do_call<std::rt::lang_start_internal::{closure_env#2}, isize> () at library/std/src/panicking.rs:492
#32 std::panicking::try<isize, std::rt::lang_start_internal::{closure_env#2}> () at library/std/src/panicking.rs:456
#33 std::panic::catch_unwind<std::rt::lang_start_internal::{closure_env#2}, isize> () at library/std/src/panic.rs:137
#34 std::rt::lang_start_internal () at library/std/src/rt.rs:148
#35 0x00005555559f622a in std::rt::lang_start<core::result::Result<(), eframe::Error>> (main=0x5555559f6d80 <serial_windows::main>, argc=1, argv=0x7fffffffd918, sigpipe=2) at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/rt.rs:165
#36 0x00005555559f7851 in main ()
#37 0x00007ffff7ce0b4a in __libc_start_call_main () from /lib64/libc.so.6
#38 0x00007ffff7ce0c0b in __libc_start_main_impl () from /lib64/libc.so.6
#39 0x00005555559f5ba5 in _start ()
snail-with-tea commented 1 year ago

Experiencing similar error when closing any app built with eframe:

warning: queue 0x55600f3b33e0 destroyed while proxies still attached:
  wl_buffer@40 still attached
  wl_buffer@39 still attached
  wl_shm_pool@34 still attached
  xdg_wm_base@27 still attached
  zwp_text_input_manager_v3@15 still attached
  wl_output@14 still attached
  xdg_activation_v1@13 still attached
  wl_subcompositor@12 still attached
  zwp_relative_pointer_manager_v1@11 still attached
  zwp_pointer_constraints_v1@10 still attached
  wl_seat@9 still attached
  wl_shm@8 still attached
  wp_fractional_scale_manager_v1@7 still attached
  wp_viewporter@6 still attached
  zxdg_decoration_manager_v1@5 still attached
  wl_compositor@4 still attached
  wl_registry@2 still attached

Does Arch Linux require some special dependencies to avoid this behavior or is it error in eframe? This was not the case before resent KDE Plasma update so maybe it is i who does something wrong?

margual56 commented 1 year ago

I also experience this issue in Arch Linux with KDE Plasma 5.27 (latest stable).

warning: queue 0x7f0948000ca0 destroyed while proxies still attached:
  zwp_primary_selection_offer_v1@4278190081 still attached
  wl_data_offer@4278190080 still attached
  zwp_primary_selection_device_v1@39 still attached
  zwp_primary_selection_device_manager_v1@22 still attached
  wl_data_device@38 still attached
  wl_data_device_manager@37 still attached
  wl_seat@36 still attached
  wl_registry@34 still attached
warning: queue 0x55bd236d1bc0 destroyed while proxies still attached:
  wl_buffer@42 still attached
  wl_shm_pool@44 still attached
  xdg_wm_base@27 still attached
  zwp_text_input_manager_v3@15 still attached
  wl_output@14 still attached
  xdg_activation_v1@13 still attached
  wl_subcompositor@12 still attached
  zwp_relative_pointer_manager_v1@11 still attached
  zwp_pointer_constraints_v1@10 still attached
  wl_seat@9 still attached
  wl_shm@8 still attached
  wp_fractional_scale_manager_v1@7 still attached
  wp_viewporter@6 still attached
  zxdg_decoration_manager_v1@5 still attached
  wl_compositor@4 still attached
  wl_registry@2 still attached
lyssieth commented 1 year ago

Also experiencing this on Arch with KDE Plasma 5.27.8, KDE Frameworks 5.110.0 and Qt 5.15.11, kernel 6.5.7.

Error logs are much the same. Interesting thing is that the first window doesn't close when close is called.

Starting first window…
Pressed Close button
warning: queue 0x7ff70c000ca0 destroyed while proxies still attached:
  zwp_primary_selection_offer_v1@4278190081 still attached
  wl_data_offer@4278190080 still attached
  zwp_primary_selection_device_v1@40 still attached
  zwp_primary_selection_device_manager_v1@23 still attached
  wl_data_device@39 still attached
  wl_data_device_manager@38 still attached
  wl_seat@37 still attached
  wl_registry@35 still attached
Starting second window…
fish: Job 1, './serial_windows' terminated by signal SIGSEGV (Address boundary error)

backtrace

flukejones commented 1 year ago

SDL2 fixes the same issue with this https://github.com/libsdl-org/SDL/commit/132b88749c284e4d51d93f1e08f5bb0ff9d705dc

PrimmR commented 11 months ago

This also occurs when closing any single viewport in 0.24, meaning closing one viewport will terminate them all.

Experiencing this on Ubuntu 23.10 with GNOME 45.1

emilk commented 11 months ago

Does https://github.com/emilk/egui/pull/3606 help?

PrimmR commented 11 months ago

It doesn't appear to fix the issue for me

LuminaSapphira commented 10 months ago

It does fix the issue for me. Just had to specify eframe = { git = "https://github.com/emilk/egui.git" } in Cargo.toml. Crashing resolved, and "...still attached" lines gone from log.

ncoder-1 commented 9 months ago

I'm getting the same (or similar) issue, also on Arch (hyprland):

Process 97670 launched: '/tmp/test1/target/debug/test1' (x86_64)
[2024-02-01T00:04:18Z DEBUG eframe] Using the glow renderer
[2024-02-01T00:04:18Z DEBUG sctk] Bound new global [49] wl_output v4
[2024-02-01T00:04:18Z DEBUG sctk] Bound new global [48] zxdg_output_manager_v1 v3
[2024-02-01T00:04:18Z DEBUG sctk] Bound new global [14] wl_seat v7
[2024-02-01T00:04:18Z DEBUG sctk] Bound new global [39] wp_cursor_shape_manager_v1 v1
[2024-02-01T00:04:18Z DEBUG sctk] supported wl_shm format Argb8888
[2024-02-01T00:04:18Z DEBUG sctk] supported wl_shm format Xrgb8888
[2024-02-01T00:04:18Z DEBUG sctk] supported wl_shm format Xbgr8888
[2024-02-01T00:04:18Z DEBUG sctk] supported wl_shm format Abgr8888
[2024-02-01T00:04:18Z DEBUG sctk] supported wl_shm format Bgr888
[2024-02-01T00:04:18Z DEBUG sctk] supported wl_shm format Rgbx4444
[2024-02-01T00:04:18Z DEBUG sctk] supported wl_shm format Rgba4444
[2024-02-01T00:04:18Z DEBUG sctk] supported wl_shm format Rgbx5551
[2024-02-01T00:04:18Z DEBUG sctk] supported wl_shm format Rgba5551
[2024-02-01T00:04:18Z DEBUG sctk] supported wl_shm format Rgb565
[2024-02-01T00:04:18Z DEBUG sctk] supported wl_shm format Xbgr16161616f
[2024-02-01T00:04:18Z DEBUG sctk] supported wl_shm format Abgr16161616f
[2024-02-01T00:04:18Z DEBUG sctk] supported wl_shm format Xbgr16161616
[2024-02-01T00:04:18Z DEBUG sctk] supported wl_shm format Abgr16161616
[2024-02-01T00:04:18Z DEBUG eframe::native::glow_integration] Event::Resumed
[2024-02-01T00:04:18Z DEBUG eframe::native::glow_integration] trying to create glutin Display with config: ConfigTemplateBuilder { template: ConfigTemplate { color_buffer_type: Rgb { r_size: 8, g_size: 8, b_size: 8 }, alpha_size: 8, depth_size: 0, stencil_size: 0, num_samples: None, min_swap_interval: None, max_swap_interval: None, config_surface_types: ConfigSurfaceTypes(WINDOW), api: None, transparency: false, single_buffering: false, stereoscopy: None, float_pixels: false, max_pbuffer_width: None, hardware_accelerated: None, max_pbuffer_height: None, native_window: None } }
[2024-02-01T00:04:18Z DEBUG eframe::native::glow_integration] using the first config from config picker closure. config: Egl(Config { inner: Config { raw: EglConfig(0xcaf32c), display: Khr(0x555557053080) } })
[2024-02-01T00:04:18Z DEBUG egui_winit] Failed to set window size
[2024-02-01T00:04:18Z DEBUG eframe::native::glow_integration] successfully created GL Display with version: EGL 1.5 and supported features: DisplayFeatures(CONTEXT_ROBUSTNESS | CONTEXT_NO_ERROR | SWAP_CONTROL | CREATE_ES_CONTEXT | MULTISAMPLING_PIXEL_FORMATS | SRGB_FRAMEBUFFERS)
[2024-02-01T00:04:18Z DEBUG eframe::native::glow_integration] creating gl context using raw window handle: Some(Wayland(WaylandWindowHandle { surface: 0x555557055810 }))
[2024-02-01T00:04:18Z DEBUG eframe::native::glow_integration] Initializing egui_winit for viewport "0000"
[2024-02-01T00:04:18Z DEBUG eframe::native::glow_integration] Creating a gl_surface for viewport "0000"
[2024-02-01T00:04:18Z DEBUG sctk] Bound new global [14] wl_seat v7
[2024-02-01T00:04:18Z DEBUG egui_glow::painter] 
    opengl version: 3.3.0 NVIDIA 545.29.06
    opengl renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
    opengl vendor: NVIDIA Corporation
[2024-02-01T00:04:18Z DEBUG egui_glow::shader_version] Shader version: Gl140 ("3.30 NVIDIA via Cg compiler").
[2024-02-01T00:04:18Z DEBUG egui_glow::painter] Shader header: "#version 140\n".
[2024-02-01T00:04:18Z DEBUG egui_glow::painter] SRGB texture Support: true
[2024-02-01T00:04:18Z DEBUG egui_glow::vao] GL version: "3.3.0 NVIDIA 545.29.06".
[2024-02-01T00:04:19Z DEBUG eframe::native::glow_integration] Received WindowEvent::CloseRequested for viewport Some("0000")
[2024-02-01T00:04:19Z DEBUG eframe::native::epi_integration] Closing root viewport (ViewportCommand::CancelClose was not sent)
[2024-02-01T00:04:19Z DEBUG eframe::native::run] Asking to exit event loop…
[2024-02-01T00:04:19Z DEBUG eframe::native::run] Received Event::LoopExiting - saving app state…
[2024-02-01T00:04:19Z DEBUG eframe::native::run] eframe window closed
Process 97670 stopped
* thread #1, name = 'test1', stop reason = signal SIGSEGV: invalid address (fault address: 0xe4)
    frame #0: 0x00007ffff7fb7415 libwayland-client.so.0`___lldb_unnamed_symbol150 + 69
libwayland-client.so.0`___lldb_unnamed_symbol150:
->  0x7ffff7fb7415 <+69>: movq   %rcx, (%rax,%rbx,8)
    0x7ffff7fb7419 <+73>: xorl   %eax, %eax
    0x7ffff7fb741b <+75>: addq   $0x10, %rsp
    0x7ffff7fb741f <+79>: popq   %rbx

This is also with eframe = { git = "https://github.com/emilk/egui.git" }

margual56 commented 9 months ago

@ncoder-1 I am also on Archlinux wayland and I was also affected by this before, but I can't reproduce it anymore. I'm on eframe version 0.25

Are you sure it's the same issue?

ncoder-1 commented 9 months ago

@margual56 , you're right it looks like it's a different issue. I'll do a few tests on different WM with different GPU and see if I can narrow it down. I'll post a new issue when I have more of an idea of what triggers it.