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 601611 - gtk_selection_data_get_targets() reads X Atom data as GdkAtoms
gtk_selection_data_get_targets() reads X Atom data as GdkAtoms
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.19.x
Other Linux
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 568263
 
 
Reported: 2009-11-11 21:42 UTC by Karl Tomlinson
Modified: 2009-11-28 15:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Karl Tomlinson 2009-11-11 21:42:12 UTC
Since bug 568263 landed (for 2.15.1), gtk_selection_data_get_targets() tries to return GdkAtom targets for data of type gtk_selection_atoms[TARGETS] without
conversion.  gdk_selection_property_get() does not convert data of type
TARGETS to GdkAtoms.

This can cause crashes when applications assume that |GdkAtom** targets|
points to GdkAtoms.

I assume the conversion should be done in gtk_selection_data_get_targets() as
doing the conversion in gdk_selection_property_get() would create backward
compatibility issues (unless it also changed ret_type to
GDK_SELECTION_TYPE_ATOM but that might be a bit scary).
Comment 1 Karl Tomlinson 2009-11-15 21:45:05 UTC
Looks like the Java bug is fixed now anyway, so probably the best solution to this bug is to remove the workaround from bug 568263 that causes this problem.
http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=f9cc25b871a1bffffffffb8a0e123c0db94f?bug_id=6607163
Comment 2 Martin Stransky 2009-11-25 09:42:07 UTC
I can reproduce it with OpenJDK/Fedora 12.
Comment 3 Matthias Clasen 2009-11-28 15:23:24 UTC
We can't do the conversion properly in gtk_selection_data_get_targets, since we don't have  a display there. So I guess we should inddeed remove the broken workaround and rely on Java to fix their stuff.

Martin, is there a bug filed against OpenJDK ? This should be fairly easy to fix...
Comment 4 Matthias Clasen 2009-11-28 15:32:23 UTC
commit 6dfb21e616bdf1e1db7ed86bff08fcb68210f17e
Author: Matthias Clasen <mclasen@redhat.com>
Date:   Sat Nov 28 10:27:32 2009 -0500

    Rework a broken workaround for a Java bug
    
    This was committed to fix bug 568263, but it is not correct, as
    pointed out in 601611.