Scrolling on Waybar causes it to crash and reload
When I scroll on Waybar it crashes and reloads I ran it through the terminal to get the error message here are the errors from two separate runs.
** (waybar:4363): ERROR **: 11:47:56.469:
unhandled exception (type std::exception) in signal handler:
what: in Json::Value::find(begin, end): requires objectValue or nullValue
[1] 4363 trace trap (core dumped) waybar
** (waybar:4125): ERROR **: 11:47:43.844:
unhandled exception (type std::exception) in signal handler:
what: in Json::Value::find(begin, end): requires objectValue or nullValue
[1] 4125 trace trap (core dumped) waybar
To make sure it wasn’t just an issue on my end I asked someone else who mentioned having a similar issue to test it and they got the same error message.
** (waybar:5249): ERROR **: 11:42:39.231:
unhandled exception (type std::exception) in signal handler:
what: in Json::Value::find(begin, end): requires objectValue or nullValue
I assume Waybar 14.0 introduced a regression it assumes scroll events are always defined in the JSON config.
I noticed the same issue today with Arch Linux, but in this case, the bug only happens in some places of Waybar (the expanders, in fact), as the place shown below in the Jsonc config file:
"group/tray-expander": {
"orientation": "inherit",
"drawer": {
"transition-duration": 600,
"children-class": "tray-group-item"
},
"modules": [
"custom/expand-icon",
"tray"
]
},
Once happened, I have to relaunch it manually with hyprctl dispatch exec waybar. The log is the following:
** (waybar:317118): ERROR **: 10:13:03.428:
unhandled exception (type std::exception) in signal handler:
what: in Json::Value::find(begin, end): requires objectValue or nullValue
Trace/breakpoint trap (core dumped) waybar
Versions:
Waybar version: v0.14.0 Hyprland version: 0.50.1 Kernel version: 6.15.9-arch1-1
Also experiencing this on Arch.
waybar 0.14.0-1 hyprland 0.50.1-1 linux 6.16.1.arch1-1
Downgraded to waybar 0.13.0-3 for the time being.
I suspect it has to do more with the "group" modules than the drawers, as I am getting this crash when I scroll on groups without drawers as well.
Mee too. Scrolling on some components (power-profiles-daemon, mpris, some custom buttons, CPU, memory etc...) Causes waybar to crash.
[2025-08-21 22:57:22.115] [info] Using configuration file /home/efe/.config/waybar/config
[2025-08-21 22:57:22.117] [info] Discovered appearance 'dark'
[2025-08-21 22:57:22.138] [info] Using CSS file /home/efe/.config/waybar/style.css
[2025-08-21 22:57:22.144] [info] Hyprland IPC starting
[2025-08-21 22:57:22.144] [info] Loading persistent workspaces from Waybar config
[2025-08-21 22:57:22.145] [info] Loading persistent workspaces from Hyprland workspace rules
[2025-08-21 22:57:22.300] [info] Bar configured (width: 1920, height: 31) for output: DP-1
[2025-08-21 22:57:22.300] [error] Item '': No icon name or pixmap given.
[2025-08-21 22:57:22.311] [error] Item '': No icon name or pixmap given.
** (waybar:661142): WARNING **: 22:57:22.311: Status Notifier Item with bus name ':1.39' and object path '/org/ayatana/NotificationItem/tuxedo_control_center1' is already registered
** (waybar:661142): WARNING **: 22:57:23.517: Status Notifier Item with bus name ':1.39' and object path '/org/ayatana/NotificationItem/tuxedo_control_center1' is already registered
** (waybar:661142): ERROR **: 22:57:24.156:
unhandled exception (type std::exception) in signal handler:
what: in Json::Value::find(begin, end): requires objectValue or nullValue
fish: Job 1, 'waybar' terminated by signal SIGTRAP (Trace or breakpoint trap)
- waybar 0.14.0-1
- hyprland 50.1-1
- Linux 6.16.1-zen1-1-zen
same here
** (waybar:4785): ERROR **: 08:06:17.555:
unhandled exception (type std::exception) in signal handler:
what: in Json::Value::find(begin, end): requires objectValue or nullValue
[1] 4785 trace trap (core dumped) waybar
- Waybar v0.14.0
- Hyprland 0.50.1
- Linux 6.16.2-zen1-1-zen
same here
** (waybar:145731): ERROR **: 12:51:36.162:
unhandled exception (type std::exception) in signal handler:
what: in Json::Value::find(begin, end): requires objectValue or nullValue
zsh: trace trap (core dumped) waybar
Waybar v0.14.0 (branch 'master')
Hyprland 0.50.0
Linux core 6.16.3-zen1-1-zen
add this to groups and modules with undefined on-scroll events for a quick fix
// fix scroll-crash
"on-scroll-up": "true",
"on-scroll-down": "true"
I tested the bug a bit, even after this workaround by @kromsam. I encountered the same issue with groups. I think it's not only the scrolling. If I scroll without moving the mouse, it doesn't crash. However, right after the next action—moving the mouse or scrolling again—it crashes.
I'd like to add as this was not mentioned: attempting to scroll while the cursor is on the border of a group also triggers the crash.
Note that the following also stops the crashes it on my system when using the mouse wheel when scrolling with all modules (even not-expanding ones):
"on-scroll-up": "", "on-scroll-down": ""
Waybar v0.14.0
I'd like to add as this was not mentioned: attempting to scroll while the cursor is on the border of a group also triggers the crash.
Oh, you're right and at least from my quick test it happens consistently as well that is weird.
I'm getting the crash as well. the fix by kromsam didn't fix it for me either. Has there been any progress made on this?
Bug fixed or not? I have the same issue
I have the same issue too. Even with "on-scroll-up": "","on-scroll-down": "" configured at every custom module. Waybar still crashes when scrolling modules background.
I was able to trace the crashes to src/AModule.cpp in AModule::getScrollDir()
// it happens when checking if config is numeric
gdouble threshold = 0;
if (config_["smooth-scrolling-threshold"].isNumeric()) {
threshold = config_["smooth-scrolling-threshold"].asDouble();
}
Thread 1 "waybar" hit Breakpoint 1, waybar::AModule::handleScroll (this=0x555555d21400, e=0x5555562b4750) at ../src/AModule.cpp:258
258 auto dir = getScrollDir(e);
(gdb) s
waybar::AModule::getScrollDir (this=0x555555d21400, e=0x5555562b4750) at ../src/AModule.cpp:197
197 bool reverse = config_["reverse-scrolling"].asBool();
(gdb)
198 bool reverse_mouse = config_["reverse-mouse-scrolling"].asBool();
(gdb)
201 GdkDevice* device = gdk_event_get_source_device((GdkEvent*)e);
(gdb)
202 if (device != nullptr && gdk_device_get_source(device) == GDK_SOURCE_MOUSE) {
(gdb)
203 reverse = reverse_mouse;
(gdb)
206 switch (e->direction) {
(gdb)
216 SCROLL_DIR dir{SCROLL_DIR::NONE};
(gdb)
218 distance_scrolled_y_ += e->delta_y;
(gdb)
219 distance_scrolled_x_ += e->delta_x;
(gdb)
221 gdouble threshold = 0;
(gdb)
222 if (config_["smooth-scrolling-threshold"].isNumeric()) {
0x00007ffff7cee8d8 in ?? () from /usr/lib/libgtkmm-3.0.so.1
Printing config_ before checking if it's numeric
(gdb) p config_
$1 = (const Json::Value &) @0x7fffffffc340: {
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_ = 1374984448157560100, uint_ = 1374984448157560100,
real_ = 9.4848515230514366e-217, bool_ = 36,
string_ = 0x1314ed12141e2d24 <error: Cannot access memory at address 0x1314ed12141e2d24>, map_ = 0x1314ed12141e2d24}, bits_ = {
value_type_ = 5, allocated_ = 0}, comments_ = {
ptr_ = std::unique_ptr<std::array<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, 3>> = {
get() = 0xbfbfbfbfbfbfbfbf}}, start_ = -4629771061633162976,
limit_ = 0}
Here is the backtrace
#0 0x00007ffff7cee8d8 in ??? () at /usr/lib/libgtkmm-3.0.so.1
#1 0x00007ffff71f9a8b in ??? () at /usr/lib/libgtk-3.so.0
#2 0x00007ffff773597c in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#3 0x00007ffff7755097 in ??? () at /usr/lib/libgobject-2.0.so.0
#4 0x00007ffff77562db in ??? () at /usr/lib/libgobject-2.0.so.0
#5 0x00007ffff7756d89 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#6 0x00007ffff7756e44 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#7 0x00007ffff74ef6fe in ??? () at /usr/lib/libgtk-3.so.0
#8 0x00007ffff7370795 in ??? () at /usr/lib/libgtk-3.so.0
#9 0x00007ffff737154b in gtk_main_do_event () at /usr/lib/libgtk-3.so.0
#10 0x00007ffff6f3b1c7 in ??? () at /usr/lib/libgdk-3.so.0
#11 0x00007ffff6f76cd0 in ??? () at /usr/lib/libgdk-3.so.0
#12 0x00007ffff6bbdf4d in ??? () at /usr/lib/libglib-2.0.so.0
#13 0x00007ffff6bbf617 in ??? () at /usr/lib/libglib-2.0.so.0
#14 0x00007ffff6bbf825 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#15 0x00007ffff6d9b756 in g_application_run () at /usr/lib/libgio-2.0.so.0
#16 0x00005555556325d4 in waybar::Client::main (this=0x5555559ce8f0, argc=1, argv=0x7fffffffdb48) at ../src/client.cpp:295
#17 0x0000555555617de3 in main (argc=1, argv=0x7fffffffdb48) at ../src/main.cpp:175
And the final error
** (waybar:201895): ERROR **: 03:19:37.916:
unhandled exception (type std::exception) in signal handler:
what: in Json::Value::find(begin, end): requires objectValue or nullValue
Thread 1 "waybar" received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff6bc3b8c in g_log_structured_array () from /usr/lib/libglib-2.0.so.0
I was able to trace the crashes to
src/AModule.cppinAModule::getScrollDir()
I can confirm this behavior. But for me its at the beginning of the function
// only affects up/down
bool reverse = config_["reverse-scrolling"].asBool();
bool reverse_mouse = config_["reverse-mouse-scrolling"].asBool();
It happens within the Json-library:
#0 0x00007f1a33cb213a in __cxxabiv1::__cxa_throw (obj=0x55e6ea062430, tinfo=0x7f1a356d1080 <typeinfo for Json::LogicError>, dest=0x7f1a356a6900 <Json::LogicError::~LogicError()>)
at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_throw.cc:81
#1 0x00007f1a356a461d in Json::throwLogicError (msg="in Json::Value::find(begin, end): requires objectValue or nullValue") at ../src/lib_json/json_value.cpp:212
#2 0x00007f1a356bc5b2 in Json::Value::find (this=this@entry=0x7ffcfbbf0560, begin=begin@entry=0x55e6da72154c "reverse-scrolling", end=0x55e6da72155d "")
at ../src/lib_json/json_value.cpp:1083
#3 0x00007f1a356bc7fa in Json::Value::operator[] (this=0x7ffcfbbf0560, key=0x55e6da72154c "reverse-scrolling") at ../src/lib_json/json_value.cpp:1105
#4 0x000055e6da4ff120 in waybar::AModule::getScrollDir(_GdkEventScroll*) ()
#5 0x000055e6da4ff349 in waybar::AModule::handleScroll(_GdkEventScroll*) ()
#6 0x00007f1a354ee8c2 in sigc::slot1<bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>::operator() (this=0x55e6e999e918, _A_a1=...)
at /usr/include/sigc++-2.0/sigc++/functors/slot.h:675
there is a type() check, which checks the type of the to be either objectValue or nullValue. https://github.com/open-source-parsers/jsoncpp/blob/ca98c98457b1163cca1f7d8db62827c115fec6d1/src/lib_json/json_value.cpp#L1116
Looking at the this inside the [] operation (which should mean the config_ of AModule) returns:
(gdb) p this.bits_
$5 = {value_type_ = 182, allocated_ = 0}
(gdb) p this.value_
$6 = {int_ = 140724532086432, uint_ = 140724532086432, real_ = 6.9527156830990248e-310, bool_ = 160, string_ = 0x7ffcfbbf06a0 "\260\t\277\373\374\177", map_ = 0x7ffcfbbf06a0}
which looks very broken to me. It seems like config_ is in an illegal state, maybe by some UB before.
I was investigating this bug and created a pull request with changes that fix it. As I figured out, it happens because the group module is defined as scrollable though it has no actions associated with scrolling.
I came to the point that it happens with group module only. If this is not right. PR #4589 should be considered a workaround. I can try to investigate the issue a bit further in case if it happens with other modules as well
I came to the point that it happens with group module only. If this is not right. PR #4589 should be considered a workaround.
A temporary fix is to probably catch the exception and wrapping the caller function handleScroll in AModules.cpp in a try-catch handler since the error is
unhandled exception (type std::exception)
I'm also experiencing this issue Fedora43 waybar 0.14.0 sway 1.11