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 413328 - gdk-directfb crashes if in a gtkmenu a key other then the arrow or enter key is pressed
gdk-directfb crashes if in a gtkmenu a key other then the arrow or enter key ...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: [obsolete] Backend: directfb
unspecified
Other All
: Normal critical
: ---
Assigned To: gtk-bugs
Michael Emmel
Obsolete patch
: 360870 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-03-01 04:47 UTC by Amar Balutkar
Modified: 2011-02-04 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for fixing the bug. (743 bytes, patch)
2007-03-01 04:59 UTC, Amar Balutkar
rejected Details | Review
New patch for fixing the bug. (1.04 KB, patch)
2007-03-08 07:06 UTC, Amar Balutkar
none Details | Review
patch with latest trunk (1.13 KB, patch)
2007-04-05 05:04 UTC, Amar Balutkar
accepted-commit_now Details | Review

Description Amar Balutkar 2007-03-01 04:47:37 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.
Comment 1 Amar Balutkar 2007-03-01 04:59:05 UTC
Created attachment 83618 [details] [review]
patch for fixing the bug.

Attachment contains the patch which attempts to fix the crash.
Comment 2 Michael Emmel 2007-03-01 07:23:52 UTC
I will build and test the patches.

Fix should be in tomorrow.

Comment 3 Matthias Clasen 2007-03-07 19:43:16 UTC
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.
Comment 4 Michael Emmel 2007-03-08 05:51:35 UTC
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.

Comment 5 Amar Balutkar 2007-03-08 07:06:38 UTC
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.
Comment 6 Matthias Clasen 2007-03-10 04:16:21 UTC
*** Bug 360870 has been marked as a duplicate of this bug. ***
Comment 7 makuchaku (Mayank) 2007-03-27 14:39:38 UTC
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
Comment 8 Amar Balutkar 2007-04-05 05:04:33 UTC
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.
Comment 9 Michael Emmel 2007-04-05 05:34:56 UTC
Crap forgot to check this in sorry.
Comment 10 Christian Schaubschlaeger 2007-04-17 13:23:21 UTC
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

Comment 11 Matthias Clasen 2007-04-27 23:32:50 UTC
The latest patch looks correct. Please commit to both trunk and gtk-2-10
Comment 12 Michael Emmel 2007-04-27 23:43:46 UTC
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.
Comment 13 Michael Emmel 2007-05-01 16:15:44 UTC
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.