AyatanaIndicators / ayatana-indicator-keyboard

Ayatana Indicator Keyboard Applet
GNU General Public License v3.0
2 stars 6 forks source link

src/keyboard-x11.c: Also parse /etc/X11/xorg.conf.d/00-keyboard.conf for system layout #61

Closed tari01 closed 7 months ago

tari01 commented 8 months ago

@sunweaver: I have tested this on Manjaro, but please do an openSuse test just in case before you approve.

sunweaver commented 8 months ago
Thread 1 "ayatana-indicat" received signal SIGSEGV, Segmentation fault.
0x00007ffff7243d20 in g_str_hash () from /usr/lib64/libglib-2.0.so.0
(gdb) bt full 
#0  0x00007ffff7243d20 in g_str_hash () at /usr/lib64/libglib-2.0.so.0
#1  0x00007ffff7243010 in g_hash_table_lookup_extended ()
    at /usr/lib64/libglib-2.0.so.0
#2  0x00007ffff3c0ca7f in keyboard_GetLayout ()
    at /usr/lib64/libayatana-keyboard-x11.so.0
#3  0x000000000040285e in createLayoutSection.isra.2 ()
#4  0x0000000000403177 in onConfigChanged ()
#5  0x00007ffff7614b8c in  () at /usr/lib64/libgobject-2.0.so.0
#6  0x00007ffff7632bb1 in g_signal_emit_valist ()
    at /usr/lib64/libgobject-2.0.so.0
#7  0x00007ffff763311f in g_signal_emit () at /usr/lib64/libgobject-2.0.so.0
#8  0x00007ffff3c0b8c3 in  () at /usr/lib64/libayatana-keyboard-x11.so.0
#9  0x00007ffff725637d in  () at /usr/lib64/libglib-2.0.so.0
#10 0x00007ffff725582b in g_main_context_dispatch ()
    at /usr/lib64/libglib-2.0.so.0
#11 0x00007ffff7255bd0 in  () at /usr/lib64/libglib-2.0.so.0
#12 0x00007ffff7255ea2 in g_main_loop_run () at /usr/lib64/libglib-2.0.so.0
#13 0x00000000004023f1 in main ()
tari01 commented 8 months ago

Strings can be so painful in C.

The code seems to be working when in MATE, but the keyboard indicator (still) segfaults when run in the greeter.

From my gdb session, I can see that one crash happens in createLayoutSection() if sLanguage is set to NULL (which happens in the greeter here) and if avoiding that crash, the next crash happens in keyboard-x11.c in keyboard_GetLayout() when g_hash_table_lookup_extended() is used.

This should be working properly now, but needs https://github.com/ArcticaProject/arctica-greeter/pull/98