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

Segmentation Fault in egui_demo_app with "Extra Viewport" #3673

Closed
rednaz1337 opened this issue Dec 1, 2023 · 3 comments
Closed

Segmentation Fault in egui_demo_app with "Extra Viewport" #3673

rednaz1337 opened this issue Dec 1, 2023 · 3 comments
Labels
bug Something is broken native-linux Problem specific to Linux viewports multiple viewports, viewports API

Comments

@rednaz1337
Copy link

Describe the bug
egui_demo_app crashes with SIGSEGV when I close the "Extra Viewport" window

To Reproduce
Steps to reproduce the behavior:

  1. cd egui/crates/egui_demo_app
  2. cargo run
  3. Click on "Extra Viewport" in the sidebar
  4. Close the window by clicking on "X"

Desktop

  • OS: Fedora Workstation 39, KDE Plasma, Wayland session
  • GPU: AMD Radeon RX7600

Additional context
GDB prints the following stack trace


Thread 1 "egui_demo_app" received signal SIGSEGV, Segmentation fault.
0x00007ffff7fb73a9 in wl_list_insert (list=0x10, elm=elm@entry=0x555556e705d0) at ../src/wayland-util.c:48
48              elm->next = list->next;                                                                                                                                                                                                                                                                                                                                                   
(gdb) bt
#0  0x00007ffff7fb73a9 in wl_list_insert (list=0x10, elm=elm@entry=0x555556e705d0) at ../src/wayland-util.c:48
#1  0x00007ffff7fb8b7a in wl_proxy_create_for_id (interface=0x5555563b6618 <wayland_client::protocol::wl_data_offer::wl_data_offer_interface::hb3af3c65dd32e25a>, id=4278190082, factory=0x7fffc4003870) at ../src/wayland-client.c:523
#2  create_proxies (closure=0x555556df6fe0, sender=0x7fffc4003870) at ../src/wayland-client.c:1456
#3  queue_event (len=<optimized out>, display=0x5555563bc7f0) at ../src/wayland-client.c:1556
#4  read_events (display=0x5555563bc7f0) at ../src/wayland-client.c:1670
#5  wl_display_read_events (display=display@entry=0x5555563bc7f0) at ../src/wayland-client.c:1753
#6  0x00007ffff7fb9639 in wl_display_dispatch_queue (queue=<optimized out>, display=<optimized out>) at ../src/wayland-client.c:1992
#7  wl_display_dispatch_queue (display=0x5555563bc7f0, queue=0x555556596b00) at ../src/wayland-client.c:1960
#8  0x00007ffff7b55023 in dri2_wl_swap_buffers_with_damage (disp=<optimized out>, draw=0x5555565ad370, rects=0x0, n_rects=0) at ../src/egl/drivers/dri2/platform_wayland.c:1616
#9  0x00007ffff7b4964a in dri2_swap_buffers (disp=0x555556407160, surf=0x5555565ad370) at ../src/egl/drivers/dri2/egl_dri2.c:1881
#10 0x00007ffff7b3d7c5 in eglSwapBuffers (dpy=<optimized out>, surface=0x5555565ad370) at ../src/egl/main/eglapi.c:1433
#11 0x0000555555a66286 in glutin_egl_sys::egl::Egl::SwapBuffers (self=0x5555563b2018 <glutin::api::egl::EGL::hc6064ce5421851d0+16>, dpy=0x555556407160, surface=0x5555565ad370) at /home/hz/prog/target/debug/build/glutin_egl_sys-21864c54207bbc46/out/egl_bindings.rs:587
#12 glutin::api::egl::surface::{impl#3}::swap_buffers<glutin::surface::WindowSurface> (self=0x5555565b4d08, context=0x55555656d8c0) at /home/hz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/glutin-0.30.10/src/api/egl/surface.rs:358
#13 0x0000555555ab24d8 in glutin::surface::{impl#11}::swap_buffers<glutin::surface::WindowSurface> (self=0x5555565b4d08, context=0x55555656d8b8) at /home/hz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/glutin-0.30.10/src/surface.rs:310
#14 0x0000555555aa80dd in eframe::native::glow_integration::GlowWinitRunning::run_ui_and_paint (self=0x7fffffffb3c8, window_id=...) at crates/eframe/src/native/glow_integration.rs:636
#15 0x0000555555aa6968 in eframe::native::glow_integration::{impl#1}::run_ui_and_paint (self=0x7fffffffb398, window_id=...) at crates/eframe/src/native/glow_integration.rs:395
#16 0x0000555555a9034a in eframe::native::run::run_and_return::{closure#0}<eframe::native::glow_integration::GlowWinitApp> (event=..., event_loop=0x5555563c9f68, control_flow=0x7fffffff9a30) at crates/eframe/src/native/run.rs:94
#17 0x0000555555a9d571 in winit::platform_impl::platform::sticky_exit_callback<eframe::native::winit_integration::UserEvent, eframe::native::run::run_and_return::{closure_env#0}<eframe::native::glow_integration::GlowWinitApp>> (evt=..., target=0x5555563c9f68, control_flow=0x7fffffff9a30, callback=0x7fffffffad98)
    at /home/hz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.7/src/platform_impl/linux/mod.rs:884
#18 0x0000555555a9451a in winit::platform_impl::platform::wayland::event_loop::EventLoop<eframe::native::winit_integration::UserEvent>::run_return<eframe::native::winit_integration::UserEvent, eframe::native::run::run_and_return::{closure_env#0}<eframe::native::glow_integration::GlowWinitApp>> (self=0x5555563c9f50, callback=...)
    at /home/hz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.7/src/platform_impl/linux/wayland/event_loop/mod.rs:549
#19 0x0000555555a9c53c in winit::platform_impl::platform::EventLoop<eframe::native::winit_integration::UserEvent>::run_return<eframe::native::winit_integration::UserEvent, eframe::native::run::run_and_return::{closure_env#0}<eframe::native::glow_integration::GlowWinitApp>> (self=0x7ffff7cb7ca8, callback=...)
    at /home/hz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.7/src/platform_impl/linux/mod.rs:785
#20 0x0000555555ab18ab in winit::platform::run_return::{impl#0}::run_return<eframe::native::winit_integration::UserEvent, eframe::native::run::run_and_return::{closure_env#0}<eframe::native::glow_integration::GlowWinitApp>> (self=0x7ffff7cb7ca8, event_handler=...) at /home/hz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.28.7/src/platform/run_return.rs:51
#21 0x0000555555a8fff1 in eframe::native::run::run_and_return<eframe::native::glow_integration::GlowWinitApp> (event_loop=0x7ffff7cb7ca8, winit_app=...) at crates/eframe/src/native/run.rs:79
#22 0x0000555555a92ab4 in eframe::native::run::run_glow::{closure#0} (event_loop=0x7ffff7cb7ca8, native_options=...) at crates/eframe/src/native/run.rs:372
#23 0x0000555555a8feb7 in eframe::native::run::with_event_loop::{closure#0}<core::result::Result<(), eframe::Error>, eframe::native::run::run_glow::{closure_env#0}> (event_loop=0x7ffff7cb7ca0) at crates/eframe/src/native/run.rs:61
#24 0x0000555555a8ddee in std::thread::local::LocalKey<core::cell::RefCell<core::option::Option<winit::event_loop::EventLoop<eframe::native::winit_integration::UserEvent>>>>::try_with<core::cell::RefCell<core::option::Option<winit::event_loop::EventLoop<eframe::native::winit_integration::UserEvent>>>, eframe::native::run::with_event_loop::{closure_env#0}<core::result::Result<(), eframe::Error>, eframe::native::run::run_glow::{closure_env#0}>, core::result::Result<(), eframe::Error>> (self=0x555556354c40, f=...) at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/thread/local.rs:270
#25 0x0000555555a8d9fd in std::thread::local::LocalKey<core::cell::RefCell<core::option::Option<winit::event_loop::EventLoop<eframe::native::winit_integration::UserEvent>>>>::with<core::cell::RefCell<core::option::Option<winit::event_loop::EventLoop<eframe::native::winit_integration::UserEvent>>>, eframe::native::run::with_event_loop::{closure_env#0}<core::result::Result<(), eframe::Error>, eframe::native::run::run_glow::{closure_env#0}>, core::result::Result<(), eframe::Error>> (self=0x555556354c40, f=<error reading variable: Cannot access memory at address 0x40>) at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/thread/local.rs:246
#26 0x0000555555a8fda6 in eframe::native::run::with_event_loop<core::result::Result<(), eframe::Error>, eframe::native::run::run_glow::{closure_env#0}> (native_options=..., f=...) at crates/eframe/src/native/run.rs:55
#27 0x0000555555aa4015 in eframe::native::run::run_glow (app_name=..., native_options=..., app_creator=...) at crates/eframe/src/native/run.rs:370
#28 0x0000555555a1f84b in eframe::run_native (app_name=..., native_options=..., app_creator=...) at crates/eframe/src/lib.rs:249
#29 0x000055555565d17f in egui_demo_app::main () at crates/egui_demo_app/src/main.rs:46
#30 0x000055555565d562 in core::ops::function::FnOnce::call_once<fn() -> core::result::Result<(), eframe::Error>, ()> () at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/ops/function.rs:250
#31 0x000055555565e6d3 in std::sys_common::backtrace::__rust_begin_short_backtrace<fn() -> core::result::Result<(), eframe::Error>, core::result::Result<(), eframe::Error>> (f=0x55555565cd70 <egui_demo_app::main>) at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:135
#32 0x000055555565d6c6 in std::rt::lang_start::{closure#0}<core::result::Result<(), eframe::Error>> () at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/rt.rs:166
#33 0x0000555555f6ba6b 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:284
#34 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:500
#35 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:464
#36 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:142
#37 std::rt::lang_start_internal::{closure#2} () at library/std/src/rt.rs:148
#38 std::panicking::try::do_call<std::rt::lang_start_internal::{closure_env#2}, isize> () at library/std/src/panicking.rs:500
#39 std::panicking::try<isize, std::rt::lang_start_internal::{closure_env#2}> () at library/std/src/panicking.rs:464
#40 std::panic::catch_unwind<std::rt::lang_start_internal::{closure_env#2}, isize> () at library/std/src/panic.rs:142
#41 std::rt::lang_start_internal () at library/std/src/rt.rs:148
#42 0x000055555565d69a in std::rt::lang_start<core::result::Result<(), eframe::Error>> (main=0x55555565cd70 <egui_demo_app::main>, argc=1, argv=0x7fffffffd418, sigpipe=0) at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/rt.rs:165
#43 0x000055555565d4ee in main ()
#44 0x00007ffff7ce114a in __libc_start_call_main (main=main@entry=0x55555565d4d0 <main>, argc=argc@entry=1, argv=argv@entry=0x7fffffffd418) at ../sysdeps/nptl/libc_start_call_main.h:58
#45 0x00007ffff7ce120b in __libc_start_main_impl (main=0x55555565d4d0 <main>, argc=1, argv=0x7fffffffd418, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd408) at ../csu/libc-start.c:360
#46 0x000055555565c935 in _start ()

@rednaz1337 rednaz1337 added the bug Something is broken label Dec 1, 2023
@YgorSouza
Copy link
Contributor

Looks like #3649 mitigates this a bit. The Extra Viewport still doesn't work well at all (when you try to do something on the main viewport, it freezes until you bring the other one to the foreground again), but at least it doesn't segfault anymore.

@rednaz1337
Copy link
Author

I can confirm that it fixes the issue. In a quick test both viewports seemed to work fine without the main one freezing.

@emilk emilk added viewports multiple viewports, viewports API native-linux Problem specific to Linux labels Dec 4, 2023
@rednaz1337
Copy link
Author

Closed by #3649. The freeze should probably be its own issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken native-linux Problem specific to Linux viewports multiple viewports, viewports API
Projects
None yet
Development

No branches or pull requests

3 participants