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 704700 - Gtk.IconView.get_cursor segfault
Gtk.IconView.get_cursor segfault
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.9.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-07-22 18:35 UTC by cyqzz
Modified: 2013-07-29 07:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case (463 bytes, application/octet-stream)
2013-07-22 18:37 UTC, cyqzz
  Details
Test case without set_cursor (484 bytes, application/octet-stream)
2013-07-22 20:11 UTC, cyqzz
  Details
Add explicit transfer annotations to gtk_icon_view_get_cursor (1.57 KB, patch)
2013-07-28 20:24 UTC, Simon Feltman
committed Details | Review

Description cyqzz 2013-07-22 18:35:46 UTC
Attached program causes a segfault.
Comment 1 cyqzz 2013-07-22 18:37:51 UTC
Created attachment 249831 [details]
Test case
Comment 2 Simon Feltman 2013-07-22 19:40:25 UTC
Confirmed. This seems to be caused by bug #698711. A workaround is to use:
Gtk.TreePath.new()
Comment 3 cyqzz 2013-07-22 20:11:12 UTC
Created attachment 249838 [details]
Test case without set_cursor

I'm not sure it's related to the TreePath.
This test case doesn't call set_cursor and segfaults when you click the item in the IconView.
Comment 4 Simon Feltman 2013-07-28 20:24:37 UTC
Created attachment 250327 [details] [review]
Add explicit transfer annotations to gtk_icon_view_get_cursor

The cell out argument to gtk_icon_view_get_cursor is a pass-through
for gtk_cell_area_get_focus_cell which is transfer none. Without
this explicit annotation, transfer full is defaulted and introspection
bindings will assume ownership of the GtkIconViews reference to the
cell, causing crashes. Additionally add explicit transfer full to
the path parameter because it is expected the caller will free the
returned memory.
Comment 5 Martin Pitt 2013-07-29 04:24:22 UTC
Comment on attachment 250327 [details] [review]
Add explicit transfer annotations to gtk_icon_view_get_cursor

Thanks Simon! LGTM, please push.
Comment 6 Simon Feltman 2013-07-29 07:45:54 UTC
Attachment 250327 [details] pushed as b1a0773 - Add explicit transfer annotations to gtk_icon_view_get_cursor