Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.36k stars 695 forks source link

Crash on multiple monitors wake up #1019

Closed baloo closed 3 years ago

baloo commented 3 years ago

When waking up monitors from DPMS, waybar sometimes crash around this line: https://github.com/Alexays/Waybar/blob/f233d27b782c04ef128e3d71ec32a0b2ce02df39/src/bar.cpp#L33

        Signal: 11 (SEGV)
     Timestamp: Fri 2021-02-05 17:37:53 UTC (13min ago)
  Command Line: /nix/store/8nyxlm520y29bqinfb28qn0xsd5bdjgq-waybar-0.9.5/bin/waybar --config /nix/store/hi6l2j1fb5ls1q84vcgzrax6v9w4c7g5-waybar_conf.json --style /nix/store/68p5zz5prq4825yjb1ijy526avycqf25-waybar_style.css
    Executable: /nix/store/8nyxlm520y29bqinfb28qn0xsd5bdjgq-waybar-0.9.5/bin/.waybar-wrapped

I only have a partial coredump:

(gdb) bt
#0  0x000000000044067b in waybar::GLSSurfaceImpl::GLSSurfaceImpl(Gtk::Window&, waybar::waybar_output&) ()
Backtrace stopped: Cannot access memory at address 0x7ffcf02dda08

I'll try to capture a better coredump

(gdb) disas 0x000000000044067b
Dump of assembler code for function _ZN6waybar14GLSSurfaceImplC2ERN3Gtk6WindowERNS_13waybar_outputE:
   0x00000000004405d0 <+0>: push   %r15
   0x00000000004405d2 <+2>: push   %r14
   0x00000000004405d4 <+4>: push   %r13
   0x00000000004405d6 <+6>: lea    0x8(%rdi),%r13
   0x00000000004405da <+10>:    push   %r12
   0x00000000004405dc <+12>:    mov    %rdx,%r12
   0x00000000004405df <+15>:    push   %rbp
   0x00000000004405e0 <+16>:    mov    %rsi,%rbp
   0x00000000004405e3 <+19>:    push   %rbx
   0x00000000004405e4 <+20>:    mov    %rdi,%rbx
   0x00000000004405e7 <+23>:    lea    0x18(%rbx),%r14
   0x00000000004405eb <+27>:    sub    $0x48,%rsp
   0x00000000004405ef <+31>:    mov    %fs:0x28,%rax
   0x00000000004405f8 <+40>:    mov    %rax,0x38(%rsp)
   0x00000000004405fd <+45>:    mov    $0x4b8f88,%rax
   0x0000000000440604 <+52>:    add    $0x10,%rax
   0x0000000000440608 <+56>:    mov    %rax,(%rdi)
   0x000000000044060b <+59>:    mov    %r13,%rdi
   0x000000000044060e <+62>:    call   0x4162c0 <_ZN4sigc9trackableC2Ev@plt>
   0x0000000000440613 <+67>:    mov    $0x4b8fd8,%rax
   0x000000000044061a <+74>:    mov    %rbp,0x10(%rbx)
   0x000000000044061e <+78>:    mov    %r14,%rdi
   0x0000000000440621 <+81>:    movq   $0x0,0x20(%rbx)
   0x0000000000440629 <+89>:    lea    0x8(%r12),%rsi
   0x000000000044062e <+94>:    add    $0x10,%rax
   0x0000000000440632 <+98>:    movb   $0x0,0x28(%rbx)
   0x0000000000440636 <+102>:   mov    %rax,(%rbx)
   0x0000000000440639 <+105>:   lea    0x28(%rbx),%rax
   0x000000000044063d <+109>:   mov    %rax,0x18(%rbx)
   0x0000000000440641 <+113>:   movb   $0x0,0x40(%rbx)
   0x0000000000440645 <+117>:   call   0x4177f0 <_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_assignERKS4_@plt>
   0x000000000044064a <+122>:   mov    0x10(%rbx),%rax
   0x000000000044064e <+126>:   mov    (%rax),%rdx
   0x0000000000440651 <+129>:   mov    -0x18(%rdx),%rdx
   0x0000000000440655 <+133>:   mov    0x8(%rax,%rdx,1),%rdi
   0x000000000044065a <+138>:   call   0x4177e0 <gtk_layer_init_for_window@plt>
   0x000000000044065f <+143>:   mov    0x0(%rbp),%rax
   0x0000000000440663 <+147>:   xor    %esi,%esi
   0x0000000000440665 <+149>:   mov    -0x18(%rax),%rax
   0x0000000000440669 <+153>:   mov    0x8(%rbp,%rax,1),%rdi
   0x000000000044066e <+158>:   call   0x417db0 <gtk_layer_set_keyboard_interactivity@plt>
   0x0000000000440673 <+163>:   mov    (%r12),%rdx
   0x0000000000440677 <+167>:   mov    0x10(%rbx),%rax
   0x000000000044067b <+171>:   mov    (%rdx),%rcx
   0x000000000044067e <+174>:   mov    -0x18(%rcx),%rcx
   0x0000000000440682 <+178>:   mov    0x8(%rdx,%rcx,1),%rsi
   0x0000000000440687 <+183>:   mov    (%rax),%rdx
   0x000000000044068a <+186>:   mov    -0x18(%rdx),%rdx
   0x000000000044068e <+190>:   mov    0x8(%rax,%rdx,1),%rdi
   0x0000000000440693 <+195>:   call   0x417d00 <gtk_layer_set_monitor@plt>
   0x0000000000440698 <+200>:   mov    0x10(%rbx),%rax
   0x000000000044069c <+204>:   lea    0x5718f(%rip),%rsi        # 0x497832
   0x00000000004406a3 <+211>:   mov    (%rax),%rdx
   0x00000000004406a6 <+214>:   mov    -0x18(%rdx),%rdx
   0x00000000004406aa <+218>:   mov    0x8(%rax,%rdx,1),%rdi
   0x00000000004406af <+223>:   call   0x416bc0 <gtk_layer_set_namespace@plt>
   0x00000000004406b4 <+228>:   lea    0x10(%rsp),%r12
   0x00000000004406b9 <+233>:   mov    %rbp,%rsi
   0x00000000004406bc <+236>:   mov    %r12,%rdi
   0x00000000004406bf <+239>:   call   0x416650 <_ZN3Gtk6Widget22signal_configure_eventEv@plt>
   0x00000000004406c4 <+244>:   mov    $0x58,%edi
   0x00000000004406c9 <+249>:   call   0x417a90 <_Znwm@plt>
   0x00000000004406ce <+254>:   mov    %rax,%rdi
   0x00000000004406d1 <+257>:   mov    %rax,%rbp
   0x00000000004406d4 <+260>:   call   0x4162c0 <_ZN4sigc9trackableC2Ev@plt>
   0x00000000004406d9 <+265>:   mov    $0x43fc90,%rax
   0x00000000004406e0 <+272>:   mov    %rbp,%rsi
   0x00000000004406e3 <+275>:   movq   $0x0,0x8(%rbp)
   0x00000000004406eb <+283>:   mov    %r13,0x48(%rbp)
   0x00000000004406ef <+287>:   mov    0x7b83a(%rip),%rdx        # 0x4bbf30
   0x00000000004406f6 <+294>:   mov    %r13,%rdi
   0x00000000004406f9 <+297>:   mov    %rax,0x10(%rbp)

Waybar 0.9.5 I have multiple monitors and some are connected with MST (displayport daisychain) and they dont all come back at once.

baloo commented 3 years ago

Could be a duplicate of #970

alebastr commented 3 years ago

@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.

baloo commented 3 years ago

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.

alebastr commented 3 years ago

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.

baloo commented 3 years ago

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.

baloo commented 3 years ago

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).

alebastr commented 3 years ago

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.

baloo commented 3 years ago

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?

baloo commented 3 years ago

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
alebastr commented 3 years ago

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
baloo commented 3 years ago

disas:

``` (gdb) info line *0x4a1c34 No line number information available for address 0x4a1c34 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2628> (gdb) disassemble 0x4a1c34 Dump of assembler code for function _ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1: 0x00000000004a11f0 <+0>: push %rbp 0x00000000004a11f1 <+1>: mov %rsp,%rbp 0x00000000004a11f4 <+4>: push %r15 0x00000000004a11f6 <+6>: push %r14 0x00000000004a11f8 <+8>: lea -0x330(%rbp),%rax 0x00000000004a11ff <+15>: push %r13 0x00000000004a1201 <+17>: push %r12 0x00000000004a1203 <+19>: mov %rdi,%r12 0x00000000004a1206 <+22>: push %rbx 0x00000000004a1207 <+23>: sub $0x378,%rsp 0x00000000004a120e <+30>: mov %rax,-0x370(%rbp) 0x00000000004a1215 <+37>: mov %rax,-0x380(%rbp) 0x00000000004a121c <+44>: mov 0x211d75(%rip),%rax # 0x6b2f98 0x00000000004a1223 <+51>: mov (%rax),%esi 0x00000000004a1225 <+53>: test %esi,%esi 0x00000000004a1227 <+55>: jne 0x4a1c45 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2645> 0x00000000004a122d <+61>: mov -0x370(%rbp),%r13 0x00000000004a1234 <+68>: lea 0x1be25d(%rip),%rax # 0x65f498 0x00000000004a123b <+75>: mov %r13,%r15 0x00000000004a123e <+78>: mov %rax,0x8(%r13) 0x00000000004a1242 <+82>: lea -0x59(%rip),%rax # 0x4a11f0 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1> 0x00000000004a1249 <+89>: lea 0x300(%r13),%rbx 0x00000000004a1250 <+96>: shr $0x3,%r15 0x00000000004a1254 <+100>: movq $0x41b58ab3,0x0(%r13) 0x00000000004a125c <+108>: mov %rax,0x10(%r13) 0x00000000004a1260 <+112>: movl $0xf1f1f1f1,0x7fff8000(%r15) 0x00000000004a126b <+123>: movl $0xf2f2f200,0x7fff8004(%r15) 0x00000000004a1276 <+134>: movl $0xf2f2f200,0x7fff8008(%r15) 0x00000000004a1281 <+145>: movl $0xf2f2f200,0x7fff800c(%r15) 0x00000000004a128c <+156>: movl $0xf2f2f200,0x7fff8010(%r15) 0x00000000004a1297 <+167>: movl $0xf2f2f200,0x7fff8014(%r15) 0x00000000004a12a2 <+178>: movl $0xf2f2f200,0x7fff8018(%r15) 0x00000000004a12ad <+189>: movl $0xf2f2f200,0x7fff801c(%r15) 0x00000000004a12b8 <+200>: movl $0xf2f2f200,0x7fff8020(%r15) 0x00000000004a12c3 <+211>: movl $0xf2f2f200,0x7fff8024(%r15) 0x00000000004a12ce <+222>: movl $0xf2f2f200,0x7fff8028(%r15) 0x00000000004a12d9 <+233>: movl $0xf2f2f200,0x7fff802c(%r15) 0x00000000004a12e4 <+244>: movl $0xf2f2f200,0x7fff8030(%r15) 0x00000000004a12ef <+255>: movl $0xf2f2f200,0x7fff8034(%r15) 0x00000000004a12fa <+266>: movl $0xf2f2f200,0x7fff8038(%r15) 0x00000000004a1305 <+277>: movl $0xf2f20000,0x7fff803c(%r15) 0x00000000004a1310 <+288>: movl $0xf2f20000,0x7fff8040(%r15) 0x00000000004a131b <+299>: movl $0xf2000000,0x7fff8044(%r15) 0x00000000004a1326 <+310>: movl $0xf2f2f2f2,0x7fff8048(%r15) 0x00000000004a1331 <+321>: movl $0xf2000000,0x7fff804c(%r15) 0x00000000004a133c <+332>: movl $0xf2f2f2f2,0x7fff8050(%r15) 0x00000000004a1347 <+343>: movl $0xf3000000,0x7fff8054(%r15) 0x00000000004a1352 <+354>: movl $0xf3f3f3f3,0x7fff8058(%r15) 0x00000000004a135d <+365>: mov %fs:0x28,%rax 0x00000000004a1366 <+374>: mov %rax,-0x38(%rbp) 0x00000000004a136a <+378>: xor %eax,%eax 0x00000000004a136c <+380>: call 0x4a0a20 <_ZN6waybar6Client4instEv> 0x00000000004a1371 <+385>: mov %r12,%rsi 0x00000000004a1374 <+388>: mov %rax,%r14 0x00000000004a1377 <+391>: lea 0x220(%r13),%rax 0x00000000004a137e <+398>: mov %r14,%rdi 0x00000000004a1381 <+401>: mov %rax,-0x358(%rbp) 0x00000000004a1388 <+408>: call 0x49b550 <_ZN6waybar6Client9getOutputEPv> 0x00000000004a138d <+413>: lea 0x28(%rax),%rsi 0x00000000004a1391 <+417>: mov %rax,-0x340(%rbp) 0x00000000004a1398 <+424>: add $0x8,%rax 0x00000000004a139c <+428>: mov %rax,-0x348(%rbp) 0x00000000004a13a3 <+435>: lea -0xe0(%rbx),%rax 0x00000000004a13aa <+442>: mov %rsi,-0x338(%rbp) 0x00000000004a13b1 <+449>: mov %rax,-0x358(%rbp) 0x00000000004a13b8 <+456>: call 0x419c90 <_ZN6spdlog18default_logger_rawEv@plt> 0x00000000004a13bd <+461>: lea -0x100(%rbx),%r13 0x00000000004a13c4 <+468>: mov %rax,%rdi 0x00000000004a13c7 <+471>: mov %r13,%rax 0x00000000004a13ca <+474>: shr $0x3,%rax 0x00000000004a13ce <+478>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a13d5 <+485>: jne 0x4a1c3d <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2637> 0x00000000004a13db <+491>: lea 0x1bc7fe(%rip),%rax # 0x65dbe0 0x00000000004a13e2 <+498>: lea -0xf8(%rbx),%r8 0x00000000004a13e9 <+505>: mov %rax,-0x100(%rbx) 0x00000000004a13f0 <+512>: mov %r8,%rax 0x00000000004a13f3 <+515>: shr $0x3,%rax 0x00000000004a13f7 <+519>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a13fe <+526>: jne 0x4a1c35 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2629> 0x00000000004a1404 <+532>: movq $0x1e,-0xf8(%rbx) 0x00000000004a140f <+543>: lea -0x60(%rbx),%r12 0x00000000004a1413 <+547>: mov %r12,%rax 0x00000000004a1416 <+550>: shr $0x3,%rax 0x00000000004a141a <+554>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a1421 <+561>: jne 0x4a1c10 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2592> 0x00000000004a1427 <+567>: lea -0x58(%rbx),%r8 0x00000000004a142b <+571>: movq $0x0,-0x60(%rbx) 0x00000000004a1433 <+579>: mov %r8,%rax 0x00000000004a1436 <+582>: shr $0x3,%rax 0x00000000004a143a <+586>: movzbl 0x7fff8000(%rax),%eax 0x00000000004a1441 <+593>: test %al,%al 0x00000000004a1443 <+595>: je 0x4a144d <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+605> 0x00000000004a1445 <+597>: cmp $0x3,%al 0x00000000004a1447 <+599>: jle 0x4a1bae <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2494> 0x00000000004a144d <+605>: lea -0x50(%rbx),%r8 0x00000000004a1451 <+609>: movl $0x0,-0x58(%rbx) 0x00000000004a1458 <+616>: mov %r8,%rax 0x00000000004a145b <+619>: shr $0x3,%rax 0x00000000004a145f <+623>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a1466 <+630>: jne 0x4a1d22 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2866> 0x00000000004a146c <+636>: mov %r12,%rax 0x00000000004a146f <+639>: movq $0x0,-0x50(%rbx) 0x00000000004a1477 <+647>: shr $0x3,%rax 0x00000000004a147b <+651>: movzbl 0x7fff8000(%rax),%edx 0x00000000004a1482 <+658>: lea -0x49(%rbx),%rax 0x00000000004a1486 <+662>: mov %rax,%rcx 0x00000000004a1489 <+665>: and $0x7,%eax 0x00000000004a148c <+668>: shr $0x3,%rcx 0x00000000004a1490 <+672>: movzbl 0x7fff8000(%rcx),%ecx 0x00000000004a1497 <+679>: cmp %al,%cl 0x00000000004a1499 <+681>: setle %sil 0x00000000004a149d <+685>: test %cl,%cl 0x00000000004a149f <+687>: setne %al 0x00000000004a14a2 <+690>: test %al,%sil 0x00000000004a14a5 <+693>: jne 0x4a1d15 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2853> 0x00000000004a14ab <+699>: test %dl,%dl 0x00000000004a14ad <+701>: setne %cl 0x00000000004a14b0 <+704>: setle %al 0x00000000004a14b3 <+707>: test %al,%cl 0x00000000004a14b5 <+709>: jne 0x4a1d15 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2853> 0x00000000004a14bb <+715>: lea -0x120(%rbx),%rdx 0x00000000004a14c2 <+722>: movdqu -0x60(%rbx),%xmm1 0x00000000004a14c7 <+727>: movq $0x0,-0x90(%rbx) 0x00000000004a14d2 <+738>: mov %rdx,%rax 0x00000000004a14d5 <+741>: shr $0x3,%rax 0x00000000004a14d9 <+745>: movups %xmm1,-0xa0(%rbx) 0x00000000004a14e0 <+752>: cmpw $0x0,0x7fff8000(%rax) 0x00000000004a14e8 <+760>: jne 0x4a1d0d <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2845> 0x00000000004a14ee <+766>: mov %r13,%rax 0x00000000004a14f1 <+769>: shr $0x3,%rax 0x00000000004a14f5 <+773>: cmpw $0x0,0x7fff8000(%rax) 0x00000000004a14fd <+781>: jne 0x4a1d05 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2837> 0x00000000004a1503 <+787>: sub $0x8,%rsp 0x00000000004a1507 <+791>: movdqu -0x100(%rbx),%xmm2 0x00000000004a150f <+799>: mov -0x338(%rbp),%r8 0x00000000004a1516 <+806>: mov $0x1,%esi 0x00000000004a151b <+811>: mov -0x348(%rbp),%rcx 0x00000000004a1522 <+818>: movups %xmm2,-0x120(%rbx) 0x00000000004a1529 <+825>: push -0x90(%rbx) 0x00000000004a152f <+831>: push -0x98(%rbx) 0x00000000004a1535 <+837>: push -0xa0(%rbx) 0x00000000004a153b <+843>: call 0x4cf100 <_ZN6spdlog6logger4log_IN3fmt2v717basic_string_viewIcEEJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESB_EEEvNS_10source_locENS_5level10level_enumERKT_DpRKT0_> 0x00000000004a1540 <+848>: shr $0x3,%r12 0x00000000004a1544 <+852>: mov $0xfffff8f8,%eax 0x00000000004a1549 <+857>: xor %ecx,%ecx 0x00000000004a154b <+859>: shr $0x3,%r13 0x00000000004a154f <+863>: mov %ax,0x7fff8000(%r12) 0x00000000004a1558 <+872>: lea -0xe0(%rbx),%rax 0x00000000004a155f <+879>: mov $0xfffff8f8,%edx 0x00000000004a1564 <+884>: add $0x20,%rsp 0x00000000004a1568 <+888>: mov %rax,-0x358(%rbp) 0x00000000004a156f <+895>: shr $0x3,%rax 0x00000000004a1573 <+899>: movb $0xf8,0x7fff8002(%r12) 0x00000000004a157c <+908>: mov %dx,0x7fff8000(%r13) 0x00000000004a1584 <+916>: mov %cx,0x7fff8000(%rax) 0x00000000004a158b <+923>: movb $0x0,0x7fff8002(%rax) 0x00000000004a1592 <+930>: lea -0xc9(%rbx),%rax 0x00000000004a1599 <+937>: mov %rax,%rdx 0x00000000004a159c <+940>: and $0x7,%eax 0x00000000004a159f <+943>: shr $0x3,%rdx 0x00000000004a15a3 <+947>: movzbl 0x7fff8000(%rdx),%edx 0x00000000004a15aa <+954>: cmp %al,%dl 0x00000000004a15ac <+956>: setle %cl 0x00000000004a15af <+959>: test %dl,%dl 0x00000000004a15b1 <+961>: setne %al 0x00000000004a15b4 <+964>: test %al,%cl 0x00000000004a15b6 <+966>: jne 0x4a1cf4 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2820> 0x00000000004a15bc <+972>: xor %eax,%eax 0x00000000004a15be <+974>: test %al,%al 0x00000000004a15c0 <+976>: jne 0x4a1cf4 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2820> 0x00000000004a15c6 <+982>: mov -0x340(%rbp),%rdx 0x00000000004a15cd <+989>: mov -0x358(%rbp),%rdi 0x00000000004a15d4 <+996>: mov %r14,%rsi 0x00000000004a15d7 <+999>: call 0x49ce40 <_ZN6waybar6Client16getOutputConfigsERNS_13waybar_outputE> 0x00000000004a15dc <+1004>: lea -0xd8(%rbx),%rsi 0x00000000004a15e3 <+1011>: lea -0x220(%rbx),%r8 0x00000000004a15ea <+1018>: mov %r8,%rax 0x00000000004a15ed <+1021>: lea -0x280(%rbx),%rdx 0x00000000004a15f4 <+1028>: mov %rsi,%rdi 0x00000000004a15f7 <+1031>: mov %rsi,-0x378(%rbp) 0x00000000004a15fe <+1038>: shr $0x3,%rax 0x00000000004a1602 <+1042>: shr $0x3,%rdx 0x00000000004a1606 <+1046>: shr $0x3,%rdi 0x00000000004a160a <+1050>: movb $0x0,0x7fff8000(%rax) 0x00000000004a1611 <+1057>: movb $0x0,0x7fff8000(%rdx) 0x00000000004a1618 <+1064>: cmpb $0x0,0x7fff8000(%rdi) 0x00000000004a161f <+1071>: jne 0x4a1cec <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2812> 0x00000000004a1625 <+1077>: mov -0xd8(%rbx),%rcx 0x00000000004a162c <+1084>: mov %rcx,-0x280(%rbx) 0x00000000004a1633 <+1091>: movb $0xf8,0x7fff8000(%rdx) 0x00000000004a163a <+1098>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a1641 <+1105>: jne 0x4a1ce4 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2804> 0x00000000004a1647 <+1111>: mov -0x358(%rbp),%r9 0x00000000004a164e <+1118>: lea -0x240(%rbx),%r10 0x00000000004a1655 <+1125>: lea -0x260(%rbx),%rdx 0x00000000004a165c <+1132>: mov %rcx,-0x220(%rbx) 0x00000000004a1663 <+1139>: mov %r10,%rsi 0x00000000004a1666 <+1142>: shr $0x3,%rdx 0x00000000004a166a <+1146>: shr $0x3,%rsi 0x00000000004a166e <+1150>: shr $0x3,%r9 0x00000000004a1672 <+1154>: movb $0x0,0x7fff8000(%rsi) 0x00000000004a1679 <+1161>: movb $0x0,0x7fff8000(%rdx) 0x00000000004a1680 <+1168>: cmpb $0x0,0x7fff8000(%r9) 0x00000000004a1688 <+1176>: jne 0x4a1cd8 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2792> 0x00000000004a168e <+1182>: mov -0xe0(%rbx),%rcx 0x00000000004a1695 <+1189>: mov %rcx,-0x260(%rbx) 0x00000000004a169c <+1196>: movb $0xf8,0x7fff8000(%rdx) 0x00000000004a16a3 <+1203>: cmpb $0x0,0x7fff8000(%rsi) 0x00000000004a16aa <+1210>: jne 0x4a1cd0 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2784> 0x00000000004a16b0 <+1216>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a16b7 <+1223>: mov %rcx,-0x240(%rbx) 0x00000000004a16be <+1230>: jne 0x4a1cc8 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2776> 0x00000000004a16c4 <+1236>: mov -0x220(%rbx),%rdx 0x00000000004a16cb <+1243>: movb $0xf8,0x7fff8000(%rsi) 0x00000000004a16d2 <+1250>: movb $0xf8,0x7fff8000(%rax) 0x00000000004a16d9 <+1257>: cmp %rdx,%rcx 0x00000000004a16dc <+1260>: je 0x4a1a44 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2132> 0x00000000004a16e2 <+1266>: lea -0x2e0(%rbx),%rax 0x00000000004a16e9 <+1273>: mov %rax,%rcx 0x00000000004a16ec <+1276>: mov %rax,-0x348(%rbp) 0x00000000004a16f3 <+1283>: lea -0x1e0(%rbx),%rax 0x00000000004a16fa <+1290>: shr $0x3,%rcx 0x00000000004a16fe <+1294>: shr $0x3,%rax 0x00000000004a1702 <+1298>: movb $0x0,0x7fff8000(%rcx) 0x00000000004a1709 <+1305>: movb $0x0,0x7fff8000(%rax) 0x00000000004a1710 <+1312>: cmpb $0x0,0x7fff8000(%r9) 0x00000000004a1718 <+1320>: jne 0x4a1d2a <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2874> 0x00000000004a171e <+1326>: mov -0xe0(%rbx),%rdx 0x00000000004a1725 <+1333>: mov %rdx,-0x1e0(%rbx) 0x00000000004a172c <+1340>: movb $0xf8,0x7fff8000(%rax) 0x00000000004a1733 <+1347>: cmpb $0x0,0x7fff8000(%rcx) 0x00000000004a173a <+1354>: jne 0x4a1d5a <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2922> 0x00000000004a1740 <+1360>: lea -0x2c0(%rbx),%rax 0x00000000004a1747 <+1367>: mov %rdx,-0x2e0(%rbx) 0x00000000004a174e <+1374>: mov %rax,%rsi 0x00000000004a1751 <+1377>: mov %rax,-0x350(%rbp) 0x00000000004a1758 <+1384>: lea -0x200(%rbx),%rax 0x00000000004a175f <+1391>: shr $0x3,%rsi 0x00000000004a1763 <+1395>: shr $0x3,%rax 0x00000000004a1767 <+1399>: movb $0x0,0x7fff8000(%rsi) 0x00000000004a176e <+1406>: movb $0x0,0x7fff8000(%rax) 0x00000000004a1775 <+1413>: cmpb $0x0,0x7fff8000(%rdi) 0x00000000004a177c <+1420>: jne 0x4a1d4e <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2910> 0x00000000004a1782 <+1426>: mov -0xd8(%rbx),%rdx 0x00000000004a1789 <+1433>: mov %rdx,-0x200(%rbx) 0x00000000004a1790 <+1440>: movb $0xf8,0x7fff8000(%rax) 0x00000000004a1797 <+1447>: cmpb $0x0,0x7fff8000(%rsi) 0x00000000004a179e <+1454>: jne 0x4a1d42 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2898> 0x00000000004a17a4 <+1460>: cmpb $0x0,0x7fff8000(%rcx) 0x00000000004a17ab <+1467>: mov %rdx,-0x2c0(%rbx) 0x00000000004a17b2 <+1474>: jne 0x4a1d36 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2886> 0x00000000004a17b8 <+1480>: lea 0x38(%r14),%rax 0x00000000004a17bc <+1484>: mov -0x2e0(%rbx),%r12 0x00000000004a17c3 <+1491>: mov %rax,-0x390(%rbp) 0x00000000004a17ca <+1498>: lea -0x2a0(%rbx),%rax 0x00000000004a17d1 <+1505>: mov %rax,-0x388(%rbp) 0x00000000004a17d8 <+1512>: cmp %r12,%rdx 0x00000000004a17db <+1515>: je 0x4a1a20 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2096> 0x00000000004a17e1 <+1521>: shr $0x3,%rax 0x00000000004a17e5 <+1525>: mov %rax,-0x338(%rbp) 0x00000000004a17ec <+1532>: lea 0x40(%r14),%rax 0x00000000004a17f0 <+1536>: mov %rax,-0x398(%rbp) 0x00000000004a17f7 <+1543>: shr $0x3,%rax 0x00000000004a17fb <+1547>: mov %rax,-0x368(%rbp) 0x00000000004a1802 <+1554>: lea 0x48(%r14),%rax 0x00000000004a1806 <+1558>: mov %rax,-0x360(%rbp) 0x00000000004a180d <+1565>: jmp 0x4a1965 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+1909> 0x00000000004a1812 <+1570>: nopw 0x0(%rax,%rax,1) 0x00000000004a1818 <+1576>: mov %rdi,%rax 0x00000000004a181b <+1579>: shr $0x3,%rax 0x00000000004a181f <+1583>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a1826 <+1590>: jne 0x4a1be7 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2551> 0x00000000004a182c <+1596>: mov %r13,(%rdi) 0x00000000004a182f <+1599>: add $0x8,%rdi 0x00000000004a1833 <+1603>: movq $0x0,-0x2a0(%rbx) 0x00000000004a183e <+1614>: mov %rdi,0x40(%r14) 0x00000000004a1842 <+1618>: lea -0x140(%rbx),%rdi 0x00000000004a1849 <+1625>: lea -0x160(%rbx),%r8 0x00000000004a1850 <+1632>: mov 0x40(%r14),%rsi 0x00000000004a1854 <+1636>: mov %rdi,%rcx 0x00000000004a1857 <+1639>: mov %r8,%rdx 0x00000000004a185a <+1642>: lea -0x1a0(%rbx),%rax 0x00000000004a1861 <+1649>: shr $0x3,%rcx 0x00000000004a1865 <+1653>: shr $0x3,%rdx 0x00000000004a1869 <+1657>: shr $0x3,%rax 0x00000000004a186d <+1661>: movb $0x0,0x7fff8000(%rcx) 0x00000000004a1874 <+1668>: movb $0x0,0x7fff8000(%rdx) 0x00000000004a187b <+1675>: mov %rsi,-0x1a0(%rbx) 0x00000000004a1882 <+1682>: movb $0xf8,0x7fff8000(%rax) 0x00000000004a1889 <+1689>: cmpb $0x0,0x7fff8000(%rdx) 0x00000000004a1890 <+1696>: jne 0x4a1bdf <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2543> 0x00000000004a1896 <+1702>: mov %rsi,-0x160(%rbx) 0x00000000004a189d <+1709>: mov -0x160(%rbx),%rax 0x00000000004a18a4 <+1716>: lea -0x180(%rbx),%rsi 0x00000000004a18ab <+1723>: shr $0x3,%rsi 0x00000000004a18af <+1727>: sub $0x8,%rax 0x00000000004a18b3 <+1731>: mov %rax,-0x180(%rbx) 0x00000000004a18ba <+1738>: movb $0xf8,0x7fff8000(%rsi) 0x00000000004a18c1 <+1745>: cmpb $0x0,0x7fff8000(%rcx) 0x00000000004a18c8 <+1752>: jne 0x4a1bda <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2538> 0x00000000004a18ce <+1758>: mov %rax,-0x140(%rbx) 0x00000000004a18d5 <+1765>: mov -0x338(%rbp),%rax 0x00000000004a18dc <+1772>: movb $0xf8,0x7fff8000(%rcx) 0x00000000004a18e3 <+1779>: movb $0xf8,0x7fff8000(%rdx) 0x00000000004a18ea <+1786>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a18f1 <+1793>: jne 0x4a1bce <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2526> 0x00000000004a18f7 <+1799>: mov -0x2a0(%rbx),%rdi 0x00000000004a18fe <+1806>: test %rdi,%rdi 0x00000000004a1901 <+1809>: je 0x4a1908 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+1816> 0x00000000004a1903 <+1811>: call 0x49eed0 <_ZNKSt14default_deleteIN6waybar3BarEEclEPS1_.part.0> 0x00000000004a1908 <+1816>: mov -0x338(%rbp),%rax 0x00000000004a190f <+1823>: movb $0xf8,0x7fff8000(%rax) 0x00000000004a1916 <+1830>: mov -0x348(%rbp),%rax 0x00000000004a191d <+1837>: shr $0x3,%rax 0x00000000004a1921 <+1841>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a1928 <+1848>: jne 0x4a1bc2 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2514> 0x00000000004a192e <+1854>: mov -0x2e0(%rbx),%rax 0x00000000004a1935 <+1861>: lea 0x28(%rax),%r12 0x00000000004a1939 <+1865>: mov -0x350(%rbp),%rax 0x00000000004a1940 <+1872>: mov %r12,-0x2e0(%rbx) 0x00000000004a1947 <+1879>: shr $0x3,%rax 0x00000000004a194b <+1883>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a1952 <+1890>: jne 0x4a1bb6 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2502> 0x00000000004a1958 <+1896>: cmp %r12,-0x2c0(%rbx) 0x00000000004a195f <+1903>: je 0x4a1a20 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2096> 0x00000000004a1965 <+1909>: mov -0x338(%rbp),%rax 0x00000000004a196c <+1916>: mov $0x228,%edi 0x00000000004a1971 <+1921>: movb $0x0,0x7fff8000(%rax) 0x00000000004a1978 <+1928>: call 0x419ae0 <_Znwm@plt> 0x00000000004a197d <+1933>: mov -0x340(%rbp),%rsi 0x00000000004a1984 <+1940>: mov %r12,%rdx 0x00000000004a1987 <+1943>: mov %rax,%rdi 0x00000000004a198a <+1946>: mov %rax,%r13 0x00000000004a198d <+1949>: call 0x481b40 <_ZN6waybar3BarC2EPNS_13waybar_outputERKN4Json5ValueE> 0x00000000004a1992 <+1954>: mov -0x338(%rbp),%rax 0x00000000004a1999 <+1961>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a19a0 <+1968>: jne 0x4a1c04 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2580> 0x00000000004a19a6 <+1974>: mov -0x368(%rbp),%rax 0x00000000004a19ad <+1981>: mov %r13,-0x2a0(%rbx) 0x00000000004a19b4 <+1988>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a19bb <+1995>: jne 0x4a1bf8 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2568> 0x00000000004a19c1 <+2001>: mov -0x360(%rbp),%rax 0x00000000004a19c8 <+2008>: mov 0x40(%r14),%rdi 0x00000000004a19cc <+2012>: shr $0x3,%rax 0x00000000004a19d0 <+2016>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a19d7 <+2023>: jne 0x4a1bec <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2556> 0x00000000004a19dd <+2029>: cmp 0x48(%r14),%rdi 0x00000000004a19e1 <+2033>: jne 0x4a1818 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+1576> 0x00000000004a19e7 <+2039>: mov 0x40(%r14),%rsi 0x00000000004a19eb <+2043>: lea -0x1c0(%rbx),%rax 0x00000000004a19f2 <+2050>: mov -0x388(%rbp),%rdx 0x00000000004a19f9 <+2057>: shr $0x3,%rax 0x00000000004a19fd <+2061>: mov -0x390(%rbp),%rdi 0x00000000004a1a04 <+2068>: mov %rsi,-0x1c0(%rbx) 0x00000000004a1a0b <+2075>: movb $0xf8,0x7fff8000(%rax) 0x00000000004a1a12 <+2082>: call 0x4b6c10 <_ZNSt6vectorISt10unique_ptrIN6waybar3BarESt14default_deleteIS2_EESaIS5_EE17_M_realloc_insertIJS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_> 0x00000000004a1a17 <+2087>: jmp 0x4a1842 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+1618> 0x00000000004a1a1c <+2092>: nopl 0x0(%rax) 0x00000000004a1a20 <+2096>: mov -0x348(%rbp),%rax 0x00000000004a1a27 <+2103>: shr $0x3,%rax 0x00000000004a1a2b <+2107>: movb $0xf8,0x7fff8000(%rax) 0x00000000004a1a32 <+2114>: mov -0x350(%rbp),%rax 0x00000000004a1a39 <+2121>: shr $0x3,%rax 0x00000000004a1a3d <+2125>: movb $0xf8,0x7fff8000(%rax) 0x00000000004a1a44 <+2132>: mov -0x340(%rbp),%rax 0x00000000004a1a4b <+2139>: lea 0x50(%rax),%rdi 0x00000000004a1a4f <+2143>: mov %rdi,%rax 0x00000000004a1a52 <+2146>: shr $0x3,%rax 0x00000000004a1a56 <+2150>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a1a5d <+2157>: jne 0x4a1c30 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2624> 0x00000000004a1a63 <+2163>: mov -0x340(%rbp),%rax 0x00000000004a1a6a <+2170>: mov 0x50(%rax),%rdi 0x00000000004a1a6e <+2174>: movq $0x0,0x50(%rax) 0x00000000004a1a76 <+2182>: test %rdi,%rdi 0x00000000004a1a79 <+2185>: je 0x4a1a9d <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2221> 0x00000000004a1a7b <+2187>: lea 0x48(%rax),%r8 0x00000000004a1a7f <+2191>: mov %r8,%rax 0x00000000004a1a82 <+2194>: shr $0x3,%rax 0x00000000004a1a86 <+2198>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a1a8d <+2205>: jne 0x4a1d7c <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2956> 0x00000000004a1a93 <+2211>: mov -0x340(%rbp),%rax 0x00000000004a1a9a <+2218>: call *0x48(%rax) 0x00000000004a1a9d <+2221>: mov -0x378(%rbp),%rax 0x00000000004a1aa4 <+2228>: shr $0x3,%rax 0x00000000004a1aa8 <+2232>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a1aaf <+2239>: jne 0x4a1c24 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2612> 0x00000000004a1ab5 <+2245>: mov -0x358(%rbp),%rax 0x00000000004a1abc <+2252>: mov -0xd8(%rbx),%r12 0x00000000004a1ac3 <+2259>: shr $0x3,%rax 0x00000000004a1ac7 <+2263>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a1ace <+2270>: jne 0x4a1c18 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2600> 0x00000000004a1ad4 <+2276>: mov -0xe0(%rbx),%r13 0x00000000004a1adb <+2283>: cmp %r13,%r12 0x00000000004a1ade <+2286>: je 0x4a1b10 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2336> 0x00000000004a1ae0 <+2288>: mov %r13,%rdi 0x00000000004a1ae3 <+2291>: add $0x28,%r13 0x00000000004a1ae7 <+2295>: call 0x418830 <_ZN4Json5ValueD1Ev@plt> 0x00000000004a1aec <+2300>: cmp %r13,%r12 0x00000000004a1aef <+2303>: jne 0x4a1ae0 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2288> 0x00000000004a1af1 <+2305>: mov -0x358(%rbp),%rax 0x00000000004a1af8 <+2312>: shr $0x3,%rax 0x00000000004a1afc <+2316>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a1b03 <+2323>: jne 0x4a1d70 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2944> 0x00000000004a1b09 <+2329>: mov -0xe0(%rbx),%r13 0x00000000004a1b10 <+2336>: test %r13,%r13 0x00000000004a1b13 <+2339>: je 0x4a1b42 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2386> 0x00000000004a1b15 <+2341>: lea -0xd0(%rbx),%rdi 0x00000000004a1b1c <+2348>: mov %rdi,%rax 0x00000000004a1b1f <+2351>: shr $0x3,%rax 0x00000000004a1b23 <+2355>: cmpb $0x0,0x7fff8000(%rax) 0x00000000004a1b2a <+2362>: jne 0x4a1d6b <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2939> 0x00000000004a1b30 <+2368>: mov -0xd0(%rbx),%rsi 0x00000000004a1b37 <+2375>: mov %r13,%rdi 0x00000000004a1b3a <+2378>: sub %r13,%rsi 0x00000000004a1b3d <+2381>: call 0x419390 <_ZdlPvm@plt> 0x00000000004a1b42 <+2386>: mov -0x370(%rbp),%rcx 0x00000000004a1b49 <+2393>: cmp %rcx,-0x380(%rbp) 0x00000000004a1b50 <+2400>: jne 0x4a1c66 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2678> 0x00000000004a1b56 <+2406>: lea 0x7fff8008(%r15),%rdi 0x00000000004a1b5d <+2413>: xor %eax,%eax 0x00000000004a1b5f <+2415>: lea 0x7fff8000(%r15),%rcx 0x00000000004a1b66 <+2422>: movq $0x0,0x7fff8000(%r15) 0x00000000004a1b71 <+2433>: movq $0x0,0x7fff8054(%r15) 0x00000000004a1b7c <+2444>: and $0xfffffffffffffff8,%rdi 0x00000000004a1b80 <+2448>: sub %rdi,%rcx 0x00000000004a1b83 <+2451>: add $0x5c,%ecx 0x00000000004a1b86 <+2454>: shr $0x3,%ecx 0x00000000004a1b89 <+2457>: rep stos %rax,%es:(%rdi) 0x00000000004a1b8c <+2460>: mov -0x38(%rbp),%rax 0x00000000004a1b90 <+2464>: sub %fs:0x28,%rax 0x00000000004a1b99 <+2473>: jne 0x4a1d66 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2934> 0x00000000004a1b9f <+2479>: lea -0x28(%rbp),%rsp 0x00000000004a1ba3 <+2483>: pop %rbx 0x00000000004a1ba4 <+2484>: pop %r12 0x00000000004a1ba6 <+2486>: pop %r13 0x00000000004a1ba8 <+2488>: pop %r14 0x00000000004a1baa <+2490>: pop %r15 0x00000000004a1bac <+2492>: pop %rbp 0x00000000004a1bad <+2493>: ret 0x00000000004a1bae <+2494>: mov %r8,%rdi 0x00000000004a1bb1 <+2497>: call 0x418510 <__asan_report_store4@plt> 0x00000000004a1bb6 <+2502>: mov -0x350(%rbp),%rdi 0x00000000004a1bbd <+2509>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1bc2 <+2514>: mov -0x348(%rbp),%rdi 0x00000000004a1bc9 <+2521>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1bce <+2526>: mov -0x388(%rbp),%rdi 0x00000000004a1bd5 <+2533>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1bda <+2538>: call 0x4190e0 <__asan_report_store8@plt> 0x00000000004a1bdf <+2543>: mov %r8,%rdi 0x00000000004a1be2 <+2546>: call 0x4190e0 <__asan_report_store8@plt> 0x00000000004a1be7 <+2551>: call 0x4190e0 <__asan_report_store8@plt> 0x00000000004a1bec <+2556>: mov -0x360(%rbp),%rdi 0x00000000004a1bf3 <+2563>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1bf8 <+2568>: mov -0x398(%rbp),%rdi 0x00000000004a1bff <+2575>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1c04 <+2580>: mov -0x388(%rbp),%rdi 0x00000000004a1c0b <+2587>: call 0x4190e0 <__asan_report_store8@plt> 0x00000000004a1c10 <+2592>: mov %r12,%rdi 0x00000000004a1c13 <+2595>: call 0x4190e0 <__asan_report_store8@plt> 0x00000000004a1c18 <+2600>: mov -0x358(%rbp),%rdi 0x00000000004a1c1f <+2607>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1c24 <+2612>: mov -0x378(%rbp),%rdi 0x00000000004a1c2b <+2619>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1c30 <+2624>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1c35 <+2629>: mov %r8,%rdi 0x00000000004a1c38 <+2632>: call 0x4190e0 <__asan_report_store8@plt> 0x00000000004a1c3d <+2637>: mov %r13,%rdi 0x00000000004a1c40 <+2640>: call 0x4190e0 <__asan_report_store8@plt> 0x00000000004a1c45 <+2645>: mov $0x2e0,%edi 0x00000000004a1c4a <+2650>: call 0x4184a0 <__asan_stack_malloc_4@plt> 0x00000000004a1c4f <+2655>: test %rax,%rax 0x00000000004a1c52 <+2658>: cmove -0x370(%rbp),%rax 0x00000000004a1c5a <+2666>: mov %rax,-0x370(%rbp) 0x00000000004a1c61 <+2673>: jmp 0x4a122d <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+61> 0x00000000004a1c66 <+2678>: movdqa 0x1aff82(%rip),%xmm0 # 0x651bf0 0x00000000004a1c6e <+2686>: movq $0x45e0360e,(%rcx) 0x00000000004a1c75 <+2693>: movabs $0xf5f5f5f5f5f5f5f5,%rsi 0x00000000004a1c7f <+2703>: mov %rsi,0x7fff8050(%r15) 0x00000000004a1c86 <+2710>: movl $0xf5f5f5f5,0x7fff8058(%r15) 0x00000000004a1c91 <+2721>: movups %xmm0,0x7fff8000(%r15) 0x00000000004a1c99 <+2729>: movups %xmm0,0x7fff8010(%r15) 0x00000000004a1ca1 <+2737>: movups %xmm0,0x7fff8020(%r15) 0x00000000004a1ca9 <+2745>: movups %xmm0,0x7fff8030(%r15) 0x00000000004a1cb1 <+2753>: movups %xmm0,0x7fff8040(%r15) 0x00000000004a1cb9 <+2761>: mov 0x3f8(%rcx),%rax 0x00000000004a1cc0 <+2768>: movb $0x0,(%rax) 0x00000000004a1cc3 <+2771>: jmp 0x4a1b8c <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1+2460> 0x00000000004a1cc8 <+2776>: mov %r8,%rdi 0x00000000004a1ccb <+2779>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1cd0 <+2784>: mov %r10,%rdi 0x00000000004a1cd3 <+2787>: call 0x4190e0 <__asan_report_store8@plt> 0x00000000004a1cd8 <+2792>: mov -0x358(%rbp),%rdi 0x00000000004a1cdf <+2799>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1ce4 <+2804>: mov %r8,%rdi 0x00000000004a1ce7 <+2807>: call 0x4190e0 <__asan_report_store8@plt> 0x00000000004a1cec <+2812>: mov %rsi,%rdi 0x00000000004a1cef <+2815>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1cf4 <+2820>: mov -0x358(%rbp),%rdi 0x00000000004a1cfb <+2827>: mov $0x18,%esi 0x00000000004a1d00 <+2832>: call 0x418520 <__asan_report_store_n@plt> 0x00000000004a1d05 <+2837>: mov %r13,%rdi 0x00000000004a1d08 <+2840>: call 0x419050 <__asan_report_load16@plt> 0x00000000004a1d0d <+2845>: mov %rdx,%rdi 0x00000000004a1d10 <+2848>: call 0x418c10 <__asan_report_store16@plt> 0x00000000004a1d15 <+2853>: mov $0x18,%esi 0x00000000004a1d1a <+2858>: mov %r12,%rdi 0x00000000004a1d1d <+2861>: call 0x419e10 <__asan_report_load_n@plt> 0x00000000004a1d22 <+2866>: mov %r8,%rdi 0x00000000004a1d25 <+2869>: call 0x4190e0 <__asan_report_store8@plt> 0x00000000004a1d2a <+2874>: mov -0x358(%rbp),%rdi 0x00000000004a1d31 <+2881>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1d36 <+2886>: mov -0x348(%rbp),%rdi 0x00000000004a1d3d <+2893>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1d42 <+2898>: mov -0x350(%rbp),%rdi 0x00000000004a1d49 <+2905>: call 0x4190e0 <__asan_report_store8@plt> 0x00000000004a1d4e <+2910>: mov -0x378(%rbp),%rdi 0x00000000004a1d55 <+2917>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1d5a <+2922>: mov -0x348(%rbp),%rdi 0x00000000004a1d61 <+2929>: call 0x4190e0 <__asan_report_store8@plt> 0x00000000004a1d66 <+2934>: call 0x418b50 <__stack_chk_fail@plt> 0x00000000004a1d6b <+2939>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1d70 <+2944>: mov -0x358(%rbp),%rdi 0x00000000004a1d77 <+2951>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1d7c <+2956>: mov %r8,%rdi 0x00000000004a1d7f <+2959>: call 0x41a990 <__asan_report_load8@plt> 0x00000000004a1d84 <+2964>: mov %rax,%r12 0x00000000004a1d87 <+2967>: mov %rdx,%r13 0x00000000004a1d8a <+2970>: jmp 0x42151e <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1.cold> 0x00000000004a1d8f <+2975>: mov %rax,%r14 0x00000000004a1d92 <+2978>: jmp 0x421564 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1.cold+70> 0x00000000004a1d97 <+2983>: mov %rax,%rbx 0x00000000004a1d9a <+2986>: mov %rdx,%r12 0x00000000004a1d9d <+2989>: jmp 0x42161b <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1.cold+253> 0x00000000004a1da2 <+2994>: mov %rax,%r14 0x00000000004a1da5 <+2997>: mov %rdx,%r12 0x00000000004a1da8 <+3000>: jmp 0x42159b <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1.cold+125> 0x00000000004a1dad <+3005>: mov %rax,%rbx 0x00000000004a1db0 <+3008>: mov %rdx,%r12 0x00000000004a1db3 <+3011>: jmp 0x421628 <_ZN6waybar6Client16handleOutputDoneEPvP14zxdg_output_v1.cold+266> End of assembler dump. ```

Got the new asan options in. Thank you!

baloo commented 3 years ago

I'll try to compile with debug symbols as well, hopefully that would help

baloo commented 3 years ago

New crash:

``` Feb 09 04:04:16 vic waybar-start[1941]: ================================================================= Feb 09 04:04:16 vic waybar-start[1941]: ==1941==ERROR: AddressSanitizer: heap-use-after-free on address 0x60b000255220 at pc 0x00000048bf93 bp 0x7fff35721280 sp 0x7fff35721278 Feb 09 04:04:16 vic waybar-start[1941]: READ of size 8 at 0x60b000255220 thread T0 Feb 09 04:04:17 vic waybar-start[1941]: #0 0x48bf92 in std::__uniq_ptr_impl::reset(zxdg_output_v1*) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/unique_ptr.h:179 Feb 09 04:04:17 vic waybar-start[1941]: #1 0x48bf92 in std::unique_ptr::reset(zxdg_output_v1*) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/unique_ptr.h:456 Feb 09 04:04:17 vic waybar-start[1941]: #2 0x48bf92 in waybar::Client::handleOutputDone(void*, zxdg_output_v1*) ../src/client.cpp:132 Feb 09 04:04:17 vic waybar-start[1941]: #3 0x7ff41c400b2c in ffi_call_unix64 (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x7b2c) Feb 09 04:04:17 vic waybar-start[1941]: #4 0x7ff41c3ff83b in ffi_call_int (/nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7+0x683b) Feb 09 04:04:17 vic waybar-start[1941]: #5 0x7ff41e0517ea in wl_closure_invoke (/nix/store/43inp39xzl2ma7rpap2myaxr22q46sgf-wayland-1.18.0/lib/libwayland-client.so.0+0x97ea) Feb 09 04:04:17 vic waybar-start[1941]: #6 0x7ff41e04f1ae in dispatch_event (/nix/store/43inp39xzl2ma7rpap2myaxr22q46sgf-wayland-1.18.0/lib/libwayland-client.so.0+0x71ae) Feb 09 04:04:17 vic waybar-start[1941]: #7 0x7ff41e04f22a in dispatch_queue (/nix/store/43inp39xzl2ma7rpap2myaxr22q46sgf-wayland-1.18.0/lib/libwayland-client.so.0+0x722a) Feb 09 04:04:17 vic waybar-start[1941]: #8 0x7ff41e04ff27 in wl_display_dispatch_queue_pending (/nix/store/43inp39xzl2ma7rpap2myaxr22q46sgf-wayland-1.18.0/lib/libwayland-client.so.0+0x7f27) Feb 09 04:04:17 vic waybar-start[1941]: #9 0x7ff41e04ff48 in wl_display_dispatch_pending (/nix/store/43inp39xzl2ma7rpap2myaxr22q46sgf-wayland-1.18.0/lib/libwayland-client.so.0+0x7f48) Feb 09 04:04:17 vic waybar-start[1941]: #10 0x7ff41ce5d983 in _gdk_wayland_display_queue_events (/nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0+0x71983) Feb 09 04:04:17 vic waybar-start[1941]: #11 0x7ff41ce256ff in gdk_display_get_event (/nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0+0x396ff) Feb 09 04:04:17 vic waybar-start[1941]: #12 0x7ff41ce5d681 in gdk_event_source_dispatch (/nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0+0x71681) Feb 09 04:04:17 vic waybar-start[1941]: #13 0x7ff41cadfa9a in g_main_context_dispatch (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0+0x54a9a) Feb 09 04:04:17 vic waybar-start[1941]: #14 0x7ff41cadfd47 in g_main_context_iterate.constprop.0 (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0+0x54d47) Feb 09 04:04:17 vic waybar-start[1941]: #15 0x7ff41cadfdfe in g_main_context_iteration (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0+0x54dfe) Feb 09 04:04:17 vic waybar-start[1941]: #16 0x7ff41ccf3da4 in g_application_run (/nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libgio-2.0.so.0+0xdbda4) Feb 09 04:04:17 vic waybar-start[1941]: #17 0x7ff41dce56d9 in Gtk::Application::run() /build/gtkmm-3.24.2/gtk/gtkmm/application.cc:171 Feb 09 04:04:17 vic waybar-start[1941]: #18 0x490063 in waybar::Client::main(int, char**) ../src/client.cpp:303 Feb 09 04:04:17 vic waybar-start[1941]: #19 0x46341f in main ../src/main.cpp:99 Feb 09 04:04:17 vic waybar-start[1941]: #20 0x7ff41c43fdec in __libc_start_main (/nix/store/gafigwfaimlziam6qhw1m8dz4h952g1n-glibc-2.32-35/lib/libc.so.6+0x27dec) Feb 09 04:04:17 vic waybar-start[1941]: #21 0x41d3d9 in _start (/nix/store/plim711a20fd5fpnr28bws8p4irslfy8-waybar-0.9.5.71f9ed3/bin/.waybar-wrapped+0x41d3d9) Feb 09 04:04:17 vic waybar-start[1941]: 0x60b000255220 is located 96 bytes inside of 104-byte region [0x60b0002551c0,0x60b000255228) Feb 09 04:04:17 vic waybar-start[1941]: freed by thread T0 here: Feb 09 04:04:17 vic waybar-start[1941]: #0 0x7ff41e109467 in operator delete(void*, unsigned long) (/nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6+0xaf467) Feb 09 04:04:17 vic waybar-start[1941]: #1 0x482fec in __gnu_cxx::new_allocator >::deallocate(std::_List_node*, unsigned long) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/ext/new_allocator.h:133 Feb 09 04:04:17 vic waybar-start[1941]: #2 0x482fec in std::allocator_traits > >::deallocate(std::allocator >&, std::_List_node*, unsigned long) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/alloc_traits.h:492 Feb 09 04:04:17 vic waybar-start[1941]: #3 0x482fec in std::__cxx11::_List_base >::_M_put_node(std::_List_node*) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/stl_list.h:446 Feb 09 04:04:17 vic waybar-start[1941]: #4 0x482fec in std::__cxx11::list >::_M_erase(std::_List_iterator) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/stl_list.h:1930 Feb 09 04:04:17 vic waybar-start[1941]: #5 0x482fec in remove_if):: > /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/list.tcc:545 Feb 09 04:04:17 vic waybar-start[1941]: #6 0x48aac6 in waybar::Client::handleMonitorRemoved(Glib::RefPtr) ../src/client.cpp:183 Feb 09 04:04:17 vic waybar-start[1941]: #7 0x49876b in sigc::bound_mem_functor1 >::operator()(Glib::RefPtr const&) const /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/mem_fun.h:2066 Feb 09 04:04:17 vic waybar-start[1941]: #8 0x49876b in sigc::adaptor_functor > >::deduce_result_type const&, void, void, void, void, void, void>::type sigc::adaptor_functor > >::operator() const&>(Glib::RefPtr const&) const /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:89 Feb 09 04:04:17 vic waybar-start[1941]: #9 0x49876b in sigc::internal::slot_call1 >, void, Glib::RefPtr const&>::call_it(sigc::internal::slot_rep*, Glib::RefPtr const&) /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot.h:170 Feb 09 04:04:17 vic waybar-start[1941]: #10 0x7ff41d97fd05 in sigc::slot1 const&>::operator()(Glib::RefPtr const&) const /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot.h:665 Feb 09 04:04:17 vic waybar-start[1941]: #11 0x7ff41d97fd05 in Display_signal_monitor_removed_callback /build/gtkmm-3.24.2/gdk/gdkmm/display.cc:219 Feb 09 04:04:17 vic waybar-start[1941]: previously allocated by thread T0 here: Feb 09 04:04:17 vic waybar-start[1941]: #0 0x7ff41e108647 in operator new(unsigned long) (/nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6+0xae647) Feb 09 04:04:17 vic waybar-start[1941]: #1 0x4835e0 in __gnu_cxx::new_allocator >::allocate(unsigned long, void const*) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/ext/new_allocator.h:115 Feb 09 04:04:17 vic waybar-start[1941]: #2 0x4835e0 in std::allocator_traits > >::allocate(std::allocator >&, unsigned long) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/alloc_traits.h:460 Feb 09 04:04:17 vic waybar-start[1941]: #3 0x4835e0 in std::__cxx11::_List_base >::_M_get_node() /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/stl_list.h:442 Feb 09 04:04:17 vic waybar-start[1941]: #4 0x4835e0 in std::_List_node* std::__cxx11::list >::_M_create_node<>() /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/stl_list.h:634 Feb 09 04:04:17 vic waybar-start[1941]: #5 0x4835e0 in void std::__cxx11::list >::_M_insert<>(std::_List_iterator) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/stl_list.h:1911 Feb 09 04:04:17 vic waybar-start[1941]: #6 0x4835e0 in waybar::waybar_output& std::__cxx11::list >::emplace_back<>() /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/stl_list.h:1227 Feb 09 04:04:17 vic waybar-start[1941]: #7 0x4835e0 in waybar::Client::handleMonitorAdded(Glib::RefPtr) ../src/client.cpp:165 Feb 09 04:04:17 vic waybar-start[1941]: #8 0x49876b in sigc::bound_mem_functor1 >::operator()(Glib::RefPtr const&) const /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/mem_fun.h:2066 Feb 09 04:04:17 vic waybar-start[1941]: #9 0x49876b in sigc::adaptor_functor > >::deduce_result_type const&, void, void, void, void, void, void>::type sigc::adaptor_functor > >::operator() const&>(Glib::RefPtr const&) const /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:89 Feb 09 04:04:17 vic waybar-start[1941]: #10 0x49876b in sigc::internal::slot_call1 >, void, Glib::RefPtr const&>::call_it(sigc::internal::slot_rep*, Glib::RefPtr const&) /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot.h:170 Feb 09 04:04:17 vic waybar-start[1941]: #11 0x7ff41d97fc23 in sigc::slot1 const&>::operator()(Glib::RefPtr const&) const /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot.h:665 Feb 09 04:04:17 vic waybar-start[1941]: #12 0x7ff41d97fc23 in Display_signal_monitor_added_callback /build/gtkmm-3.24.2/gdk/gdkmm/display.cc:189 Feb 09 04:04:17 vic waybar-start[1941]: SUMMARY: AddressSanitizer: heap-use-after-free /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/unique_ptr.h:179 in std::__uniq_ptr_impl::reset(zxdg_output_v1*) Feb 09 04:04:17 vic waybar-start[1941]: Shadow bytes around the buggy address: Feb 09 04:04:17 vic waybar-start[1941]: 0x0c16800429f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Feb 09 04:04:17 vic waybar-start[1941]: 0x0c1680042a00: fa fa fa fa fa fa fa fa fa fa fa fa fd fd fd fd Feb 09 04:04:17 vic waybar-start[1941]: 0x0c1680042a10: fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa Feb 09 04:04:17 vic waybar-start[1941]: 0x0c1680042a20: fa fa fd fd fd fd fd fd fd fd fd fd fd fd fd fa Feb 09 04:04:17 vic waybar-start[1941]: 0x0c1680042a30: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd Feb 09 04:04:17 vic waybar-start[1941]: =>0x0c1680042a40: fd fd fd fd[fd]fa fa fa fa fa fa fa fa fa fd fd Feb 09 04:04:17 vic waybar-start[1941]: 0x0c1680042a50: fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa Feb 09 04:04:17 vic waybar-start[1941]: 0x0c1680042a60: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd Feb 09 04:04:17 vic waybar-start[1941]: 0x0c1680042a70: fd fa fa fa fa fa fa fa fa fa fd fd fd fd fd fd Feb 09 04:04:17 vic waybar-start[1941]: 0x0c1680042a80: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa Feb 09 04:04:17 vic waybar-start[1941]: 0x0c1680042a90: fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa Feb 09 04:04:17 vic waybar-start[1941]: Shadow byte legend (one shadow byte represents 8 application bytes): Feb 09 04:04:17 vic waybar-start[1941]: Addressable: 00 Feb 09 04:04:17 vic waybar-start[1941]: Partially addressable: 01 02 03 04 05 06 07 Feb 09 04:04:17 vic waybar-start[1941]: Heap left redzone: fa Feb 09 04:04:17 vic waybar-start[1941]: Freed heap region: fd Feb 09 04:04:17 vic waybar-start[1941]: Stack left redzone: f1 Feb 09 04:04:17 vic waybar-start[1941]: Stack mid redzone: f2 Feb 09 04:04:17 vic waybar-start[1941]: Stack right redzone: f3 Feb 09 04:04:17 vic waybar-start[1941]: Stack after return: f5 Feb 09 04:04:17 vic waybar-start[1941]: Stack use after scope: f8 Feb 09 04:04:17 vic waybar-start[1941]: Global redzone: f9 Feb 09 04:04:17 vic waybar-start[1941]: Global init order: f6 Feb 09 04:04:17 vic waybar-start[1941]: Poisoned by user: f7 Feb 09 04:04:17 vic waybar-start[1941]: Container overflow: fc Feb 09 04:04:17 vic waybar-start[1941]: Array cookie: ac Feb 09 04:04:17 vic waybar-start[1941]: Intra object redzone: bb Feb 09 04:04:17 vic waybar-start[1941]: ASan internal: fe Feb 09 04:04:17 vic waybar-start[1941]: Left alloca redzone: ca Feb 09 04:04:17 vic waybar-start[1941]: Right alloca redzone: cb Feb 09 04:04:17 vic waybar-start[1941]: Shadow gap: cc Feb 09 04:04:17 vic waybar-start[1941]: ==1941==ABORTING ```

coredump bt:

``` (gdb) bt full #0 0x00007ff41c45433a in raise () from /nix/store/gafigwfaimlziam6qhw1m8dz4h952g1n-glibc-2.32-35/lib/libc.so.6 No symbol table info available. #1 0x00007ff41c43e523 in abort () from /nix/store/gafigwfaimlziam6qhw1m8dz4h952g1n-glibc-2.32-35/lib/libc.so.6 No symbol table info available. #2 0x00007ff41e12212b in ?? () from /nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6 No symbol table info available. #3 0x00007ff41e12ccf8 in ?? () from /nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6 No symbol table info available. #4 0x00007ff41e10f44c in ?? () from /nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6 No symbol table info available. #5 0x00007ff41e10ed47 in ?? () from /nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6 No symbol table info available. #6 0x00007ff41e10f938 in __asan_report_load8 () from /nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6 No symbol table info available. #7 0x000000000048bf93 in std::__uniq_ptr_impl::reset (__p=0x0, this=0x60b000255218) at /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/unique_ptr.h:179 __old_p = __old_p = #8 std::unique_ptr::reset (__p=0x0, this=0x60b000255218) at /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/unique_ptr.h:456 No locals. #9 waybar::Client::handleOutputDone (data=) at ../src/client.cpp:132 output = @0x60b0002551d0: {monitor = {pCppObject_ = 0x604001156c90}, name = {static npos = 18446744073709551615, _M_dataplus = {> = {<__gnu_cxx::new_allocator> = {}, }, _M_p = 0x60b0002551e8 "HDMI-A-1"}, _M_string_length = 8, {_M_local_buf = "HDMI-A-1\000\000\000\000\000\000\000", _M_allocated_capacity = 3543560144569582664}}, identifier = {static npos = 18446744073709551615, _M_dataplus = {> = {<__gnu_cxx::new_allocator> = {}, }, _M_p = 0x604003e5dfd0 "#"}, _M_string_length = 34, {_M_local_buf = "\"", '\000' , _M_allocated_capacity = 34}}, xdg_output = { _M_t = {> = {_M_t = {> = {> = {> = { _M_head_impl = 0x482895 }, }, > = {_M_head_impl = 0x0}, }, }}, }}} configs = { >> = { _M_impl = {> = {<__gnu_cxx::new_allocator> = {}, }, >::_Vector_impl_data> = {_M_start = , _M_finish = , _M_end_of_storage = }, }}, } client = 0x60e0000003c0 #10 0x00007ff41c400b2d in ffi_call_unix64 () from /nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7 No symbol table info available. #11 0x00007ff41c3ff83c in ffi_call_int () from /nix/store/z1kwafc0yf8jzhmm8f0j72nc196jl1sq-libffi-3.3/lib/libffi.so.7 No symbol table info available. #12 0x00007ff41e0517eb in wl_closure_invoke () from /nix/store/43inp39xzl2ma7rpap2myaxr22q46sgf-wayland-1.18.0/lib/libwayland-client.so.0 No symbol table info available. #13 0x00007ff41e04f1af in dispatch_event () from /nix/store/43inp39xzl2ma7rpap2myaxr22q46sgf-wayland-1.18.0/lib/libwayland-client.so.0 No symbol table info available. #14 0x00007ff41e04f22b in dispatch_queue () from /nix/store/43inp39xzl2ma7rpap2myaxr22q46sgf-wayland-1.18.0/lib/libwayland-client.so.0 No symbol table info available. #15 0x00007ff41e04ff28 in wl_display_dispatch_queue_pending () from /nix/store/43inp39xzl2ma7rpap2myaxr22q46sgf-wayland-1.18.0/lib/libwayland-client.so.0 No symbol table info available. #16 0x00007ff41e04ff49 in wl_display_dispatch_pending () from /nix/store/43inp39xzl2ma7rpap2myaxr22q46sgf-wayland-1.18.0/lib/libwayland-client.so.0 No symbol table info available. #17 0x00007ff41ce5d984 in _gdk_wayland_display_queue_events () from /nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0 No symbol table info available. #18 0x00007ff41ce25700 in gdk_display_get_event () from /nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0 No symbol table info available. #19 0x00007ff41ce5d682 in gdk_event_source_dispatch () from /nix/store/8pidhwid3ww58wlq705irf48c01dr0hv-gtk+3-3.24.24/lib/libgdk-3.so.0 No symbol table info available. #20 0x00007ff41cadfa9b in g_main_context_dispatch () from /nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0 No symbol table info available. #21 0x00007ff41cadfd48 in g_main_context_iterate.constprop () from /nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0 No symbol table info available. #22 0x00007ff41cadfdff in g_main_context_iteration () from /nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libglib-2.0.so.0 No symbol table info available. #23 0x00007ff41ccf3da5 in g_application_run () from /nix/store/hnk0s558k2h4v8abjzagagflvw1l0cb2-glib-2.66.4/lib/libgio-2.0.so.0 No symbol table info available. #24 0x00007ff41dce56da in Gtk::Application::run (this=) at application.cc:171 result = 0 #25 0x0000000000490064 in waybar::Client::main (this=this@entry=0x60e0000003c0, argc=, argc@entry=7, argv=, argv@entry=0x7fff35723058) at ../src/client.cpp:303 show_help = show_version = config = {static npos = 18446744073709551615, _M_dataplus = {> = {<__gnu_cxx::new_allocator> = {}, }, _M_p = }, _M_string_length = , {_M_local_buf = { }, _M_allocated_capacity = }} style = {static npos = 18446744073709551615, _M_dataplus = {> = {<__gnu_cxx::new_allocator> = {}, }, _M_p = }, _M_string_length = , {_M_local_buf = { }, _M_allocated_capacity = }} bar_id = {static npos = 18446744073709551615, _M_dataplus = {> = {<__gnu_cxx::new_allocator> = {}, }, _M_p = }, _M_string_length = , {_M_local_buf = { }, _M_allocated_capacity = }} log_level = {static npos = 18446744073709551615, _M_dataplus = {> = {<__gnu_cxx::new_allocator> = {}, }, _M_p = }, _M_string_length = , {_M_local_buf = { }, _M_allocated_capacity = }} cli = { = {_vptr.ParserBase = }, m_exeName = {> = { = {_vptr.ParserBase = }, }, m_name = {, std::allocator >, (__gnu_cxx::_Lock_policy)2>> = {, std::allocator >, (__gnu_cxx::_Lock_policy)2, false, false>> = {}, _M_ptr = , _M_refcount = {_M_pi = }}, }, m_ref = {> = {> = {}, _M_ptr = , _M_refcount = { _M_pi = }}, }}, m_options = { >> = { _M_impl = {> = {<__gnu_cxx::new_allocator> = {}, }, >::_Vector_impl_data> = {_M_start = , _M_finish = , _M_end_of_storage = }, }}, }, m_args = { >> = { _M_impl = {> = {<__gnu_cxx::new_allocator> = {}, }, >::_Vector_impl_data> = {_M_start = , _M_finish = , _M_end_of_storage = }, }}, }} res = {> = { = {_vptr.ResultBase = , m_type = }, {m_value = {m_type = , m_remainingTokens = {it = {_M_current = }, itEnd = { _M_current = }, m_tokenBuffer = { >> = { _M_impl = {> = {<__gnu_cxx::new_allocator> = {}, }, >::_Vector_impl_data> = { _M_start = , _M_finish = , _M_end_of_storage = }, }}, }}}}}, m_errorMessage = {static npos = 18446744073709551615, _M_dataplus = {> = {<__gnu_cxx::new_allocator> = {}, }, _M_p = }, _M_string_length = , {_M_local_buf = { }, _M_allocated_capacity = }}} config_file = @0x7fff357227d0: {static npos = 18446744073709551615, _M_dataplus = {> = {<__gnu_cxx::new_allocator> = {}, }, _M_p = 0x6060000c1fa0 "/nix/store/hi6l2j1fb5ls1q84vcgzrax6v9w4c7g5-waybar_conf.json"}, _M_string_length = 60, {_M_local_buf = "<", '\000' , _M_allocated_capacity = 60}} css_file = @0x7fff357227b0: {static npos = 18446744073709551615, _M_dataplus = {> = {<__gnu_cxx::new_allocator> = {}, }, _M_p = 0x6060000c1f40 "/nix/store/68p5zz5prq4825yjb1ijy526avycqf25-waybar_style.css"}, _M_string_length = 60, {_M_local_buf = "<", '\000' , _M_allocated_capacity = 60}} #26 0x0000000000463420 in main (argc=, argv=0x7fff35723058) at ../src/main.cpp:99 client = 0x60e0000003c0 ret = ```

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));
       }
alebastr commented 3 years ago

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.

baloo commented 3 years ago

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):

``` Feb 10 02:32:07 vic waybar-start[13072]: ================================================================= Feb 10 02:32:07 vic waybar-start[13072]: ==13072==ERROR: AddressSanitizer: heap-use-after-free on address 0x60b0003a15a0 at pc 0x0000005548db bp 0x7fffe1f0f200 sp 0x7fffe1f0f1f8 Feb 10 02:32:07 vic waybar-start[13072]: READ of size 8 at 0x60b0003a15a0 thread T0 Feb 10 02:32:07 vic waybar-start[13072]: #0 0x5548da in std::__cxx11::basic_string, std::allocator >::size() const /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/basic_string.h:902 Feb 10 02:32:07 vic waybar-start[13072]: #1 0x5548da in __gnu_cxx::__enable_if::__value, bool>::__type std::operator==(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/basic_string.h:6163 Feb 10 02:32:07 vic waybar-start[13072]: #2 0x5548da in waybar::modules::sway::Workspaces::update() ../src/modules/sway/workspaces.cpp:216 Feb 10 02:32:07 vic waybar-start[13072]: #3 0x467ee8 in operator() ../src/bar.cpp:578 Feb 10 02:32:07 vic waybar-start[13072]: #4 0x467ee8 in operator() /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:256 Feb 10 02:32:07 vic waybar-start[13072]: #5 0x46839b in call_it /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot.h:136 Feb 10 02:32:07 vic waybar-start[13072]: #6 0x7f0cc6e40c49 in sigc::internal::signal_emit0::emit(sigc::internal::signal_impl*) (/nix/store/xkw8aqbg4kwni98v5sp9gay93axxxfv9-glibmm-2.64.2/lib/libglibmm-2.4.so.1+0x62c49) Feb 10 02:32:07 vic waybar-start[13072]: #7 0x7f0cc6e404b5 in Glib::DispatchNotifier::pipe_io_handler(Glib::IOCondition) (/nix/store/xkw8aqbg4kwni98v5sp9gay93axxxfv9-glibmm-2.64.2/lib/libglibmm-2.4.so.1+0x624b5) Feb 10 02:32:07 vic waybar-start[13072]: #8 0x7f0cc6e42bab in Glib::IOSource::dispatch(sigc::slot_base*) (/nix/store/xkw8aqbg4kwni98v5sp9gay93axxxfv9-glibmm-2.64.2/lib/libglibmm-2.4.so.1+0x64bab) Feb 10 02:32:07 vic waybar-start[13072]: #9 0x7f0cc6e426ee in Glib::Source::dispatch_vfunc(_GSource*, int (*)(void*), void*) (/nix/store/xkw8aqbg4kwni98v5sp9gay93axxxfv9-glibmm-2.64.2/lib/libglibmm-2.4.so.1+0x646ee) Feb 10 02:32:07 vic waybar-start[13072]: #10 0x7f0cc620899e in g_main_context_dispatch (/nix/store/m4sv37d5gvhvqiylchkhmq0r0b610iln-glib-2.66.4/lib/libglib-2.0.so.0+0x5499e) Feb 10 02:32:07 vic waybar-start[13072]: #11 0x7f0cc6208d47 in g_main_context_iterate.constprop.0 (/nix/store/m4sv37d5gvhvqiylchkhmq0r0b610iln-glib-2.66.4/lib/libglib-2.0.so.0+0x54d47) Feb 10 02:32:07 vic waybar-start[13072]: #12 0x7f0cc6208dfe in g_main_context_iteration (/nix/store/m4sv37d5gvhvqiylchkhmq0r0b610iln-glib-2.66.4/lib/libglib-2.0.so.0+0x54dfe) Feb 10 02:32:07 vic waybar-start[13072]: #13 0x7f0cc641cda4 in g_application_run (/nix/store/m4sv37d5gvhvqiylchkhmq0r0b610iln-glib-2.66.4/lib/libgio-2.0.so.0+0xdbda4) Feb 10 02:32:07 vic waybar-start[13072]: #14 0x7f0cc740e6d9 in Gtk::Application::run() /build/gtkmm-3.24.2/gtk/gtkmm/application.cc:171 Feb 10 02:32:07 vic waybar-start[13072]: #15 0x490091 in waybar::Client::main(int, char**) ../src/client.cpp:313 Feb 10 02:32:07 vic waybar-start[13072]: #16 0x46343f in main ../src/main.cpp:99 Feb 10 02:32:07 vic waybar-start[13072]: #17 0x7f0cc5b68dec in __libc_start_main (/nix/store/gafigwfaimlziam6qhw1m8dz4h952g1n-glibc-2.32-35/lib/libc.so.6+0x27dec) Feb 10 02:32:07 vic waybar-start[13072]: #18 0x41d3f9 in _start (/nix/store/3nmczda8gqhpxwb94caqhzpxy45y1h1r-waybar-0.9.5.c5f875d/bin/.waybar-wrapped+0x41d3f9) Feb 10 02:32:07 vic waybar-start[13072]: 0x60b0003a15a0 is located 32 bytes inside of 104-byte region [0x60b0003a1580,0x60b0003a15e8) Feb 10 02:32:07 vic waybar-start[13072]: freed by thread T0 here: Feb 10 02:32:07 vic waybar-start[13072]: #0 0x7f0cc7832467 in operator delete(void*, unsigned long) (/nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6+0xaf467) Feb 10 02:32:07 vic waybar-start[13072]: #1 0x48300c in __gnu_cxx::new_allocator >::deallocate(std::_List_node*, unsigned long) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/ext/new_allocator.h:133 Feb 10 02:32:07 vic waybar-start[13072]: #2 0x48300c in std::allocator_traits > >::deallocate(std::allocator >&, std::_List_node*, unsigned long) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/alloc_traits.h:492 Feb 10 02:32:07 vic waybar-start[13072]: #3 0x48300c in std::__cxx11::_List_base >::_M_put_node(std::_List_node*) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/stl_list.h:446 Feb 10 02:32:07 vic waybar-start[13072]: #4 0x48300c in std::__cxx11::list >::_M_erase(std::_List_iterator) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/stl_list.h:1930 Feb 10 02:32:07 vic waybar-start[13072]: #5 0x48300c in remove_if):: > /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/list.tcc:545 Feb 10 02:32:07 vic waybar-start[13072]: #6 0x48aae6 in waybar::Client::handleMonitorRemoved(Glib::RefPtr) ../src/client.cpp:193 Feb 10 02:32:07 vic waybar-start[13072]: #7 0x498799 in sigc::bound_mem_functor1 >::operator()(Glib::RefPtr const&) const /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/mem_fun.h:2066 Feb 10 02:32:07 vic waybar-start[13072]: #8 0x498799 in sigc::adaptor_functor > >::deduce_result_type const&, void, void, void, void, void, void>::type sigc::adaptor_functor > >::operator() const&>(Glib::RefPtr const&) const /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:89 Feb 10 02:32:07 vic waybar-start[13072]: #9 0x498799 in sigc::internal::slot_call1 >, void, Glib::RefPtr const&>::call_it(sigc::internal::slot_rep*, Glib::RefPtr const&) /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot.h:170 Feb 10 02:32:07 vic waybar-start[13072]: #10 0x7f0cc70a8d05 in sigc::slot1 const&>::operator()(Glib::RefPtr const&) const /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot.h:665 Feb 10 02:32:07 vic waybar-start[13072]: #11 0x7f0cc70a8d05 in Display_signal_monitor_removed_callback /build/gtkmm-3.24.2/gdk/gdkmm/display.cc:219 Feb 10 02:32:07 vic waybar-start[13072]: previously allocated by thread T0 here: Feb 10 02:32:07 vic waybar-start[13072]: #0 0x7f0cc7831647 in operator new(unsigned long) (/nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6+0xae647) Feb 10 02:32:07 vic waybar-start[13072]: #1 0x483600 in __gnu_cxx::new_allocator >::allocate(unsigned long, void const*) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/ext/new_allocator.h:115 Feb 10 02:32:07 vic waybar-start[13072]: #2 0x483600 in std::allocator_traits > >::allocate(std::allocator >&, unsigned long) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/alloc_traits.h:460 Feb 10 02:32:07 vic waybar-start[13072]: #3 0x483600 in std::__cxx11::_List_base >::_M_get_node() /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/stl_list.h:442 Feb 10 02:32:07 vic waybar-start[13072]: #4 0x483600 in std::_List_node* std::__cxx11::list >::_M_create_node<>() /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/stl_list.h:634 Feb 10 02:32:07 vic waybar-start[13072]: #5 0x483600 in void std::__cxx11::list >::_M_insert<>(std::_List_iterator) /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/stl_list.h:1911 Feb 10 02:32:07 vic waybar-start[13072]: #6 0x483600 in waybar::waybar_output& std::__cxx11::list >::emplace_back<>() /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/stl_list.h:1227 Feb 10 02:32:07 vic waybar-start[13072]: #7 0x483600 in waybar::Client::handleMonitorAdded(Glib::RefPtr) ../src/client.cpp:175 Feb 10 02:32:07 vic waybar-start[13072]: #8 0x498799 in sigc::bound_mem_functor1 >::operator()(Glib::RefPtr const&) const /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/mem_fun.h:2066 Feb 10 02:32:07 vic waybar-start[13072]: #9 0x498799 in sigc::adaptor_functor > >::deduce_result_type const&, void, void, void, void, void, void>::type sigc::adaptor_functor > >::operator() const&>(Glib::RefPtr const&) const /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:89 Feb 10 02:32:07 vic waybar-start[13072]: #10 0x498799 in sigc::internal::slot_call1 >, void, Glib::RefPtr const&>::call_it(sigc::internal::slot_rep*, Glib::RefPtr const&) /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot.h:170 Feb 10 02:32:07 vic waybar-start[13072]: #11 0x7f0cc70a8c23 in sigc::slot1 const&>::operator()(Glib::RefPtr const&) const /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot.h:665 Feb 10 02:32:07 vic waybar-start[13072]: #12 0x7f0cc70a8c23 in Display_signal_monitor_added_callback /build/gtkmm-3.24.2/gdk/gdkmm/display.cc:189 Feb 10 02:32:07 vic waybar-start[13072]: SUMMARY: AddressSanitizer: heap-use-after-free /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/basic_string.h:902 in std::__cxx11::basic_string, std::allocator >::size() const Feb 10 02:32:07 vic waybar-start[13072]: Shadow bytes around the buggy address: Feb 10 02:32:07 vic waybar-start[13072]: 0x0c168006c260: fd fd fd fd fd fa fa fa fa fa fa fa fa fa fd fd Feb 10 02:32:07 vic waybar-start[13072]: 0x0c168006c270: fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa Feb 10 02:32:07 vic waybar-start[13072]: 0x0c168006c280: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd Feb 10 02:32:07 vic waybar-start[13072]: 0x0c168006c290: fd fa fa fa fa fa fa fa fa fa fd fd fd fd fd fd Feb 10 02:32:07 vic waybar-start[13072]: 0x0c168006c2a0: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa Feb 10 02:32:07 vic waybar-start[13072]: =>0x0c168006c2b0: fd fd fd fd[fd]fd fd fd fd fd fd fd fd fa fa fa Feb 10 02:32:07 vic waybar-start[13072]: 0x0c168006c2c0: fa fa fa fa fa fa fd fd fd fd fd fd fd fd fd fd Feb 10 02:32:07 vic waybar-start[13072]: 0x0c168006c2d0: fd fd fd fa fa fa fa fa fa fa fa fa fd fd fd fd Feb 10 02:32:07 vic waybar-start[13072]: 0x0c168006c2e0: fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa Feb 10 02:32:07 vic waybar-start[13072]: 0x0c168006c2f0: fa fa fd fd fd fd fd fd fd fd fd fd fd fd fd fa Feb 10 02:32:07 vic waybar-start[13072]: 0x0c168006c300: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd Feb 10 02:32:07 vic waybar-start[13072]: Shadow byte legend (one shadow byte represents 8 application bytes): Feb 10 02:32:07 vic waybar-start[13072]: Addressable: 00 Feb 10 02:32:07 vic waybar-start[13072]: Partially addressable: 01 02 03 04 05 06 07 Feb 10 02:32:07 vic waybar-start[13072]: Heap left redzone: fa Feb 10 02:32:07 vic waybar-start[13072]: Freed heap region: fd Feb 10 02:32:07 vic waybar-start[13072]: Stack left redzone: f1 Feb 10 02:32:07 vic waybar-start[13072]: Stack mid redzone: f2 Feb 10 02:32:07 vic waybar-start[13072]: Stack right redzone: f3 Feb 10 02:32:07 vic waybar-start[13072]: Stack after return: f5 Feb 10 02:32:07 vic waybar-start[13072]: Stack use after scope: f8 Feb 10 02:32:07 vic waybar-start[13072]: Global redzone: f9 Feb 10 02:32:07 vic waybar-start[13072]: Global init order: f6 Feb 10 02:32:07 vic waybar-start[13072]: Poisoned by user: f7 Feb 10 02:32:07 vic waybar-start[13072]: Container overflow: fc Feb 10 02:32:07 vic waybar-start[13072]: Array cookie: ac Feb 10 02:32:07 vic waybar-start[13072]: Intra object redzone: bb Feb 10 02:32:07 vic waybar-start[13072]: ASan internal: fe Feb 10 02:32:07 vic waybar-start[13072]: Left alloca redzone: ca Feb 10 02:32:07 vic waybar-start[13072]: Right alloca redzone: cb Feb 10 02:32:07 vic waybar-start[13072]: Shadow gap: cc Feb 10 02:32:07 vic waybar-start[13072]: ==13072==ABORTING ```

bt full:

``` #0 0x00007f0cc5b7d33a in raise () from /nix/store/gafigwfaimlziam6qhw1m8dz4h952g1n-glibc-2.32-35/lib/libc.so.6 [Current thread is 1 (Thread 0x7f0cc2023000 (LWP 13072))] (gdb) bt full #0 0x00007f0cc5b7d33a in raise () from /nix/store/gafigwfaimlziam6qhw1m8dz4h952g1n-glibc-2.32-35/lib/libc.so.6 No symbol table info available. #1 0x00007f0cc5b67523 in abort () from /nix/store/gafigwfaimlziam6qhw1m8dz4h952g1n-glibc-2.32-35/lib/libc.so.6 No symbol table info available. #2 0x00007f0cc784b12b in ?? () from /nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6 No symbol table info available. #3 0x00007f0cc7855cf8 in ?? () from /nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6 No symbol table info available. #4 0x00007f0cc783844c in ?? () from /nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6 No symbol table info available. #5 0x00007f0cc7837d47 in ?? () from /nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6 No symbol table info available. #6 0x00007f0cc7838938 in __asan_report_load8 () from /nix/store/sipmc4wnbcws4vahqlf5i06zz7xgnp23-gcc-10.2.0-lib/lib/libasan.so.6 No symbol table info available. #7 0x00000000005548db in std::__cxx11::basic_string, std::allocator >::size (this=0x60b0003a1598) at /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/basic_string.h:902 No locals. #8 std::operator== (__rhs="HDMI-A-1", __lhs="HDMI-A-1") at /nix/store/9rmf9whh2m8fqlqp859d8pmsb63jarsp-gcc-10.2.0/include/c++/10.2.0/bits/basic_string.h:6163 No locals. #9 waybar::modules::sway::Workspaces::update (this=0x6170000e9000) at ../src/modules/sway/workspaces.cpp:216 bit = {, std::allocator > const, Gtk::Button>, true>> = {_M_cur = }, } button = @0x60c0017ef268: { = { = { = { = { = {}, static object_class_ = { = {gtype_ = 0, class_init_func_ = 0x0, static iface_properties_quark = 51}, }, referenced_ = true, gobject_disposed_ = false}, = { = {}, static buildable_class_ = { = { = {gtype_ = 106102872105504, class_init_func_ = 0x7f0cc7414eae , static iface_properties_quark = 51}, }, }}, = {}, static widget_class_ = { = { gtype_ = 106309030554304, class_init_func_ = 0x7f0cc74c9606 , static iface_properties_quark = 51}, }}, static container_class_ = { = {gtype_ = 106377750014848, class_init_func_ = 0x7f0cc74317ce , static iface_properties_quark = 51}, }}, static bin_class_ = { = {gtype_ = 106377750012352, class_init_func_ = 0x7f0cc741362e , static iface_properties_quark = 51}, }}, = { = {}, static activatable_class_ = { = { = {gtype_ = 106102872106784, class_init_func_ = 0x7f0cc7408f5e , static iface_properties_quark = 51}, }, }}, static button_class_ = { = {gtype_ = 106446469478064, class_init_func_ = 0x7f0cc7417a90 , static iface_properties_quark = 51}, }} Python Exception value has been optimized out: output = Python Exception value has been optimized out: it = lock = {_M_device = } needReorder = true #10 0x0000000000467ee9 in operator() (__closure=0x606000a12730) at ../src/bar.cpp:578 name = @0x6080029ab8d0: {static null = @0x7f0cc76aa060, static nullRef = @0x7f0cc76aa060, static minLargestInt = -9223372036854775808, static maxLargestInt = 9223372036854775807, static maxLargestUInt = 18446744073709551615, static minInt = -2147483648, static maxInt = 2147483647, static maxUInt = 4294967295, static minInt64 = -9223372036854775808, static maxInt64 = 9223372036854775807, static maxUInt64 = 18446744073709551615, static defaultRealPrecision = 17, static maxUInt64AsDouble = 1.8446744073709552e+19, value_ = { int_ = 105759338162224, uint_ = 105759338162224, real_ = 5.2252055712861993e-310, bool_ = 48, string_ = 0x603003c86830 "\017", map_ = 0x603003c86830}, bits_ = {value_type_ = 4, allocated_ = 1}, comments_ = { ptr_ = std::unique_ptr, std::allocator >, 3>> = {get() = 0x0}}, start_ = 80, limit_ = 97} module = 0x6170000e9000 name = module = e = #11 sigc::adaptor_functor >::operator()(void) const (this=0x606000a12730) at /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:256 No locals. #12 0x000000000046839c in sigc::internal::slot_call0, void>::call_it(sigc::internal::slot_rep *) (rep=) at /nix/store/fxh1f3xhfvbxj95ldkizqm7af9ngk22n-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot.h:136 typed_rep = #13 0x00007f0cc6e40c4a in sigc::internal::signal_emit0::emit(sigc::internal::signal_impl*) () from /nix/store/xkw8aqbg4kwni98v5sp9gay93axxxfv9-glibmm-2.64.2/lib/libglibmm-2.4.so.1 No symbol table info available. #14 0x00007f0cc6e404b6 in Glib::DispatchNotifier::pipe_io_handler(Glib::IOCondition) () from /nix/store/xkw8aqbg4kwni98v5sp9gay93axxxfv9-glibmm-2.64.2/lib/libglibmm-2.4.so.1 No symbol table info available. #15 0x00007f0cc6e42bac in Glib::IOSource::dispatch(sigc::slot_base*) () from /nix/store/xkw8aqbg4kwni98v5sp9gay93axxxfv9-glibmm-2.64.2/lib/libglibmm-2.4.so.1 No symbol table info available. #16 0x00007f0cc6e426ef in Glib::Source::dispatch_vfunc(_GSource*, int (*)(void*), void*) () from /nix/store/xkw8aqbg4kwni98v5sp9gay93axxxfv9-glibmm-2.64.2/lib/libglibmm-2.4.so.1 No symbol table info available. #17 0x00007f0cc620899f in g_main_context_dispatch () from /nix/store/m4sv37d5gvhvqiylchkhmq0r0b610iln-glib-2.66.4/lib/libglib-2.0.so.0 No symbol table info available. #18 0x00007f0cc6208d48 in g_main_context_iterate.constprop () from /nix/store/m4sv37d5gvhvqiylchkhmq0r0b610iln-glib-2.66.4/lib/libglib-2.0.so.0 No symbol table info available. #19 0x00007f0cc6208dff in g_main_context_iteration () from /nix/store/m4sv37d5gvhvqiylchkhmq0r0b610iln-glib-2.66.4/lib/libglib-2.0.so.0 No symbol table info available. #20 0x00007f0cc641cda5 in g_application_run () from /nix/store/m4sv37d5gvhvqiylchkhmq0r0b610iln-glib-2.66.4/lib/libgio-2.0.so.0 No symbol table info available. #21 0x00007f0cc740e6da in Gtk::Application::run (this=) at application.cc:171 result = 0 #22 0x0000000000490092 in waybar::Client::main (this=this@entry=0x60e0000003c0, argc=, argc@entry=7, argv=, argv@entry=0x7fffe1f119f8) at ../src/client.cpp:313 show_help = show_version = Python Exception value has been optimized out: config = Python Exception value has been optimized out: style = Python Exception value has been optimized out: bar_id = Python Exception value has been optimized out: log_level = cli = { = {_vptr.ParserBase = }, m_exeName = {> = { = {_vptr.ParserBase = }, }, Python Exception value has been optimized out: m_name = , Python Exception value has been optimized out: m_ref = }, Python Exception value has been optimized out: m_options = , Python Exception value has been optimized out: m_args = } res = {> = { = {_vptr.ResultBase = , m_type = }, {m_value = {m_type = , m_remainingTokens = {Python Exception value has been optimized out: it = , Python Exception value has been optimized out: itEnd = , Python Exception value has been optimized out: m_tokenBuffer = }}}}, Python Exception value has been optimized out: m_errorMessage = } config_file = @0x7fffe1f11170: "/nix/store/hi6l2j1fb5ls1q84vcgzrax6v9w4c7g5-waybar_conf.json" css_file = @0x7fffe1f11150: "/nix/store/68p5zz5prq4825yjb1ijy526avycqf25-waybar_style.css" #23 0x0000000000463440 in main (argc=, argv=0x7fffe1f119f8) at ../src/main.cpp:99 client = 0x60e0000003c0 ret = ```
alebastr commented 3 years ago

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.

baloo commented 3 years ago

@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 :/

alebastr commented 3 years ago

Any chance you'd know where to capture either the output name or the serial number of the output?

Yes, see updated gist contents.