This segfault is pretty rare, and I'm not entirely sure what triggers it. Managed to catch it with gdb by running polybar under the debugger all day until it crashed:
Thread 13 "polybar" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffcbfff700 (LWP 1106)]
polybar::v3_1_0_56_gbd022c9_git::builder::node (this=0x555555a5c8d0,
label=<error reading variable: Cannot access memory at address 0x7361625f70614d67>, add_space=false)
at /home/jon/dev/others/polybar/src/components/builder.cpp:244
244 if (label->m_padding.right > 0) {
(gdb) bt
#0 polybar::v3_1_0_56_gbd022c9_git::builder::node (this=0x555555a5c8d0,
label=<error reading variable: Cannot access memory at address 0x7361625f70614d67>, add_space=false)
at /home/jon/dev/others/polybar/src/components/builder.cpp:244
#1 0x00005555557227ce in polybar::v3_1_0_56_gbd022c9_git::modules::xworkspaces_module::build (this=0x555555a5c490,
builder=0x555555a5c8d0, tag=...) at /home/jon/dev/others/polybar/src/modules/xworkspaces.cpp:300
#2 0x000055555572b7b9 in polybar::v3_1_0_56_gbd022c9_git::modules::module<polybar::v3_1_0_56_gbd022c9_git::modules::xworkspaces_module>::get_output[abi:cxx11]() (this=0x555555a5c490)
at /home/jon/dev/others/polybar/include/modules/meta/base.inl:159
#3 0x00005555557222bd in polybar::v3_1_0_56_gbd022c9_git::modules::xworkspaces_module::get_output[abi:cxx11]() (
this=0x555555a5c490) at /home/jon/dev/others/polybar/src/modules/xworkspaces.cpp:264
#4 0x000055555572b1d0 in polybar::v3_1_0_56_gbd022c9_git::modules::module<polybar::v3_1_0_56_gbd022c9_git::modules::xworkspaces_module>::contents[abi:cxx11]() (this=0x555555a5c490)
at /home/jon/dev/others/polybar/include/modules/meta/base.inl:81
#5 0x000055555567cc76 in polybar::v3_1_0_56_gbd022c9_git::controller::process_update (this=<optimized out>,
force=false) at /home/jon/dev/others/polybar/src/components/controller.cpp:465
#6 0x0000555555679c1a in polybar::v3_1_0_56_gbd022c9_git::controller::process_eventqueue (this=0x555555a54500)
at /home/jon/dev/others/polybar/src/components/controller.cpp:357
#7 0x00007ffff5985b9f in std::execute_native_thread_routine (__p=0x555555a5df90)
at /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:83
#8 0x00007ffff515208c in start_thread () from /usr/lib/libpthread.so.0
#9 0x00007ffff4e89e7f in clone () from /usr/lib/libc.so.6
This segfault is pretty rare, and I'm not entirely sure what triggers it. Managed to catch it with gdb by running polybar under the debugger all day until it crashed: