Summary: Client segfaults when buying while the cities
report is open
                 Project: Freeciv
            Submitted by: mrvn
            Submitted on: Tuesday 09/28/2010 at 19:51
                Category: client-gtk-2.0
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: 2.2.99+svn18101
         Discussion Lock: Any
        Operating System: GNU/Linux
         Planned Release: 



Opening the cities report (F4), sorting by "Currently Building" and then
buying something causes a segfault.

The problem seems to be that the client stores NULL entries in the gtk tree
in merge_list_stores(). This causes the compare function to be called with a
NULL string which segfaults when it tries to split it.

As a workaround I patched
int cityrepfield_compare(const char *str1, const char *str2)
to handle NULL strings. This avoids the segfault but then GTK complains

(freeciv-gtk2:6001): Gtk-CRITICAL **: gtk_list_store_move_after: assertion
`!GTK_LIST_STORE_IS_SORTED (store)' failed

and the list of cities shown in the report becomes incomplete. Closing and
reopening the report fixes that.

Patch attached.



File Attachments:

Date: Tuesday 09/28/2010 at 19:51  Name: freeciv-cities-segfault.patch  Size:
525B   By: mrvn
Prevent segfault when buying things. Does not fix the real problem.


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to