Crashes on wayland

Bug #1658413 reported by Thibaut Girka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sakura
Fix Released
High
David Gómez
Debian
Fix Released
Unknown

Bug Description

Recent sakura versions crash on keypresses when started as native Wayland clients, most probably because of the changes introduced in http://bazaar.launchpad.net/~dabisu/sakura/sakura/revision/559

#0 0x00007ffff4dea064 in XkbUseExtension (dpy=dpy@entry=0x5555557b6100, major_rtrn=major_rtrn@entry=0x0, minor_rtrn=minor_rtrn@entry=0x0) at ../../../src/xkb/XKBUse.c:652
#1 0x00007ffff4de0c56 in _XkbLoadDpy (dpy=0x5555557b6100) at ../../../src/xkb/XKBBind.c:513
#2 0x00007ffff4de14e0 in XKeysymToKeycode (dpy=0x5555557b6100, ks=65480) at ../../../src/xkb/XKBBind.c:157
#3 0x0000555555561bd8 in ()
#4 0x00007ffff76f4a0c in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#8 0x00007ffff5e51faf in <emit signal ??? on instance 0x5555557cc520 [GtkWindow]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>)
    at ././gobject/gsignal.c:3447
    #5 0x00007ffff5e36f75 in g_closure_invoke (closure=0x555555a8d3b0, return_value=return_value@entry=0x7fffffffdc50, n_param_values=2, param_values=param_values@entry=0x7fffffffdcb0, invocation_hint=invocation_hint@entry=0x7fffffffdc30) at ././gobject/gclosure.c:804
    #6 0x00007ffff5e48f82 in signal_emit_unlocked_R (node=node@entry=0x5555557fcbc0, detail=detail@entry=0, instance=instance@entry=0x5555557cc520, emission_return=emission_return@entry=0x7fffffffddc0, instance_and_params=instance_and_params@entry=0x7fffffffdcb0) at ././gobject/gsignal.c:3635
    #7 0x00007ffff5e5166f in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffde70)
    at ././gobject/gsignal.c:3401
#9 0x00007ffff78413bc in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#10 0x00007ffff76f1ba9 in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#11 0x00007ffff76f3b4e in gtk_main_do_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#12 0x00007ffff7204bf5 in () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#13 0x00007ffff7260622 in () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#14 0x00007ffff5b5d7f7 in g_main_dispatch (context=0x5555557abe20) at ././glib/gmain.c:3203
#15 0x00007ffff5b5d7f7 in g_main_context_dispatch (context=context@entry=0x5555557abe20) at ././glib/gmain.c:3856
#16 0x00007ffff5b5da60 in g_main_context_iterate (context=0x5555557abe20, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ././glib/gmain.c:3929
#17 0x00007ffff5b5dd82 in g_main_loop_run (loop=0x555555a42580) at ././glib/gmain.c:4125
#18 0x00007ffff76f2cb5 in gtk_main () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#19 0x000055555555c464 in main ()

David Gómez (dabisu)
Changed in sakura:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Emmanuel Boudreault (emmanuel-boudreault) wrote :

I have a potential fix but it has only received very light testing. First, we need to replace the sakura_tokeycode macro with a function:

static guint
sakura_tokeycode (guint key) {
    GdkKeymap *keymap = gdk_keymap_get_default();
    GdkKeymapKey *keys;
    gint n_keys;
    guint res = 0;

    if (gdk_keymap_get_entries_for_keyval(keymap, key,
                                          &keys, &n_keys)) {
        if (n_keys > 0) {
            res = keys[0].keycode;
        }
        g_free(keys);
    }

    return res;
}

We then have to remove the X11 includes:

#include <X11/Xlib.h>
#include <gdk/gdkx.h> -> #include <gdk/gdk.h>

We also have to remove the dpy member from the sakura structure.

Hope it helps

Revision history for this message
David Gómez (dabisu) wrote :

Sorry about the long delay in the reply. I've tried when you made your first report to test sakura on Wayland. I managed (kind of) of running Wayland in my system, but no enough to run sakura. After that i was too busy and i didn't have time recently to test it again.

About your patch: It solves the crashes for you? Are you using sakura currently with this patch?

Revision history for this message
Andreas Rönnquist (gusnan) wrote :

I am not the original poster of the bug, but I can confirm that this patch fixes running on wayland. Before the patch, sakura window would get opened nicely, but it would crash immediately on any keypress. With this patch, it doesn't.

Revision history for this message
David Gómez (dabisu) wrote :

Thanks for your feedback, Andreas.

Changed in debian:
status: Unknown → Confirmed
Changed in debian:
status: Confirmed → Fix Released
Revision history for this message
Andreas Rönnquist (gusnan) wrote :

I have pushed a fix thats working for me to https://code.launchpad.net/~gusnan/sakura/fix_wayland

Revision history for this message
David Gómez (dabisu) wrote :

Thanks Emmanuel & Andreas, I've applied the patch and release a new package. Sorry again for the delay.

Changed in sakura:
status: Confirmed → Fix Committed
assignee: nobody → David Gómez (dabisu)
David Gómez (dabisu)
Changed in sakura:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.