Alexays / Waybar

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

Waybar crashes when all monitors are disabled in Wayland/sway #1674

Closed oniGino closed 4 months ago

oniGino commented 2 years ago

Either on sleep or wake waybar crashes

running Gentoo sway-1.7-r2 waybar-0.9.13

Aug 31 10:07:19 GreySoap systemd-coredump[21541]: [🡕] Process 59504 (waybar) of user 1000 dumped core.

                                                  Module linux-vdso.so.1 with build-id 5e87319bd29b89d4eea13c3ff14785367a33075d
                                                  Module libgvfscommon.so without build-id.
                                                  Module libgvfsdbus.so without build-id.
                                                  Module libdconfsettings.so without build-id.
                                                  Module libmd.so.0 without build-id.
                                                  Module libgpg-error.so.0 without build-id.
                                                  Module libbsd.so.0 without build-id.
                                                  Module libicudata.so.71 without build-id.
                                                  Module libresolv.so.2 without build-id.
                                                  Module liblz4.so.1 without build-id.
                                                  Module libzstd.so.1 without build-id.
                                                  Module libgcrypt.so.20 without build-id.
                                                  Module libcap.so.2 without build-id.
                                                  Module libGLX.so.0 without build-id.
                                                  Module libdl.so.2 without build-id.
                                                  Module libGLdispatch.so.0 without build-id.
                                                  Module libbz2.so.1 without build-id.
                                                  Module libXdmcp.so.6 without build-id.
                                                  Module libXau.so.6 without build-id.
                                                  Module liblzma.so.5 without build-id.
                                                  Module libicuuc.so.71 without build-id.
                                                  Module libasyncns.so.0 without build-id.
                                                  Module libsystemd.so.0 without build-id.
                                                  Module libsndfile.so.1 without build-id.
                                                  Module libblkid.so.1 without build-id.
                                                  Module libexpat.so.1 without build-id.
                                                  Module libgraphite2.so.3 without build-id.
                                                  Module libpthread.so.0 without build-id.
                                                  Module libatspi.so.0 without build-id.
                                                  Module libGL.so.1 without build-id.
                                                  Module libXrender.so.1 without build-id.
                                                  Module libxcb-render.so.0 without build-id.
                                                  Module libxcb-shm.so.0 without build-id.
                                                  Module libEGL.so.1 without build-id.
                                                  Module libfreetype.so.6 without build-id.
                                                  Module libpixman-1.so.0 without build-id.
                                                  Module libxcb.so.1 without build-id.
                                                  Module libjpeg.so.62 without build-id.
                                                  Module libpng16.so.16 without build-id.
                                                  Module libxml2.so.2 without build-id.
                                                  Module libdbus-1.so.3 without build-id.
                                                  Module libpulsecommon-16.1.so without build-id.
                                                  Module libdbusmenu-glib.so.4 without build-id.
                                                  Module libpcre.so.1 without build-id.
                                                  Module libmount.so.1 without build-id.
                                                  Module libz.so.1 without build-id.
                                                  Module libXext.so.6 without build-id.
                                                  Module libwayland-egl.so.1 without build-id.
                                                  Module libwayland-cursor.so.0 without build-id.
                                                  Module libxkbcommon.so.0 without build-id.
                                                  Module libXdamage.so.1 without build-id.
                                                  Module libXcomposite.so.1 without build-id.
                                                  Module libXcursor.so.1 without build-id.
                                                  Module libXrandr.so.2 without build-id.
                                                  Module libfontconfig.so.1 without build-id.
                                                  Module libharfbuzz.so.0 without build-id.
                                                  Module libpango-1.0.so.0 without build-id.
                                                  Module libpangoft2-1.0.so.0 without build-id.
                                                  Module libfribidi.so.0 without build-id.
                                                  Module libepoxy.so.0 without build-id.
                                                  Module libatk-bridge-2.0.so.0 without build-id.
                                                  Module libcairo.so.2 without build-id.
                                                  Module libcairo-gobject.so.2 without build-id.
                                                  Module libXfixes.so.3 without build-id.
                                                  Module libXi.so.6 without build-id.
                                                  Module libX11.so.6 without build-id.
                                                  Module libpangocairo-1.0.so.0 without build-id.
                                                  Module libgmodule-2.0.so.0 without build-id.
                                                  Module libgdk_pixbuf-2.0.so.0 without build-id.
                                                  Module libatk-1.0.so.0 without build-id.
                                                  Module libpangomm-1.4.so.1 without build-id.
                                                  Module libgcc_s.so.1 without build-id.
                                                  Module ld-linux-x86-64.so.2 without build-id.
                                                  Module libffi.so.8 without build-id.
                                                  Module libc.so.6 without build-id.
                                                  Module libunwind.so.1 without build-id.
                                                  Module libm.so.6 without build-id.
                                                  Module libstdc++.so.6 without build-id.
                                                  Module libxkbregistry.so.0 without build-id.
                                                  Module libdate-tz.so.3.0.0 without build-id.
                                                  Module libgtk-layer-shell.so.0 without build-id.
                                                  Module libevdev.so.2 without build-id.
                                                  Module libudev.so.1 without build-id.
                                                  Module libpulse.so.0 without build-id.
                                                  Module libupower-glib.so.3 without build-id.
                                                  Module libnl-genl-3.so.200 without build-id.
                                                  Module libnl-3.so.200 without build-id.
                                                  Module libdbusmenu-gtk3.so.4 without build-id.
                                                  Module libglib-2.0.so.0 without build-id.
                                                  Module libgobject-2.0.so.0 without build-id.
                                                  Module libcairomm-1.0.so.1 without build-id.
                                                  Module libglibmm-2.4.so.1 without build-id.
                                                  Module libgio-2.0.so.0 without build-id.
                                                  Module libgdk-3.so.0 without build-id.
                                                  Module libgtk-3.so.0 without build-id.
                                                  Module libgiomm-2.4.so.1 without build-id.
                                                  Module libgdkmm-3.0.so.1 without build-id.
                                                  Module libatkmm-1.6.so.1 without build-id.
                                                  Module libgtkmm-3.0.so.1 without build-id.
                                                  Module libjsoncpp.so.25 without build-id.
                                                  Module libsigc-2.0.so.0 without build-id.
                                                  Module libspdlog.so.1 without build-id.
                                                  Module libfmt.so.8 without build-id.
                                                  Module libwayland-client.so.0 without build-id.
                                                  Module waybar without build-id.
                                                  Stack trace of thread 59517:
                                                  #0  0x0000000000000000 n/a (n/a + 0x0)
                                                  #1  0x00007f8f79ffa548 n/a (n/a + 0x0)
                                                  #2  0x00007f8f9c5a835c read (libc.so.6 + 0xf935c)

                                                  Stack trace of thread 59504:
                                                  #0  0x00007f8f9c532fda n/a (libc.so.6 + 0x83fda)
                                                  #1  0x00007f8f9c537e63 n/a (libc.so.6 + 0x88e63)
                                                  #2  0x00007f8f9c861fa3 _ZNSt6thread4joinEv (libstdc++.so.6 + 0xd4fa3)
                                                  #3  0x000055b2f5a867ee n/a (waybar + 0x667ee)
                                                  #4  0x000055b2f5ab043b n/a (waybar + 0x9043b)
                                                  #5  0x000055b2f5ab0589 n/a (waybar + 0x90589)
                                                  #6  0x000055b2f5a96519 n/a (waybar + 0x76519)
                                                  #7  0x000055b2f5a9d82f n/a (waybar + 0x7d82f)
                                                  #8  0x000055b2f5aaa3f8 n/a (waybar + 0x8a3f8)
                                                  #9  0x00007f8f9cd9257d n/a (libglibmm-2.4.so.1 + 0x7957d)
                                                  #10 0x00007f8f9cc05b59 g_main_context_dispatch (libglib-2.0.so.0 + 0xf7b59)
                                                  #11 0x00007f8f9cc0601b n/a (libglib-2.0.so.0 + 0xf801b)
                                                  #12 0x00007f8f9cc061d7 g_main_context_iteration (libglib-2.0.so.0 + 0xf81d7)
                                                  #13 0x00007f8f9cf178bd g_application_run (libgio-2.0.so.0 + 0x16a8bd)
                                                  #14 0x000055b2f5aa288a n/a (waybar + 0x8288a)
                                                  #15 0x000055b2f5a90f54 main (waybar + 0x70f54)
                                                  #16 0x00007f8f9c4d834a n/a (libc.so.6 + 0x2934a)
                                                  #17 0x00007f8f9c4d83fc __libc_start_main (libc.so.6 + 0x293fc)
                                                  #18 0x000055b2f5a71691 n/a (waybar + 0x51691)

                                                  Stack trace of thread 59506:
                                                  #0  0x00007f8f9c5ac31f __poll (libc.so.6 + 0xfd31f)
                                                  #1  0x00007f8f9cc05fc5 n/a (libglib-2.0.so.0 + 0xf7fc5)
                                                  #2  0x00007f8f9cc061d7 g_main_context_iteration (libglib-2.0.so.0 + 0xf81d7)
                                                  #3  0x00007f8f9cc08321 n/a (libglib-2.0.so.0 + 0xfa321)
                                                  #4  0x00007f8f9cc401ba n/a (libglib-2.0.so.0 + 0x1321ba)
                                                  #5  0x00007f8f9c5363da n/a (libc.so.6 + 0x873da)
                                                  #6  0x00007f8f9c5b912c n/a (libc.so.6 + 0x10a12c)

                                                  Stack trace of thread 59509:
                                                  #0  0x00007f8f9c5ac31f __poll (libc.so.6 + 0xfd31f)
                                                  #1  0x00007f8f9cc05fc5 n/a (libglib-2.0.so.0 + 0xf7fc5)
                                                  #2  0x00007f8f9cc061d7 g_main_context_iteration (libglib-2.0.so.0 + 0xf81d7)
                                                  #3  0x00007f8f971c7aed n/a (libdconfsettings.so + 0x9aed)
                                                  #4  0x00007f8f9cc401ba n/a (libglib-2.0.so.0 + 0x1321ba)
                                                  #5  0x00007f8f9c5363da n/a (libc.so.6 + 0x873da)
                                                  #6  0x00007f8f9c5b912c n/a (libc.so.6 + 0x10a12c)

                                                  Stack trace of thread 59514:
                                                  #0  0x00007f8f9c532fda n/a (libc.so.6 + 0x83fda)
                                                  #1  0x00007f8f9c535d62 pthread_cond_clockwait (libc.so.6 + 0x86d62)
                                                  #2  0x000055b2f5a8912e n/a (waybar + 0x6912e)
                                                  #3  0x000055b2f5a88b12 n/a (waybar + 0x68b12)
                                                  #4  0x00007f8f9c861f40 n/a (libstdc++.so.6 + 0xd4f40)
                                                  #5  0x00007f8f9c5363da n/a (libc.so.6 + 0x873da)
                                                  #6  0x00007f8f9c5b912c n/a (libc.so.6 + 0x10a12c)

                                                  Stack trace of thread 59510:
                                                  #0  0x00007f8f9c5b9f76 recv (libc.so.6 + 0x10af76)
                                                  #1  0x000055b2f5ac2953 n/a (waybar + 0xa2953)
                                                  #2  0x000055b2f5af0d6f n/a (waybar + 0xd0d6f)
                                                  #3  0x000055b2f5a88b12 n/a (waybar + 0x68b12)
                                                  #4  0x00007f8f9c861f40 n/a (libstdc++.so.6 + 0xd4f40)
                                                  #5  0x00007f8f9c5363da n/a (libc.so.6 + 0x873da)
                                                  #6  0x00007f8f9c5b912c n/a (libc.so.6 + 0x10a12c)

                                                  Stack trace of thread 59511:
                                                  #0  0x00007f8f9c5b9f76 recv (libc.so.6 + 0x10af76)
                                                  #1  0x000055b2f5ac2953 n/a (waybar + 0xa2953)
                                                  #2  0x000055b2f5ad64bf n/a (waybar + 0xb64bf)
                                                  #3  0x000055b2f5a88b12 n/a (waybar + 0x68b12)
                                                  #4  0x00007f8f9c861f40 n/a (libstdc++.so.6 + 0xd4f40)
                                                  #5  0x00007f8f9c5363da n/a (libc.so.6 + 0x873da)
                                                  #6  0x00007f8f9c5b912c n/a (libc.so.6 + 0x10a12c)

                                                  Stack trace of thread 59513:
                                                  #0  0x00007f8f9c532fda n/a (libc.so.6 + 0x83fda)
                                                  #1  0x00007f8f9c535d62 pthread_cond_clockwait (libc.so.6 + 0x86d62)
                                                  #2  0x000055b2f5a8912e n/a (waybar + 0x6912e)
                                                  #3  0x000055b2f5a88b12 n/a (waybar + 0x68b12)
                                                  #4  0x00007f8f9c861f40 n/a (libstdc++.so.6 + 0xd4f40)
                                                  #5  0x00007f8f9c5363da n/a (libc.so.6 + 0x873da)
                                                  #6  0x00007f8f9c5b912c n/a (libc.so.6 + 0x10a12c)

                                                  Stack trace of thread 59505:
                                                  #0  0x00007f8f9c4ed51a __sigtimedwait (libc.so.6 + 0x3e51a)
                                                  #1  0x00007f8f9c4ecb4c sigwait (libc.so.6 + 0x3db4c)
                                                  #2  0x000055b2f5a90c97 n/a (waybar + 0x70c97)
                                                  #3  0x00007f8f9c5363da n/a (libc.so.6 + 0x873da)
                                                  #4  0x00007f8f9c5b912c n/a (libc.so.6 + 0x10a12c)

                                                  Stack trace of thread 59512:
                                                  #0  0x00007f8f9c5ac31f __poll (libc.so.6 + 0xfd31f)
                                                  #1  0x00007f8f9ca8d8be n/a (libpulse.so.0 + 0x528be)
                                                  #2  0x00007f8f9ca7cb91 pa_mainloop_poll (libpulse.so.0 + 0x41b91)
                                                  #3  0x00007f8f9ca8dcb9 n/a (libpulse.so.0 + 0x52cb9)
                                                  #4  0x00007f8f9bbea930 n/a (libpulsecommon-16.1.so + 0x94930)
                                                  #5  0x00007f8f9c5363da n/a (libc.so.6 + 0x873da)
                                                  #6  0x00007f8f9c5b912c n/a (libc.so.6 + 0x10a12c)

                                                  Stack trace of thread 59508:
                                                  #0  0x00007f8f9c5ac31f __poll (libc.so.6 + 0xfd31f)
                                                  #1  0x00007f8f9cc05fc5 n/a (libglib-2.0.so.0 + 0xf7fc5)
                                                  #2  0x00007f8f9cc06479 g_main_loop_run (libglib-2.0.so.0 + 0xf8479)
                                                  #3  0x00007f8f9cf5d376 n/a (libgio-2.0.so.0 + 0x1b0376)
                                                  #4  0x00007f8f9cc401ba n/a (libglib-2.0.so.0 + 0x1321ba)
                                                  #5  0x00007f8f9c5363da n/a (libc.so.6 + 0x873da)
                                                  #6  0x00007f8f9c5b912c n/a (libc.so.6 + 0x10a12c)
                                                  ELF object binary architecture: AMD x86-64
Aug 31 10:07:19 GreySoap systemd[1]: systemd-coredump@7-21517-0.service: Deactivated successfully.
Aug 31 10:07:19 GreySoap sway[6349]: 71:56:11.331 [ERROR] [sway/ipc-server.c:208] IPC Client socket error, removing client
Aug 31 10:07:19 GreySoap sway[6349]: 71:56:11.331 [ERROR] [sway/ipc-server.c:208] IPC Client socket error, removing client

I can't tell if its happening on sleep or on wake

oniGino commented 2 years ago

[2022-09-25 19:41:39.502] [debug] network: default route deleted wlan0/if3 metric 1024
[2022-09-25 19:41:39.550] [debug] Output removed: Sharp Corporation 0x1484

(waybar:78793): GLib-GIO-WARNING **: 19:41:39.597: Invalid id 2 passed to g_bus_unwatch_name()
Segmentation fault (core dumped)

here is waybar -log debug output

oniGino commented 1 year ago

This seems very similar to #1168

primalmotion commented 1 year ago

I have the same issue on Hyprland.

oniGino commented 1 year ago

Here is the root of my issue, it is a bug in waybar but I think its solvable if I can get a maintainer to look at this 🙏🏾

in my sway config i had the following

bindswitch --reload --locked lid:on output eDP-1 disable
bindswitch --reload --locked lid:off output eDP-1 enable

This if referenced from https://github.com/swaywm/sway/issues/4224

Basically when i close my lid I want my workspaces moved to my larger docked monitor and this is a hack for that. When lid is closed and undocked sway has no enabled monitors (outputs) and waybar crashes if no outputs exist

so please make waybar not crash when the list of outputs is empty

As a work around I think https://github.com/swaywm/sway/issues/5553 might work but comes with its own set of issues This bug can hopefully just be solved here.... sadly I've had no maintainer feedback yet.

primalmotion commented 1 year ago

I think my problem with Hyprland is more or less the same. I described the issue and what I have here https://github.com/hyprwm/Hyprland/issues/804#issuecomment-1295645936 . It talks about Hyprland crashing, but basically Waybar seems to crash for the same reasons.

vinylen commented 1 year ago

This happens for me as well. Is there any workaround for this?

kwibus commented 1 year ago

What i do as work as workaround is to only disable laptop screen when there is another active screen.

config:

bindswitch --reload --locked lid:on exec sway-disable-if.sh  $laptop                                                                                                                        
bindswitch --reload --locked lid:off output $laptop enable

sway-disable-if.sh

display=${1:-eDP-1}
nActive=$(swaymsg -t get_outputs -r | jq '.[]| select(.active==true).name' |wc -l )
if [ "$nActive" -gt 1 ]
then 
   sway output "$display" disable
fi