Closed baloo closed 3 years ago
Could be a duplicate of #970
@baloo can you try reproducing this with waybar compiled with address sanitizer (meson build --buildtype debug -Db_lundef=false -Db_sanitize=address
)?
I'm guessing that the monitor refptr is gone by the moment we started constructing the bar instance. Something like flaky DP connection or kanshi
configured to disable one of the monitors could be the cause. If that's the case, waybar -l debug
log should contain Output removed: <...>
message right before the crash.
I dont use kanshi, I only use a static output configuration in my sway config. I recompiled waybar with asan, now I need to find a way to collect its output. It's currently started by sway itself. I dont have a proper reproducible test-case. I only triggered it twice in 48h.
now I need to find a way to collect its output. It's currently started by sway itself.
If you are already redirecting sway output to a log file, waybar logs should be included there.
Another option is to point swaybar_command
to a wrapper script with contents like exec waybar -l debug "$@" >~/waybar.log 2>&1
.
Got it to work handled by systemd user daemon. This way it's integrated with journalctl etc ...
I get an immediate crash:
Feb 05 23:50:00 vic waybar-start[467]: ==467==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x6080000537a0 in thread T0:
Feb 05 23:50:00 vic waybar-start[467]: object passed to delete has wrong type:
Feb 05 23:50:00 vic waybar-start[467]: size of the allocated type: 88 bytes;
Feb 05 23:50:00 vic waybar-start[467]: size of the deallocated type: 48 bytes.
Feb 05 23:50:00 vic waybar-start[467]: #0 0x7f028a99a467 in operator delete(void*, unsigned long) (/nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6+0xaf467)
Feb 05 23:50:00 vic waybar-start[467]: #1 0x7f0289f82030 in Glib::DispatchNotifier::DispatchNotifier(Glib::RefPtr<Glib::MainContext> const&) (/nix/store/pjkg6n0nrgg4m9xibwszp95ckfhi29as-glibmm-2.64.2/lib/libglibmm-2.4.so.1+0x62030)
Feb 05 23:50:00 vic waybar-start[467]: #2 0x7f0289f82267 in Glib::DispatchNotifier::reference_instance(Glib::RefPtr<Glib::MainContext> const&, Glib::Dispatcher const*) (/nix/store/pjkg6n0nrgg4m9xibwszp95ckfhi29as-glibmm-2.64.2/lib/libglibmm-2.4.so.1+0x62267)
Feb 05 23:50:00 vic waybar-start[467]: #3 0x7f0289f825e4 in Glib::Dispatcher::Dispatcher() (/nix/store/pjkg6n0nrgg4m9xibwszp95ckfhi29as-glibmm-2.64.2/lib/libglibmm-2.4.so.1+0x625e4)
Feb 05 23:50:00 vic waybar-start[467]: #4 0x440662 in waybar::AModule::AModule(Json::Value const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool) (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x440662)
Feb 05 23:50:00 vic waybar-start[467]: #5 0x58063d in waybar::modules::sway::Workspaces::Workspaces(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, waybar::Bar const&, Json::Value const&) (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x58063d)
Feb 05 23:50:00 vic waybar-start[467]: #6 0x43cc3d in waybar::Factory::makeModule(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x43cc3d)
Feb 05 23:50:00 vic waybar-start[467]: #7 0x4b841f in waybar::Bar::getModules(waybar::Factory const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x4b841f)
Feb 05 23:50:00 vic waybar-start[467]: #8 0x4b87f8 in waybar::Bar::setupWidgets() (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x4b87f8)
Feb 05 23:50:00 vic waybar-start[467]: #9 0x4baf95 in waybar::Bar::Bar(waybar::waybar_output*, Json::Value const&) (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x4baf95)
Feb 05 23:50:00 vic waybar-start[467]: #10 0x4d8679 in waybar::Client::handleOutputName(void*, zxdg_output_v1*, char const*) (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x4d8679)
Feb 05 23:50:00 vic waybar-start[467]: #11 0x7f0288c6bb2c in ffi_call_unix64 (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x7b2c)
Feb 05 23:50:00 vic waybar-start[467]: #12 0x7f0288c6a83b in ffi_call_int (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x683b)
Feb 05 23:50:00 vic waybar-start[467]: #13 0x7f028a8e32e1 in wl_closure_invoke (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0xa2e1)
Feb 05 23:50:00 vic waybar-start[467]: #14 0x7f028a8df979 in dispatch_event.isra.0 (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x6979)
Feb 05 23:50:00 vic waybar-start[467]: #15 0x7f028a8e104b in wl_display_dispatch_queue_pending (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x804b)
Feb 05 23:50:00 vic waybar-start[467]: #16 0x7f028a8e152e in wl_display_roundtrip_queue (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x852e)
Feb 05 23:50:00 vic waybar-start[467]: #17 0x4d830d in waybar::Client::handleOutputName(void*, zxdg_output_v1*, char const*) (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x4d830d)
Feb 05 23:50:00 vic waybar-start[467]: #18 0x7f0288c6bb2c in ffi_call_unix64 (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x7b2c)
Feb 05 23:50:00 vic waybar-start[467]: #19 0x7f0288c6a83b in ffi_call_int (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x683b)
Feb 05 23:50:00 vic waybar-start[467]: #20 0x7f028a8e32e1 in wl_closure_invoke (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0xa2e1)
Feb 05 23:50:00 vic waybar-start[467]: #21 0x7f028a8df979 in dispatch_event.isra.0 (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x6979)
Feb 05 23:50:00 vic waybar-start[467]: #22 0x7f028a8e104b in wl_display_dispatch_queue_pending (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x804b)
Feb 05 23:50:00 vic waybar-start[467]: #23 0x7f028a8e152e in wl_display_roundtrip_queue (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x852e)
Feb 05 23:50:00 vic waybar-start[467]: #24 0x4d830d in waybar::Client::handleOutputName(void*, zxdg_output_v1*, char const*) (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x4d830d)
Feb 05 23:50:00 vic waybar-start[467]: #25 0x7f0288c6bb2c in ffi_call_unix64 (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x7b2c)
Feb 05 23:50:00 vic waybar-start[467]: #26 0x7f0288c6a83b in ffi_call_int (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x683b)
Feb 05 23:50:00 vic waybar-start[467]: #27 0x7f028a8e32e1 in wl_closure_invoke (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0xa2e1)
Feb 05 23:50:00 vic waybar-start[467]: #28 0x7f028a8df979 in dispatch_event.isra.0 (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x6979)
Feb 05 23:50:00 vic waybar-start[467]: #29 0x7f028a8e104b in wl_display_dispatch_queue_pending (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x804b)
Feb 05 23:50:00 vic waybar-start[467]: #30 0x7f028a8e152e in wl_display_roundtrip_queue (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x852e)
Feb 05 23:50:00 vic waybar-start[467]: #31 0x4d830d in waybar::Client::handleOutputName(void*, zxdg_output_v1*, char const*) (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x4d830d)
Feb 05 23:50:00 vic waybar-start[467]: #32 0x7f0288c6bb2c in ffi_call_unix64 (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x7b2c)
Feb 05 23:50:00 vic waybar-start[467]: #33 0x7f0288c6a83b in ffi_call_int (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x683b)
Feb 05 23:50:00 vic waybar-start[467]: #34 0x7f028a8e32e1 in wl_closure_invoke (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0xa2e1)
Feb 05 23:50:00 vic waybar-start[467]: #35 0x7f028a8df979 in dispatch_event.isra.0 (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x6979)
Feb 05 23:50:00 vic waybar-start[467]: #36 0x7f028a8e104b in wl_display_dispatch_queue_pending (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x804b)
Feb 05 23:50:00 vic waybar-start[467]: #37 0x7f028a8e152e in wl_display_roundtrip_queue (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x852e)
Feb 05 23:50:00 vic waybar-start[467]: #38 0x4d830d in waybar::Client::handleOutputName(void*, zxdg_output_v1*, char const*) (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x4d830d)
Feb 05 23:50:00 vic waybar-start[467]: #39 0x7f0288c6bb2c in ffi_call_unix64 (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x7b2c)
Feb 05 23:50:00 vic waybar-start[467]: #40 0x7f0288c6a83b in ffi_call_int (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x683b)
Feb 05 23:50:00 vic waybar-start[467]: #41 0x7f028a8e32e1 in wl_closure_invoke (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0xa2e1)
Feb 05 23:50:00 vic waybar-start[467]: #42 0x7f028a8df979 in dispatch_event.isra.0 (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x6979)
Feb 05 23:50:00 vic waybar-start[467]: #43 0x7f028a8e104b in wl_display_dispatch_queue_pending (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x804b)
Feb 05 23:50:00 vic waybar-start[467]: #44 0x7f028a8e152e in wl_display_roundtrip_queue (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x852e)
Feb 05 23:50:00 vic waybar-start[467]: #45 0x4d830d in waybar::Client::handleOutputName(void*, zxdg_output_v1*, char const*) (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x4d830d)
Feb 05 23:50:00 vic waybar-start[467]: #46 0x7f0288c6bb2c in ffi_call_unix64 (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x7b2c)
Feb 05 23:50:00 vic waybar-start[467]: #47 0x7f0288c6a83b in ffi_call_int (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x683b)
Feb 05 23:50:00 vic waybar-start[467]: #48 0x7f028a8e32e1 in wl_closure_invoke (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0xa2e1)
Feb 05 23:50:00 vic waybar-start[467]: #49 0x7f028a8df979 in dispatch_event.isra.0 (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x6979)
Feb 05 23:50:00 vic waybar-start[467]: #50 0x7f028a8e104b in wl_display_dispatch_queue_pending (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x804b)
Feb 05 23:50:00 vic waybar-start[467]: #51 0x7f02896c8983 in _gdk_wayland_display_queue_events (/nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0+0x71983)
Feb 05 23:50:00 vic waybar-start[467]: #52 0x7f02896906ff in gdk_display_get_event (/nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0+0x396ff)
Feb 05 23:50:00 vic waybar-start[467]: #53 0x7f02896c8681 in gdk_event_source_dispatch (/nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0+0x71681)
Feb 05 23:50:00 vic waybar-start[467]: #54 0x7f028934aa9a in g_main_context_dispatch (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0+0x54a9a)
Feb 05 23:50:00 vic waybar-start[467]: #55 0x7f028934ad47 in g_main_context_iterate.constprop.0 (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0+0x54d47)
Feb 05 23:50:00 vic waybar-start[467]: #56 0x7f028934adfe in g_main_context_iteration (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0+0x54dfe)
Feb 05 23:50:00 vic waybar-start[467]: #57 0x7f028955eda4 in g_application_run (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libgio-2.0.so.0+0xdbda4)
Feb 05 23:50:00 vic waybar-start[467]: #58 0x439d0d in waybar::Client::main(int, char**) (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x439d0d)
Feb 05 23:50:00 vic waybar-start[467]: #59 0x4374b2 in main (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x4374b2)
Feb 05 23:50:00 vic waybar-start[467]: #60 0x7f0288caadec in __libc_start_main (/nix/store/gafigwfaimlziam6qhw1m8dz4h952g1n-glibc-2.32-35/lib/libc.so.6+0x27dec)
Feb 05 23:50:00 vic waybar-start[467]: #61 0x43c139 in _start (/nix/store/gjcp0px3bz4y8jrcsifmkxhf0rjzdgyl-waybar-0.9.5/bin/.waybar-wrapped+0x43c139)
Feb 05 23:50:00 vic waybar-start[467]: 0x6080000537a0 is located 0 bytes inside of 88-byte region [0x6080000537a0,0x6080000537f8)
Feb 05 23:50:00 vic waybar-start[467]: allocated by thread T0 here:
Feb 05 23:50:00 vic waybar-start[467]: #0 0x7f028a999647 in operator new(unsigned long) (/nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6+0xae647)
Feb 05 23:50:00 vic waybar-start[467]: #1 0x7f0289f81f7e in Glib::DispatchNotifier::DispatchNotifier(Glib::RefPtr<Glib::MainContext> const&) (/nix/store/pjkg6n0nrgg4m9xibwszp95ckfhi29as-glibmm-2.64.2/lib/libglibmm-2.4.so.1+0x61f7e)
Feb 05 23:50:00 vic waybar-start[467]: SUMMARY: AddressSanitizer: new-delete-type-mismatch (/nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6+0xaf467) in operator delete(void*, unsigned long)
Feb 05 23:50:00 vic waybar-start[467]: ==467==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
Feb 05 23:50:00 vic waybar-start[467]: ==467==ABORTING
It starts okay with ASAN_OPTIONS=new_delete_type_mismatch=0
(as the error suggests) though.
Now it's started, I'll update here should I get it to crash again.
Got it to crash this morning:
Feb 06 17:36:37 vic waybar-start[29285]: =================================================================
Feb 06 17:36:37 vic waybar-start[29285]: ==29285==ERROR: AddressSanitizer: heap-use-after-free on address 0x60b0008de528 at pc 0x7ff55ae5c983 bp 0x7ffc99693f00 sp 0x7ffc996936b0
Feb 06 17:36:37 vic waybar-start[29285]: READ of size 8 at 0x60b0008de528 thread T0
Feb 06 17:36:37 vic waybar-start[29285]: #0 0x7ff55ae5c982 in __interceptor_memcpy (/nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6+0x3c982)
Feb 06 17:36:37 vic waybar-start[29285]: #1 0x7ff55a4c20c5 in Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (/nix/store/pjkg6n0nrgg4m9xibwszp95ckfhi29as-glibmm-2.64.2/lib/libglibmm-2.4.so.1+0x6d0c5)
Feb 06 17:36:37 vic waybar-start[29285]: #2 0x48224e in waybar::Bar::Bar(waybar::waybar_output*, Json::Value const&) (/nix/store/vjs404bn9bfczvvwrc9pmmla4g7crlv8-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x48224e)
Feb 06 17:36:37 vic waybar-start[29285]: #3 0x4a1939 in waybar::Client::handleOutputDone(void*, zxdg_output_v1*) (/nix/store/vjs404bn9bfczvvwrc9pmmla4g7crlv8-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x4a1939)
Feb 06 17:36:37 vic waybar-start[29285]: #4 0x7ff5591a0b2c in ffi_call_unix64 (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x7b2c)
Feb 06 17:36:37 vic waybar-start[29285]: #5 0x7ff55919f83b in ffi_call_int (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x683b)
Feb 06 17:36:37 vic waybar-start[29285]: #6 0x7ff55ae182e1 in wl_closure_invoke (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0xa2e1)
Feb 06 17:36:37 vic waybar-start[29285]: #7 0x7ff55ae14979 in dispatch_event.isra.0 (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x6979)
Feb 06 17:36:37 vic waybar-start[29285]: #8 0x7ff55ae1604b in wl_display_dispatch_queue_pending (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x804b)
Feb 06 17:36:37 vic waybar-start[29285]: #9 0x7ff559bfd983 in _gdk_wayland_display_queue_events (/nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0+0x71983)
Feb 06 17:36:37 vic waybar-start[29285]: #10 0x7ff559bc56ff in gdk_display_get_event (/nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0+0x396ff)
Feb 06 17:36:37 vic waybar-start[29285]: #11 0x7ff559bfd681 in gdk_event_source_dispatch (/nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0+0x71681)
Feb 06 17:36:37 vic waybar-start[29285]: #12 0x7ff55987fa9a in g_main_context_dispatch (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0+0x54a9a)
Feb 06 17:36:37 vic waybar-start[29285]: #13 0x7ff55987fd47 in g_main_context_iterate.constprop.0 (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0+0x54d47)
Feb 06 17:36:37 vic waybar-start[29285]: #14 0x7ff55987fdfe in g_main_context_iteration (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0+0x54dfe)
Feb 06 17:36:37 vic waybar-start[29285]: #15 0x7ff559a93da4 in g_application_run (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libgio-2.0.so.0+0xdbda4)
Feb 06 17:36:37 vic waybar-start[29285]: #16 0x43aa26 in waybar::Client::main(int, char**) (/nix/store/vjs404bn9bfczvvwrc9pmmla4g7crlv8-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x43aa26)
Feb 06 17:36:37 vic waybar-start[29285]: #17 0x4381b2 in main (/nix/store/vjs404bn9bfczvvwrc9pmmla4g7crlv8-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x4381b2)
Feb 06 17:36:37 vic waybar-start[29285]: #18 0x7ff5591dfdec in __libc_start_main (/nix/store/gafigwfaimlziam6qhw1m8dz4h952g1n-glibc-2.32-35/lib/libc.so.6+0x27dec)
Feb 06 17:36:37 vic waybar-start[29285]: #19 0x43cd79 in _start (/nix/store/vjs404bn9bfczvvwrc9pmmla4g7crlv8-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x43cd79)
Feb 06 17:36:37 vic waybar-start[29285]: 0x60b0008de528 is located 40 bytes inside of 104-byte region [0x60b0008de500,0x60b0008de568)
Feb 06 17:36:37 vic waybar-start[29285]: freed by thread T0 here:
Feb 06 17:36:37 vic waybar-start[29285]: #0 0x7ff55aecf467 in operator delete(void*, unsigned long) (/nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6+0xaf467)
Feb 06 17:36:37 vic waybar-start[29285]: #1 0x4a0575 in waybar::Client::handleMonitorRemoved(Glib::RefPtr<Gdk::Monitor>) (/nix/store/vjs404bn9bfczvvwrc9pmmla4g7crlv8-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x4a0575)
Feb 06 17:36:37 vic waybar-start[29285]: #2 0x4af9d6 in sigc::internal::slot_call1<sigc::bound_mem_functor1<void, waybar::Client, Glib::RefPtr<Gdk::Monitor> >, void, Glib::RefPtr<Gdk::Monitor> const&>::call_it(sigc::internal::slot_rep*, Glib::RefPtr<Gdk::Monitor> const&) (/nix/store/vjs404bn9bfczvvwrc9pmmla4g7crlv8-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x4af9d6)
Feb 06 17:36:37 vic waybar-start[29285]: #3 0x7ff55a71f6c4 in (anonymous namespace)::Display_signal_monitor_added_callback(_GdkDisplay*, _GdkMonitor*, void*) (/nix/store/l849cv8w6xi83jfd21vkmc222qkfy6lb-gtkmm-3.24.2/lib/libgdkmm-3.0.so.1+0x396c4)
Feb 06 17:36:37 vic waybar-start[29285]: previously allocated by thread T0 here:
Feb 06 17:36:37 vic waybar-start[29285]: #0 0x7ff55aece647 in operator new(unsigned long) (/nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6+0xae647)
Feb 06 17:36:37 vic waybar-start[29285]: #1 0x499fdf in waybar::Client::handleMonitorAdded(Glib::RefPtr<Gdk::Monitor>) (/nix/store/vjs404bn9bfczvvwrc9pmmla4g7crlv8-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x499fdf)
Feb 06 17:36:37 vic waybar-start[29285]: #2 0x4af9d6 in sigc::internal::slot_call1<sigc::bound_mem_functor1<void, waybar::Client, Glib::RefPtr<Gdk::Monitor> >, void, Glib::RefPtr<Gdk::Monitor> const&>::call_it(sigc::internal::slot_rep*, Glib::RefPtr<Gdk::Monitor> const&) (/nix/store/vjs404bn9bfczvvwrc9pmmla4g7crlv8-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x4af9d6)
Feb 06 17:36:37 vic waybar-start[29285]: #3 0x7ff55a71f6c4 in (anonymous namespace)::Display_signal_monitor_added_callback(_GdkDisplay*, _GdkMonitor*, void*) (/nix/store/l849cv8w6xi83jfd21vkmc222qkfy6lb-gtkmm-3.24.2/lib/libgdkmm-3.0.so.1+0x396c4)
Feb 06 17:36:37 vic waybar-start[29285]: SUMMARY: AddressSanitizer: heap-use-after-free (/nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6+0x3c982) in __interceptor_memcpy
Feb 06 17:36:37 vic waybar-start[29285]: Shadow bytes around the buggy address:
Feb 06 17:36:37 vic waybar-start[29285]: 0x0c1680113c50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Feb 06 17:36:37 vic waybar-start[29285]: 0x0c1680113c60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Feb 06 17:36:37 vic waybar-start[29285]: 0x0c1680113c70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Feb 06 17:36:37 vic waybar-start[29285]: 0x0c1680113c80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Feb 06 17:36:37 vic waybar-start[29285]: 0x0c1680113c90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Feb 06 17:36:37 vic waybar-start[29285]: =>0x0c1680113ca0: fd fd fd fd fd[fd]fd fd fd fd fd fd fd fa fa fa
Feb 06 17:36:37 vic waybar-start[29285]: 0x0c1680113cb0: fa fa fa fa fa fa fd fd fd fd fd fd fd fd fd fd
Feb 06 17:36:37 vic waybar-start[29285]: 0x0c1680113cc0: fd fd fd fd fa fa fa fa fa fa fa fa fd fd fd fd
Feb 06 17:36:37 vic waybar-start[29285]: 0x0c1680113cd0: fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa
Feb 06 17:36:37 vic waybar-start[29285]: 0x0c1680113ce0: fa fa fd fd fd fd fd fd fd fd fd fd fd fd fd fa
Feb 06 17:36:37 vic waybar-start[29285]: 0x0c1680113cf0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
Feb 06 17:36:37 vic waybar-start[29285]: Shadow byte legend (one shadow byte represents 8 application bytes):
Feb 06 17:36:37 vic waybar-start[29285]: Addressable: 00
Feb 06 17:36:37 vic waybar-start[29285]: Partially addressable: 01 02 03 04 05 06 07
Feb 06 17:36:37 vic waybar-start[29285]: Heap left redzone: fa
Feb 06 17:36:37 vic waybar-start[29285]: Freed heap region: fd
Feb 06 17:36:37 vic waybar-start[29285]: Stack left redzone: f1
Feb 06 17:36:37 vic waybar-start[29285]: Stack mid redzone: f2
Feb 06 17:36:37 vic waybar-start[29285]: Stack right redzone: f3
Feb 06 17:36:37 vic waybar-start[29285]: Stack after return: f5
Feb 06 17:36:37 vic waybar-start[29285]: Stack use after scope: f8
Feb 06 17:36:37 vic waybar-start[29285]: Global redzone: f9
Feb 06 17:36:37 vic waybar-start[29285]: Global init order: f6
Feb 06 17:36:37 vic waybar-start[29285]: Poisoned by user: f7
Feb 06 17:36:37 vic waybar-start[29285]: Container overflow: fc
Feb 06 17:36:37 vic waybar-start[29285]: Array cookie: ac
Feb 06 17:36:37 vic waybar-start[29285]: Intra object redzone: bb
Feb 06 17:36:37 vic waybar-start[29285]: ASan internal: fe
Feb 06 17:36:37 vic waybar-start[29285]: Left alloca redzone: ca
Feb 06 17:36:37 vic waybar-start[29285]: Right alloca redzone: cb
Feb 06 17:36:37 vic waybar-start[29285]: Shadow gap: cc
Feb 06 17:36:37 vic waybar-start[29285]: ==29285==ABORTING
But I dont have any coredump anymore. Looks like asan prevents it.
This is waybar from master (commit 71f9ed3).
Thanks, that's just about what I expected to see.
Apparently wl_display_roundtrip
here has picked the output removal event and run appropriate Gdk callbacks, so onсe we got out of the call output
was no longer a valid reference. I don't believe this line holds any value and it should be safe to remove it. You can do that in your local copy (and maybe check that it doesn't start crashing in a different location :smile:).
https://github.com/Alexays/Waybar/blob/71f9ed3099e515786dd6a8e496a68e5fc307d43a/src/client.cpp#L126-L129
I already have some unfinished changes to the output code so I'll just add a fix for this before publishing pull-request.
So
diff --git a/src/client.cpp b/src/client.cpp
index 0ad4e6b..9983bb5 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -124,7 +124,6 @@ void waybar::Client::handleOutputDone(void *data, struct zxdg_output_v1 * /*xdg_
auto configs = client->getOutputConfigs(output);
if (!configs.empty()) {
- wl_display_roundtrip(client->wl_display);
for (const auto &config : configs) {
client->bars.emplace_back(std::make_unique<Bar>(&output, config));
}
Correct?
Nope:
Feb 08 18:25:36 vic waybar-start[9434]: =================================================================
Feb 08 18:25:36 vic waybar-start[9434]: ==9434==ERROR: AddressSanitizer: heap-use-after-free on address 0x60b0000f0cb0 at pc 0x0000004a1c35 bp 0x7ffd9a49ebd0 sp 0x7ffd9a49ebc8
Feb 08 18:25:36 vic waybar-start[9434]: READ of size 8 at 0x60b0000f0cb0 thread T0
Feb 08 18:25:37 vic waybar-start[9434]: #0 0x4a1c34 in waybar::Client::handleOutputDone(void*, zxdg_output_v1*) (/nix/store/draqbd7yp3avj1dy2i5nl4mlf8gcwcbz-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x4a1c34)
Feb 08 18:25:37 vic waybar-start[9434]: #1 0x7f9786128b2c in ffi_call_unix64 (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x7b2c)
Feb 08 18:25:37 vic waybar-start[9434]: #2 0x7f978612783b in ffi_call_int (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x683b)
Feb 08 18:25:37 vic waybar-start[9434]: #3 0x7f9787da02e1 in wl_closure_invoke (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0xa2e1)
Feb 08 18:25:37 vic waybar-start[9434]: #4 0x7f9787d9c979 in dispatch_event.isra.0 (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x6979)
Feb 08 18:25:37 vic waybar-start[9434]: #5 0x7f9787d9e04b in wl_display_dispatch_queue_pending (/nix/store/w6rq0kfag1yqb3pj0bi9g84nrv9nbckf-wayland-1.18.0/lib/libwayland-client.so.0+0x804b)
Feb 08 18:25:37 vic waybar-start[9434]: #6 0x7f9786b85983 in _gdk_wayland_display_queue_events (/nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0+0x71983)
Feb 08 18:25:37 vic waybar-start[9434]: #7 0x7f9786b4d6ff in gdk_display_get_event (/nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0+0x396ff)
Feb 08 18:25:37 vic waybar-start[9434]: #8 0x7f9786b85681 in gdk_event_source_dispatch (/nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0+0x71681)
Feb 08 18:25:37 vic waybar-start[9434]: #9 0x7f9786807a9a in g_main_context_dispatch (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0+0x54a9a)
Feb 08 18:25:37 vic waybar-start[9434]: #10 0x7f9786807d47 in g_main_context_iterate.constprop.0 (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0+0x54d47)
Feb 08 18:25:37 vic waybar-start[9434]: #11 0x7f9786807dfe in g_main_context_iteration (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0+0x54dfe)
Feb 08 18:25:37 vic waybar-start[9434]: #12 0x7f9786a1bda4 in g_application_run (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libgio-2.0.so.0+0xdbda4)
Feb 08 18:25:37 vic waybar-start[9434]: #13 0x43aa36 in waybar::Client::main(int, char**) (/nix/store/draqbd7yp3avj1dy2i5nl4mlf8gcwcbz-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x43aa36)
Feb 08 18:25:37 vic waybar-start[9434]: #14 0x4381c2 in main (/nix/store/draqbd7yp3avj1dy2i5nl4mlf8gcwcbz-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x4381c2)
Feb 08 18:25:37 vic waybar-start[9434]: #15 0x7f9786167dec in __libc_start_main (/nix/store/gafigwfaimlziam6qhw1m8dz4h952g1n-glibc-2.32-35/lib/libc.so.6+0x27dec)
Feb 08 18:25:37 vic waybar-start[9434]: #16 0x43cd89 in _start (/nix/store/draqbd7yp3avj1dy2i5nl4mlf8gcwcbz-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x43cd89)
Feb 08 18:25:37 vic waybar-start[9434]: 0x60b0000f0cb0 is located 96 bytes inside of 104-byte region [0x60b0000f0c50,0x60b0000f0cb8)
Feb 08 18:25:37 vic waybar-start[9434]: freed by thread T0 here:
Feb 08 18:25:37 vic waybar-start[9434]: #0 0x7f9787e57467 in operator delete(void*, unsigned long) (/nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6+0xaf467)
Feb 08 18:25:37 vic waybar-start[9434]: #1 0x4a0605 in waybar::Client::handleMonitorRemoved(Glib::RefPtr<Gdk::Monitor>) (/nix/store/draqbd7yp3avj1dy2i5nl4mlf8gcwcbz-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x4a0605)
Feb 08 18:25:37 vic waybar-start[9434]: #2 0x4afa26 in sigc::internal::slot_call1<sigc::bound_mem_functor1<void, waybar::Client, Glib::RefPtr<Gdk::Monitor> >, void, Glib::RefPtr<Gdk::Monitor> const&>::call_it(sigc::internal::slot_rep*, Glib::RefPtr<Gdk::Monitor> const&) (/nix/store/draqbd7yp3avj1dy2i5nl4mlf8gcwcbz-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x4afa26)
Feb 08 18:25:37 vic waybar-start[9434]: #3 0x7f97876a76c4 in (anonymous namespace)::Display_signal_monitor_added_callback(_GdkDisplay*, _GdkMonitor*, void*) (/nix/store/l849cv8w6xi83jfd21vkmc222qkfy6lb-gtkmm-3.24.2/lib/libgdkmm-3.0.so.1+0x396c4)
Feb 08 18:25:37 vic waybar-start[9434]: previously allocated by thread T0 here:
Feb 08 18:25:37 vic waybar-start[9434]: #0 0x7f9787e56647 in operator new(unsigned long) (/nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6+0xae647)
Feb 08 18:25:37 vic waybar-start[9434]: #1 0x499fef in waybar::Client::handleMonitorAdded(Glib::RefPtr<Gdk::Monitor>) (/nix/store/draqbd7yp3avj1dy2i5nl4mlf8gcwcbz-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x499fef)
Feb 08 18:25:37 vic waybar-start[9434]: #2 0x4afa26 in sigc::internal::slot_call1<sigc::bound_mem_functor1<void, waybar::Client, Glib::RefPtr<Gdk::Monitor> >, void, Glib::RefPtr<Gdk::Monitor> const&>::call_it(sigc::internal::slot_rep*, Glib::RefPtr<Gdk::Monitor> const&) (/nix/store/draqbd7yp3avj1dy2i5nl4mlf8gcwcbz-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x4afa26)
Feb 08 18:25:37 vic waybar-start[9434]: #3 0x7f97876a76c4 in (anonymous namespace)::Display_signal_monitor_added_callback(_GdkDisplay*, _GdkMonitor*, void*) (/nix/store/l849cv8w6xi83jfd21vkmc222qkfy6lb-gtkmm-3.24.2/lib/libgdkmm-3.0.so.1+0x396c4)
Feb 08 18:25:37 vic waybar-start[9434]: SUMMARY: AddressSanitizer: heap-use-after-free (/nix/store/draqbd7yp3avj1dy2i5nl4mlf8gcwcbz-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x4a1c34) in waybar::Client::handleOutputDone(void*, zxdg_output_v1*)
Feb 08 18:25:37 vic waybar-start[9434]: Shadow bytes around the buggy address:
Feb 08 18:25:37 vic waybar-start[9434]: 0x0c1680016140: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
Feb 08 18:25:37 vic waybar-start[9434]: 0x0c1680016150: fd fd fd fd fd fa fa fa fa fa fa fa fa fa fa fa
Feb 08 18:25:37 vic waybar-start[9434]: 0x0c1680016160: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Feb 08 18:25:37 vic waybar-start[9434]: 0x0c1680016170: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd
Feb 08 18:25:37 vic waybar-start[9434]: 0x0c1680016180: fd fa fa fa fa fa fa fa fa fa fd fd fd fd fd fd
Feb 08 18:25:37 vic waybar-start[9434]: =>0x0c1680016190: fd fd fd fd fd fd[fd]fa fa fa fa fa fa fa fa fa
Feb 08 18:25:37 vic waybar-start[9434]: 0x0c16800161a0: fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa
Feb 08 18:25:37 vic waybar-start[9434]: 0x0c16800161b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Feb 08 18:25:37 vic waybar-start[9434]: 0x0c16800161c0: fa fa fa fa fa fa fa fa fa fa fa fa fd fd fd fd
Feb 08 18:25:37 vic waybar-start[9434]: 0x0c16800161d0: fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa
Feb 08 18:25:37 vic waybar-start[9434]: 0x0c16800161e0: fa fa fd fd fd fd fd fd fd fd fd fd fd fd fd fa
Feb 08 18:25:37 vic waybar-start[9434]: Shadow byte legend (one shadow byte represents 8 application bytes):
Feb 08 18:25:37 vic waybar-start[9434]: Addressable: 00
Feb 08 18:25:37 vic waybar-start[9434]: Partially addressable: 01 02 03 04 05 06 07
Feb 08 18:25:37 vic waybar-start[9434]: Heap left redzone: fa
Feb 08 18:25:37 vic waybar-start[9434]: Freed heap region: fd
Feb 08 18:25:37 vic waybar-start[9434]: Stack left redzone: f1
Feb 08 18:25:37 vic waybar-start[9434]: Stack mid redzone: f2
Feb 08 18:25:37 vic waybar-start[9434]: Stack right redzone: f3
Feb 08 18:25:37 vic waybar-start[9434]: Stack after return: f5
Feb 08 18:25:37 vic waybar-start[9434]: Stack use after scope: f8
Feb 08 18:25:37 vic waybar-start[9434]: Global redzone: f9
Feb 08 18:25:37 vic waybar-start[9434]: Global init order: f6
Feb 08 18:25:37 vic waybar-start[9434]: Poisoned by user: f7
Feb 08 18:25:37 vic waybar-start[9434]: Container overflow: fc
Feb 08 18:25:37 vic waybar-start[9434]: Array cookie: ac
Feb 08 18:25:37 vic waybar-start[9434]: Intra object redzone: bb
Feb 08 18:25:37 vic waybar-start[9434]: ASan internal: fe
Feb 08 18:25:37 vic waybar-start[9434]: Left alloca redzone: ca
Feb 08 18:25:37 vic waybar-start[9434]: Right alloca redzone: cb
Feb 08 18:25:37 vic waybar-start[9434]: Shadow gap: cc
Feb 08 18:25:37 vic waybar-start[9434]: ==9434==ABORTING
Ooh. Now I'm genuinely confused. There's a code in the beginning of handleOutputDone
that throws an exception if the output is already removed, and without async wayland call it should stay valid until the end of the method.
I tried to repro that with my daisy-chained display setup with no success so I can't debug things. I guess I'll just have to look into rewriting this code with a different handling of output lifetime.
You can get a core file with asan using ASAN_OPTIONS=new_delete_type_mismatch=0:abort_on_error=1:disable_coredump=0:unmap_shadow_on_exit=1
(https://stackoverflow.com/a/42866567).
One thing that would also help is to find what 0x4a1c34
is. Should be as simple as
$ gdb <your binary>
(gdb) info line *0x4a1c34
(gdb) disassemble 0x4a1c34
disas:
Got the new asan options in. Thank you!
I'll try to compile with debug symbols as well, hopefully that would help
New crash:
coredump bt:
waybar commit 71f9ed3 + patch:
diff --git a/src/client.cpp b/src/client.cpp
index 0ad4e6b..9983bb5 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -124,7 +124,6 @@ void waybar::Client::handleOutputDone(void *data, struct zxdg_output_v1 * /*xdg_
auto configs = client->getOutputConfigs(output);
if (!configs.empty()) {
- wl_display_roundtrip(client->wl_display);
for (const auto &config : configs) {
client->bars.emplace_back(std::make_unique<Bar>(&output, config));
}
Thanks a lot for collecting the data, it was very helpful! The patch actually worked and the new bar instance was successfully initialized. And then something in the depths of GTK flushed wayland event queue, dispatched new events and the output disappeared again :frowning_face:
I reordered some code to make the crash less likely and have a few more changes in mind but that won't be a bulletproof solution. I'd also recommend to check why monitors are detected and removed shortly after that on your system. I reproduced something similar with a loose DP connector but there might be a different reason.
I dont believe there is anything wrong with my connections to be fair. I just have run 6 screens (2 in DP, 2 in MST behind the previous 2 and 2 in HDMI) and that makes race conditions more likely.
I got a new crash with current master (c5f875d):
bt full:
Well, the situation with adding output HDMI-A-1, removing HDMI-A-1, adding HDMI-A-1, etc..., within a few milliseconds is not quite normal. That doesn't look like a simple race condition and DP daisy-chaining doesn't explain it as well. It would be interesting to see how your screen detection sequence looks, maybe with something like https://gist.github.com/0100f74b7d0df44d24e10347dfe0170e (just leave it running and check last few lines of the log when waybar crashes again).
Something like https://github.com/alebastr/Waybar/commit/deferred-output-removal should fix the current problem and likely introduce another class of races which is why I'm hesitant to send this patch as is.
Edit:
I just realized that dpms off
/dpms on
is not even supposed to trigger output change callbacks. dpms
commands don't change the output configuration, these are just telling monitors to go into powersave mode.
@alebastr thanks! I'll try to run the gist cpp. Any chance you'd know where to capture either the output name or the serial number of the output? They're all the same make/model. Unable to really know what the pointer address means :/
Any chance you'd know where to capture either the output name or the serial number of the output?
Yes, see updated gist contents.
When waking up monitors from DPMS, waybar sometimes crash around this line: https://github.com/Alexays/Waybar/blob/f233d27b782c04ef128e3d71ec32a0b2ce02df39/src/bar.cpp#L33
I only have a partial coredump:
I'll try to capture a better coredump
Waybar 0.9.5 I have multiple monitors and some are connected with MST (displayport daisychain) and they dont all come back at once.