Skip to content

[WIP] Fix segfault in waybar::modules::sway::Language::set_current_layout#4832

Draft
Copilot wants to merge 1 commit intomasterfrom
copilot/fix-segfault-in-language-module
Draft

[WIP] Fix segfault in waybar::modules::sway::Language::set_current_layout#4832
Copilot wants to merge 1 commit intomasterfrom
copilot/fix-segfault-in-language-module

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original prompt

This section details on the original issue you should resolve

<issue_title>Segfault in waybar::modules::sway::Language::set_current_layout</issue_title>
<issue_description>I've got the following segfault in Waybar 0.14.0:

Core was generated by `/nix/store/g2r7rc3p1d6m36d5y1ja53rkranfgxwr-waybar-0.14.0/bin/waybar -b bar-0'.
Program terminated with signal SIGSEGV, Segmentation fault.
Alexays/Waybar#0  0x00007f72f8702d18 in g_source_set_name_full (source=0x7f72300061a0, name=0x7f72f93b43f8 "[gtk+] gdk_frame_clock_paint_idle", is_static=0) at ../glib/gmain.c:2202
2202	 if (!source->priv->static_name)
[Current thread is 1 (Thread 0x7f725e7fc6c0 (LWP 35434))]
(gdb) list
2197	 /* setting back to NULL is allowed, just because it's
2198	  * weird if get_name can return NULL but you can't
2199	  * set that.
2200	  */
2201	
2202	 if (!source->priv->static_name)
2203	   g_free (source->name);
2204	
2205	 if (is_static)
2206	   source->name = (char *)name;
(gdb) bt full
Alexays/Waybar#0  0x00007fe245702d18 in g_source_set_name_full (source=0x7fe188006400, name=0x7fe2463b43f8 "[gtk+] gdk_frame_clock_paint_idle", is_static=0) at ../glib/gmain.c:2202
        context = <optimized out>
        _g_boolean_var_89 = <optimized out>
        _g_boolean_var_90 = <optimized out>
        gaig_temp = <optimized out>
Alexays/Waybar#1  0x00007fe245d10de9 in gtk_widget_add_tick_callback (widget=0x55bd49ab9f80 [gtkmm__GtkWindow], callback=callback@entry=0x7fe245afb960 <gtk_css_widget_node_queue_callback>, user_data=user_data@entry=0x55bd49a3f7f0, notify=notify@entry=0x0) at ../gtk/gtkwidget.c:5368
        priv = 0x55bd49ab9e90
        info = <optimized out>
        frame_clock = 0x55bd49d9d060 [GdkFrameClockIdle]
Alexays/Waybar#2  0x00007fe245afb946 in gtk_css_widget_node_queue_validate (node=0x55bd49a3f7f0 [GtkCssWidgetNode]) at ../gtk/gtkcsswidgetnode.c:95
        widget_node = 0x55bd49a3f7f0 [GtkCssWidgetNode]
Alexays/Waybar#3  0x00007fe245ad83cb in gtk_css_node_invalidate_style (cssnode=0x55bd49b58f40 [GtkCssWidgetNode]) at ../gtk/gtkcssnode.c:727
Alexays/Waybar#4  gtk_css_node_invalidate (cssnode=cssnode@entry=0x55bd49b58f40 [GtkCssWidgetNode], change=<optimized out>, change@entry=1) at ../gtk/gtkcssnode.c:1372
Alexays/Waybar#5  0x00007fe245ad8ad5 in gtk_css_node_remove_class (cssnode=0x55bd49b58f40 [GtkCssWidgetNode], style_class=<optimized out>) at ../gtk/gtkcssnode.c:1254
Alexays/Waybar#6  0x000055bd41f1303a in waybar::modules::sway::Language::set_current_layout (this=this@entry=0x55bd49c632a0, current_layout="Russian") at ../src/modules/sway/language.cpp:128
Alexays/Waybar#7  0x000055bd41f160bb in waybar::modules::sway::Language::onEvent (this=0x55bd49c632a0, res=...) at ../src/modules/sway/language.cpp:89
        lock = {_M_device = <optimized out>}
        payload = {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_ = 140606626094832, uint_ = 140606626094832, real_ = 6.9468903531101842e-310, bool_ = 240, string_ = 0x7fe188005ef0 "\205\343\030v\346\177", map_ = 0x7fe188005ef0}, bits_ = {value_type_ = 7, allocated_ = 0}, comments_ = {ptr_ = std::unique_ptr<struct std::array<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, 3>> = {get() = 0x0}}, start_ = 35, limit_ = 295}
Alexays/Waybar#8  0x000055bd41f06bfe in sigc::internal::signal_emit1<void, waybar::modules::sway::Ipc::ipc_response const&, sigc::nil>::emit (impl=0x55bd49b59c10, _A_a1=...) at /nix/store/blx56cg23z09bihhxlv4xsa3zb58irzp-libsigc++-2.12.1-dev/include/sigc++-2.0/sigc++/signal.h:1041
        slot = @0x55bd49b59c50: {<sigc::functor_base> = {<No data fields>}, rep_ = 0x55bd49b59b80, blocked_ = false}
        exec = {sig_ = 0x55bd49b59c10}
        slots = Python Exception <class 'gdb.error'>: value has been optimized out
{slots_ = <optimized out>, placeholder = }
Alexays/Waybar#9  0x000055bd41f06af7 in sigc::signal1<void, waybar::modules::sway::Ipc::ipc_response const&, sigc::nil>::emit (this=0x55bd49c635c8, _A_a1=...) at /nix/store/blx56cg23z09bihhxlv4xsa3zb58irzp-libsigc++-2.12.1-dev/include/sigc++-2.0/sigc++/signal.h:2961
Alexays/Waybar#10 waybar::modules::sway::Ipc::handleEvent (this=0x55bd49c635c8) at ../src/modules/sway/ipc/client.cpp:154
        res = {size = 297, type = 2147483669, payload = "{ \"change\": \"xkb_layout\", \"input\": { \"identifier\": \"0:0:wlr_virtual_keyboard_v1\", \"name\": \"wlr_virtual_keyboard_v1\", \"type\": \"keyboard\", \"repeat_delay\": 600, \"repeat_rate\": 25, \"xkb_layout_names\": [ \""...}
Alexays/Waybar#11 0x000055bd41f150a7 in operator() (__closure=<optimized out>) at ../src/modules/s...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes Alexays/Waybar#4777

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants