GNOME Bugzilla – Bug 694711
write-after-free segfault in GailTreeView
Last modified: 2013-05-09 16:01:14 UTC
Created attachment 237397 [details] [review] Remove-dangling-weak-refs-to-TreeModel-object.patch While fixing memory/object leaks in Grisbi, I came across a segfault when freeing a GtkTreeView. After much digging around with gdb and Valgrind, I found the source of the bug to be in GailTreeView (launching Grisbi with NO_GAIL=1 does indeed work around the crash). The issue is due to the weak refs pointing to the TreeView's model object as they are never properly cleaned up. In my case, the segfault occurs if I free a GtkTreeView before freeing its attached GtkTreeStore. Looking at gailtreeview.c, I suspect that the bug may be triggered if the model/store is unset. Right now, I've been able to confirm that this patch fixes the issue with Grisbi. If needed, I'll try to cook up a smaller test case. Thanks
Review of attachment 237397 [details] [review]: makes sense