GNOME Bugzilla – Bug 667732
Segmentation fault when swithing to "All branches" in a huge repo
Last modified: 2015-08-08 11:38:24 UTC
I notice a segfault when switching to "All branches" in my LibreOffice working copy. It appeared that bitwidth of lane indices (was gint8) was not enough. I attach a patch which extends them to gint16.
Created attachment 205060 [details] [review] patch
Review of attachment 205060 [details] [review]: Patch looks good. I'm just wondering if we should maybe update it to gint32 instead. Ideally I guess I would like to see something which does not limit the number of lanes, but that would require more effort. Note that due to the current use of GINT_TO_POINTER we cannot store more bits (although we could on 64 bits archs). Could you maybe update the assert to a g_return_if_fail? ::: libgitg/gitg-lanes.c @@ +408,3 @@ if (item->next) { + assert(0 <= index && index < g_slist_length(lns)); Please do not use assert. Instead, use g_return_if_fail
See also that using g_slist_length is a bad idea here it can produce performance problems.
The new gitg uses a uint (i.e. 32 bits) which should be plenty for now.