GNOME Bugzilla – Bug 413328
gdk-directfb crashes if in a gtkmenu a key other then the arrow or enter key is pressed
Last modified: 2011-02-04 16:10:35 UTC
Steps to reproduce: 1. Run the itemfactory example in gtk+/examples/menu. 2. Open a gtkmenu (by clicking on File or Edit options). 3. Press any key other then the arrow or enter key. Stack trace: Other information: The crash was because gdk_keymap_translate_keyboard_state manipulates certain variables like keyval, effective_group etc. which are passed as NULL from gtk_menu_key_press. The attached patch allocated memory for the variables (if they are passed as NULL) which solves the problem.
Created attachment 83618 [details] [review] patch for fixing the bug. Attachment contains the patch which attempts to fix the crash.
I will build and test the patches. Fix should be in tomorrow.
This fix is not correct. gdk_keymap_translate_keyboard_state is not supposed to return newly allocated memory via those arguments. Instead, it must cope with being passed NULL pointers.
So what is the right answer ? At the moment I do nothing with NULL same as X11. So is their a bug here and if so I think its in X also.
Created attachment 84217 [details] [review] New patch for fixing the bug. This patch will not allocate any new memory, but will check for the NULL arguments. Hope this patch solves the problem correctly.
*** Bug 360870 has been marked as a duplicate of this bug. ***
Amar, can you please check the patch again? I'm getting the following with revision 17564. Thanks :) Hmm... Looks like a unified diff to me... The text leading up to this was: -------------------------- |--- gdkkeys-directfb.c 2007-03-08 12:07:33.000000000 +0530 |+++ gdkkeys.c 2007-03-08 12:17:19.000000000 +0530 -------------------------- Patching file gdkkeys-directfb.c using Plan A... Hunk #1 FAILED at 1941. Hunk #2 succeeded at 1966. 1 out of 2 hunks FAILED -- saving rejects to file gdkkeys-directfb.c.rej done
Created attachment 85831 [details] [review] patch with latest trunk Hi mayank, Attached patch is with latest trunk.Sorry for the earlier patch, i think the error was because of some version problem.
Crap forgot to check this in sorry.
Hi! FYI: The latest patch also fixes the problem described here: http://mail.gnome.org/archives/gtk-devel-list/2007-April/msg00068.html Best regards Christian Schaubschlaeger
The latest patch looks correct. Please commit to both trunk and gtk-2-10
Will do this weekend sorry for the delay I've been swamped with work. The head has other compile errors I fixed. I promise I'll get it this weekend.
Finally fixed in the head. I've not done any back patching so first let me know a bit about that. Next gtk-2-10 has a lot of bugs in the directfb backend I'm not comfortable supporting it. The debian team has done a lot of backpatching to get it stable they may be willing to patch it up to a reasonably stable code base. Because of the number of bugs reported I'd rather leave it broken and urge people to use the coming release for gtk.This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.