GNOME Bugzilla – Bug 653706
key typing causes infinite-loop in VNC environment
Last modified: 2011-07-01 00:46:04 UTC
key typing causes infinite-loop in VNC environment. For example, gtk3-demo freezes when I type a key on GtkEntry. I trace gtk3-demo using gdb, it maybe run infinite-loop in gdk_x11_keymap_get_entries_for_keyval at gdk/x11/gdkkeys-x11.c. It occurs in only VNC environment, not plain X. gtk+ 2.24.4 : not occurs gtk+ 3.0.10 : occurs Regards, dai --
do you have a stacktrace that shows the infinite loop ?
Here is stacktrace. 0x00002b406ee3c1f0 in gdk_x11_keymap_get_entries_for_keyval (keymap=0xfbc110, keyval=99, keys=0xfb23b0, n_keys=0xfb23b8) at /tmp/buildd/gtk+3.0-3.0.10/./gdk/x11/gdkkeys-x11.c:868 868 if (syms[i] == keyval) (gdb) bt
+ Trace 227628
882 ++i; (gdb) n 866 while (i < keymap_x11->keysyms_per_keycode) (gdb) n 868 if (syms[i] == keyval) (gdb) n 882 ++i; (gdb) n 866 while (i < keymap_x11->keysyms_per_keycode) (gdb) n 861 while (keycode <= keymap_x11->max_keycode) (gdb) n 863 const KeySym *syms = map + (keycode - keymap_x11->min_keycode) * keymap_x11->keysyms_per_keycode; (gdb) n 866 while (i < keymap_x11->keysyms_per_keycode) (gdb) n 863 const KeySym *syms = map + (keycode - keymap_x11->min_keycode) * keymap_x11->keysyms_per_keycode; (gdb) n 866 while (i < keymap_x11->keysyms_per_keycode) (gdb) n 864 gint i = 0; (gdb) n 868 if (syms[i] == keyval) (gdb) n 882 ++i; (gdb) n 866 while (i < keymap_x11->keysyms_per_keycode) (gdb) n 868 if (syms[i] == keyval) (gdb) n 882 ++i; (gdb) n 866 while (i < keymap_x11->keysyms_per_keycode) (gdb) n 861 while (keycode <= keymap_x11->max_keycode) (gdb) n 863 const KeySym *syms = map + (keycode - keymap_x11->min_keycode) * keymap_x11->keysyms_per_keycode; (gdb) n 866 while (i < keymap_x11->keysyms_per_keycode) (gdb) n 863 const KeySym *syms = map + (keycode - keymap_x11->min_keycode) * keymap_x11->keysyms_per_keycode; (gdb) n 866 while (i < keymap_x11->keysyms_per_keycode) (gdb) n 864 gint i = 0; (gdb)
Looks like the while (keycode <= ... loop simply misses a keycode++; ?
Indeed, that was it. Should be fixed in master and gtk-3-0 now.
3.0.10 applied c5d26520d2d6c72fcd13941cc30e35c40294a2ba does not loop. Thank you.