After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 360870 - Crash in gdk_keymap_translate_keyboard_state()
Crash in gdk_keymap_translate_keyboard_state()
Status: RESOLVED DUPLICATE of bug 413328
Product: gtk+
Classification: Platform
Component: [obsolete] Backend: directfb
2.10.x
Other All
: Normal critical
: ---
Assigned To: gtk-bugs
Michael Emmel
Depends on:
Blocks:
 
 
Reported: 2006-10-09 10:29 UTC by Attilio Fiandrotti
Modified: 2007-03-10 04:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The expander widget is transparent and the window surface is trashed (10.97 KB, image/png)
2007-01-21 19:10 UTC, Attilio Fiandrotti
Details

Description Attilio Fiandrotti 2006-10-09 10:29:41 UTC
Steps to reproduce:
To reproduce this crash, launch gtk-demo, open the "menu" app, lick on a menu and, while keeping the mousebutton pressed, press a key on the keyboard.

Stack trace:
Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 17528)

  • #0 IA__gdk_keymap_translate_keyboard_state
    at gdkkeys-directfb.c line 1944
  • #1 gtk_menu_key_press
    at gtkmenu.c line 2728
  • #1 gtk_menu_key_press
    at gtkmenu.c line 2728

(gdb) l
2723        default:
2724          break;
2725        }
2726
2727      /* Figure out what modifiers went into determining the key symbol */
2728      gdk_keymap_translate_keyboard_state (gdk_keymap_get_for_display (display),
2729                                           event->hardware_keycode, event->state, event->group,
2730                                           NULL, NULL, NULL, &consumed_modifiers);
2731
2732      accel_key = gdk_keyval_to_lower (event->keyval);

Other information:
The crash happens if gtk_menu_key_press() calls gdk_keymap_translate_keyboard_state() and passes NULL as 5th parameter.

Crash actually happens in gdkkeys-directfb.c:1944 when trying to write to a null address.
How should the keyval = null case be handled?

cheers

Attilio
Comment 1 Matthias Clasen 2006-10-09 14:23:51 UTC
hmm, the X11 implementation accepts NULL for most of the out params:

  if (keyval)
    *keyval = NoSymbol; 
  if (effective_group)
    *effective_group = 0;
  if (level)
    *level = 0;
  if (consumed_modifiers)
    *consumed_modifiers = 0;


That should probably be documented.
Comment 2 Matthias Clasen 2006-10-09 14:49:31 UTC
I've updated the docs.
Comment 3 Attilio Fiandrotti 2007-01-21 19:10:48 UTC
Created attachment 80826 [details]
The expander widget is transparent and the window surface is trashed
Comment 4 Matthias Clasen 2007-03-10 04:16:21 UTC

*** This bug has been marked as a duplicate of 413328 ***