Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash on reconnecting display - hyprland/window #1783

Closed
aegluke opened this issue Nov 9, 2022 · 8 comments · Fixed by #1929
Closed

crash on reconnecting display - hyprland/window #1783

aegluke opened this issue Nov 9, 2022 · 8 comments · Fixed by #1929
Labels
bug Something isn't working

Comments

@aegluke
Copy link

aegluke commented Nov 9, 2022

i have an issue with the following setup:
2 Monitors - monitor 1: 1920x1200 (integrated display); external display: 5120x1440
Hyprland - latest git release
waybar - latest git release
module "hyprland/window" enabled
disconnect monitor 2 - wait a second that hyprland manages all the workspace-movements and resizes
reconnect monitor 2 - waybar crashes

waybar -l debug-Output: the last message is the first one after reconnecting monitor 2. waybar is visible on monitor 2 for half a second or so - then it crashes.

[2022-11-09 21:57:32.804] [debug] hyprland IPC received monitorremoved>>DP-4
[2022-11-09 21:57:32.804] [debug] Output removed: Dell Inc. Dell U4919DW
[2022-11-09 21:57:32.805] [debug] Workspace 7 created
[2022-11-09 21:57:32.806] [debug] Workspace 8 created
[2022-11-09 21:57:32.806] [debug] Workspace 9 created
[2022-11-09 21:57:32.807] [debug] Workspace 10 created
[2022-11-09 21:57:32.807] [debug] Workspace 6 changed to state 0
[2022-11-09 21:57:32.807] [debug] Workspace 5 changed to state 0
[2022-11-09 21:57:32.807] [debug] Workspace 9 changed to state 1
[2022-11-09 21:57:32.889] [info] Bar removed from output: DP-4
[2022-11-09 21:57:40.855] [debug] hyprland IPC received activewindow>>,

if i disable hyprland/window, it will not crash in my configuration.

i tried to locate the problem in the source-code - while doing it, i detected i'm not a c++-programmer ;)
maybe its an empty activewindow sent by hyprlandwm while moving the workspaces back to monitor 2.

Here is the stack-trace - maybe it helps someone:

the segfault is happen in hyprland/window.cpp in line 86: lastview = windowName;

std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_assign(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) (Unknown Source:0)
libstdc++.so.6!std::__cxx11::basic_string<char, std::char_traits, std::allocator >::assign( __str, std::__cxx11::basic_string<char, std::char_traits, std::allocator > * const this) (/usr/src/debug/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:1571)
libstdc++.so.6!std::__cxx11::basic_string<char, std::char_traits, std::allocator >::operator=(std::__cxx11::basic_string<char, std::char_traits, std::allocator > * const this, __str) (/usr/src/debug/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:805)
waybar::modules::hyprland::Window::onEvent(waybar::modules::hyprland::Window * const this, const std::string & ev) (/home/erik/.cache/yay/waybar-hyprland-git/src/waybar-hyprland-git/src/modules/hyprland/window.cpp:86)
operator()(const struct {...} * const __closure, const std::string & ev) (/home/erik/.cache/yay/waybar-hyprland-git/src/waybar-hyprland-git/src/modules/hyprland/window.cpp:28)
std::__invoke_impl<void, waybar::modules::hyprland::Window::Window(const std::string&, const waybar::Bar&, const Json::Value&)::<lambda(const std::string&)>&, const std::__cxx11::basic_string<char, std::char_traits, std::allocator >&>(std::__invoke_other, struct {...} &)(struct {...} & __f) (/usr/include/c++/12.2.0/bits/invoke.h:61)
std::__invoke_r<void, waybar::modules::hyprland::Window::Window(const std::string&, const waybar::Bar&, const Json::Value&)::<lambda(const std::string&)>&, const std::__cxx11::basic_string<char, std::char_traits, std::allocator >&>(struct {...} &)(struct {...} & __fn) (/usr/include/c++/12.2.0/bits/invoke.h:111)
std::_Function_handler<void(const std::__cxx11::basic_string<char, std::char_traits, std::allocator >&), waybar::modules::hyprland::Window::Window(const std::string&, const waybar::Bar&, const Json::Value&)::<lambda(const std::string&)> >::_M_invoke(const std::_Any_data &, const std::__cxx11::basic_string<char, std::char_traits, std::allocator > &)(const std::_Any_data & __functor, __args#0) (/usr/include/c++/12.2.0/bits/std_function.h:290)
std::function<void (std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)>::operator()(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const(const std::function<void(const std::__cxx11::basic_string<char, std::char_traits, std::allocator >&)> * const this, __args#0) (/usr/include/c++/12.2.0/bits/std_function.h:591)
waybar::modules::hyprland::IPC::parseIPC(waybar::modules::hyprland::IPC * const this, const std::string & ev) (/home/erik/.cache/yay/waybar-hyprland-git/src/waybar-hyprland-git/src/modules/hyprland/backend.cpp:98)
operator()(const struct {...} * const __closure) (/home/erik/.cache/yay/waybar-hyprland-git/src/waybar-hyprland-git/src/modules/hyprland/backend.cpp:83)
std::__invoke_impl<void, waybar::modules::hyprland::IPC::startIPC()::<lambda()> >(std::__invoke_other, struct {...} &&)(struct {...} && __f) (/usr/include/c++/12.2.0/bits/invoke.h:61)
std::__invoke<waybar::modules::hyprland::IPC::startIPC()::<lambda()> >(struct {...} &&)(struct {...} && __fn) (/usr/include/c++/12.2.0/bits/invoke.h:96)
std:thread:_Invoker<std::tuple<waybar::modules::hyprland::IPC::startIPC()::<lambda()> > >::_M_invoke<0>(std::_Index_tuple<0>)(std:thread:_Invoker<std::tuple<waybar::modules::hyprland::IPC::startIPC()::<lambda()> > > * const this) (/usr/include/c++/12.2.0/bits/std_thread.h:252)
std:thread:_Invoker<std::tuple<waybar::modules::hyprland::IPC::startIPC()::<lambda()> > >::operator()(void)(std:thread:_Invoker<std::tuple<waybar::modules::hyprland::IPC::startIPC()::<lambda()> > > * const this) (/usr/include/c++/12.2.0/bits/std_thread.h:259)
std:thread:_State_impl<std:thread:_Invoker<std::tuple<waybar::modules::hyprland::IPC::startIPC()::<lambda()> > > >::_M_run(void)(std:thread:_State_impl<std:thread:_Invoker<std::tuple<waybar::modules::hyprland::IPC::startIPC()::<lambda()> > > > * const this) (/usr/include/c++/12.2.0/bits/std_thread.h:210)
libstdc++.so.6!std::execute_native_thread_routine(void * __p) (/usr/src/debug/gcc/libstdc++-v3/src/c++11/thread.cc:82)
libc.so.6![Unknown/Just-In-Time compiled code] (Unknown Source:0)

@aegluke aegluke changed the title crash on reconnection display - hyprland/window crash on reconnecting display - hyprland/window Nov 9, 2022
@aegluke
Copy link
Author

aegluke commented Nov 10, 2022

it is not fixed with #1780

@aegluke
Copy link
Author

aegluke commented Nov 10, 2022

now it needs some more cycles disconnecting and reconnecting the monitor 2 until it crashes.
waybar -l debug prints this:

[2022-11-10 20:33:17.404] [debug] hyprland window onevent with
[2022-11-10 20:33:17.404] [debug] hyprland window onevent with
[2022-11-10 20:33:17.406] [debug] hyprland IPC received createworkspace>>9
[2022-11-10 20:33:17.407] [debug] hyprland IPC received workspace>>9
[2022-11-10 20:33:17.408] [debug] hyprland IPC received activewindow>>,
[2022-11-10 20:33:17.409] [debug] hyprland IPC received focusedmon>>eDP-1,8
[2022-11-10 20:33:17.410] [debug] hyprland IPC received activewindow>>,
[2022-11-10 20:33:17.411] [debug] hyprland IPC received moveworkspace>>8,eDP-1
[2022-11-10 20:33:17.548] [debug] hyprland IPC received destroyworkspace>>9
Gdk-Message: 20:33:17.549: Error reading events from display: Invalid argument

@ElJeffe
Copy link

ElJeffe commented Nov 14, 2022

I have this also, but it is not a crash since there is no coredump, and with gdb there is a clean exit. Is there a way to debug this?

@herlev
Copy link
Contributor

herlev commented Nov 14, 2022

Do you use the separate-outputs option? If so, maybe it is related to an assert in either Window::getActiveWorkspaceID or Window::getLastWindowTitle.

@Alexays Alexays added the bug Something isn't working label Nov 15, 2022
@ElJeffe
Copy link

ElJeffe commented Nov 15, 2022

Do you use the separate-outputs option? If so, maybe it is related to an assert in either Window::getActiveWorkspaceID or Window::getLastWindowTitle.

No, it seems to be in the wlr/workspaces module. I disabled all hyprland modules, and it happens when I add the wlr/workspaces, and does not happen without the wlr/workspaces.

@SeanMcnabb
Copy link

I am running into this as well when turning a monitor off and back on with multiple monitors. However, it doesn't happen when I set all-outputs to false.

It will also show workspaces incorrectly after turning a monitor off and on with all-outputs to true. It will move the workspace on that monitor to another monitor, spawn a new workspace on the monitor that was turned back on. When this happens, the new workspace isn't shown in the wlr/workspaces except for the monitor that was recently turned on. Waybar will crash shortly after that

@jlaunay
Copy link

jlaunay commented Nov 29, 2022

Same problem here even having all-outputs setting to false.

@eternalinflation
Copy link

Same here with Waybar 0.9.16-2 under Sway 1.8.
To reproduce:

  1. Start sway and waybar
  2. Turn off screen
  3. Turn sceen back on
  4. Note that waybar is gone and needs to be restarted. Coredump/back trace see below.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
--Type <RET> for more, q to quit, c to continue without paging--c
Core was generated by `waybar -b bar-0'.
Program terminated with signal SIGTRAP, Trace/breakpoint trap.
#0  g_log_structured_array (log_level=<optimized out>, fields=0x7ffd190f88b0, n_fields=4) at ../glib/glib/gmessages.c:563
Downloading 0.10 MB source file /usr/src/debug/glib2/build/../glib/glib/gmessages.c
563	    G_BREAKPOINT ();
[Current thread is 1 (Thread 0x7fda1a9bb4c0 (LWP 183703))]
(gdb) bt
#0  g_log_structured_array (log_level=<optimized out>, fields=0x7ffd190f88b0, n_fields=4)
    at ../glib/glib/gmessages.c:563
#1  0x00007fda1ee60683 in g_log_default_handler
    (log_domain=log_domain@entry=0x7fda1eeb30be "GLib", log_level=log_level@entry=6, message=message@entry=0x561a42729120 "g_log_set_writer_func() called multiple times", unused_data=unused_data@entry=0x0)
    at ../glib/glib/gmessages.c:3312
#2  0x00007fda1ee618b5 in g_logv
    (log_domain=0x7fda1eeb30be "GLib", log_level=G_LOG_LEVEL_ERROR, format=<optimized out>, args=<optimized out>)
    at ../glib/glib/gmessages.c:1402
#3  0x00007fda1ee61b64 in g_log
    (log_domain=log_domain@entry=0x7fda1eeb30be "GLib", log_level=log_level@entry=G_LOG_LEVEL_ERROR, format=format@entry=0x7fda1eebe700 "g_log_set_writer_func() called multiple times") at ../glib/glib/gmessages.c:1471
#4  0x00007fda1ee63797 in g_log_set_writer_func
    (func=0x7fda1ec66cb0 <wp_log_writer_default>, user_data=0x0, user_data_free=<optimized out>)
    at ../glib/glib/gmessages.c:2087
#5  0x00007fda1ec89621 in wp_init (flags=WP_INIT_ALL) at ../wireplumber/lib/wp/wp.c:32
#6  0x0000561a411731eb in  ()
#7  0x0000561a410fe438 in  ()
#8  0x0000561a4111a264 in  ()
#9  0x0000561a4111c729 in  ()
#10 0x0000561a41124f6d in  ()
#11 0x00007fda1e6304f6 in ffi_call_unix64 () at ../src/x86/unix64.S:104
#12 0x00007fda1e62cf5e in ffi_call_int
    (cif=<optimized out>, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=<optimized out>) at ../src/x86/ffi64.c:673
#13 0x00007fda1e62fb73 in ffi_call
    (cif=cif@entry=0x7ffd190f96a0, fn=<optimized out>, rvalue=rvalue@entry=0x0, avalue=avalue@entry=0x7ffd190f9770)
    at ../src/x86/ffi64.c:710
#14 0x00007fda20291645 in wl_closure_invoke (closure=closure@entry=0x561a429cf6a0, target=<optimized out>,
    target@entry=0x561a42962af0, opcode=opcode@entry=2, data=<optimized out>, flags=1)
    at ../wayland-1.21.0/src/connection.c:1025
#15 0x00007fda20291e03 in dispatch_event (display=display@entry=0x561a426b74e0, queue=0x561a426b75b0)
    at ../wayland-1.21.0/src/wayland-client.c:1595
#16 0x00007fda20291ffc in dispatch_queue (queue=0x561a426b75b0, display=0x561a426b74e0)
    at ../wayland-1.21.0/src/wayland-client.c:1741
#17 wl_display_dispatch_queue_pending (display=0x561a426b74e0, queue=0x561a426b75b0)
    at ../wayland-1.21.0/src/wayland-client.c:1983
#18 0x00007fda20292061 in wl_display_dispatch_pending (display=<optimized out>)
    at ../wayland-1.21.0/src/wayland-client.c:2046
#19 0x00007fda1f289729 in _gdk_wayland_display_queue_events (display=<optimized out>)
    at ../gtk/gdk/wayland/gdkeventsource.c:201
#20 0x00007fda1f256029 in gdk_display_get_event (display=0x561a426be070 [GdkWaylandDisplay])
    at ../gtk/gdk/gdkdisplay.c:442
#21 0x00007fda1f290728 in gdk_event_source_dispatch
    (base=<optimized out>, callback=<optimized out>, data=<optimized out>) at ../gtk/gdk/wayland/gdkeventsource.c:120
#22 0x00007fda1ee5887b in g_main_dispatch (context=0x561a426ca870) at ../glib/glib/gmain.c:3454
#23 g_main_context_dispatch (context=0x561a426ca870) at ../glib/glib/gmain.c:4172
#24 0x00007fda1eeafc89 in g_main_context_iterate.constprop.0
    (context=0x561a426ca870, block=1, dispatch=1, self=<optimized out>) at ../glib/glib/gmain.c:4248
#25 0x00007fda1ee57132 in g_main_context_iteration
    (context=context@entry=0x561a426ca870, may_block=may_block@entry=1) at ../glib/glib/gmain.c:4313
#26 0x00007fda1f13575e in g_application_run
    (application=0x561a42669210 [gtkmm__GtkApplication], argc=<optimized out>, argv=0x7ffd190fa688)
    at ../glib/gio/gapplication.c:2573
#27 0x0000561a410ef133 in  ()
#28 0x0000561a410edcb5 in main ()
(gdb)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants