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 698396 - GtkTreeStore crashes when reordering 0 elements
GtkTreeStore crashes when reordering 0 elements
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-04-19 19:13 UTC by Dimitar Zhekov
Modified: 2014-05-13 16:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a small example program (279 bytes, text/plain)
2013-04-19 19:13 UTC, Dimitar Zhekov
  Details
stack trace (397 bytes, application/octet-stream)
2013-04-19 19:16 UTC, Dimitar Zhekov
  Details
treestore: Fix segfault when reordering non-existing children (956 bytes, patch)
2013-04-24 10:43 UTC, Olivier Brunel (jjacky)
none Details | Review
treestore: Fix segfault when reordering non-existing children (950 bytes, patch)
2013-10-15 15:35 UTC, Olivier Brunel (jjacky)
committed Details | Review

Description Dimitar Zhekov 2013-04-19 19:13:19 UTC
Created attachment 241950 [details]
a small example program

The problem is "sort_array[length-1].node->next = NULL;", where length is the number of rows.

Steps to Reproduce: create an empty tree store and try to reorder it.

Expected result: NOP.

Actual result: SIGSEGV.

Platform-independent. All GTK+ 2.2 to 3.6.4, probably the newer ones as well.

Note: I altered gtktreestore.c a bit to compile it with example.c with gcc -g. The crash will occur at line 2209 in gtk+ 2.22.0 and line 2323 in 3.6.4.
Comment 1 Dimitar Zhekov 2013-04-19 19:16:09 UTC
Created attachment 241951 [details]
stack trace
Comment 2 Olivier Brunel (jjacky) 2013-04-24 10:43:36 UTC
Created attachment 242313 [details] [review]
treestore: Fix segfault when reordering non-existing children
Comment 3 Olivier Brunel (jjacky) 2013-10-15 15:35:45 UTC
Created attachment 257360 [details] [review]
treestore: Fix segfault when reordering non-existing children

Updated patch.
Comment 4 Matthias Clasen 2014-05-13 16:00:53 UTC
Attachment 257360 [details] pushed as 0d2d190 - treestore: Fix segfault when reordering non-existing children