[Freeciv-Dev] (PR#16009) client crash in /load
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=16009 >
Christian Knoke wrote:
> This bug report didn't make it to RT:
>
> SVN 2.1 22 MAR 2006 GTK2 Linux
>
> civclient crashes with a segmaentation fault on loading the attached
save game (and
> HEAD does as well).
>
> civlient -d 3 says:
>
> [...]
> 3: Don't have graphics tags a.writing or - for tech_type Schrift
> 3: Don't have graphics tags t.ocean1 or for tile_type Ozean
> Speicherzugriffsfehler (core dumped)
>
> (gdb) bt full
> #0 skip_intl_qualifier_prefix (str=0x8 <Address 0x8 out of bounds>) at
> fcintl.c:43
> No locals.
> #1 0x080bdeb8 in add_new_nation_group (name=0x8a9079c
> "?nationgroup:Ancient") at nation.c:360
> i = 0
> group = (struct nation_group *) 0x4
> #2 0x0808ed08 in handle_ruleset_nation_groups (packet=0x8a90798) at
> packhand.c:2414
> group = (struct nation_group *) 0x8
> i = 0
> #3 0x08090016 in client_handle_packet (type=PACKET_SERVER_SHUTDOWN,
> packet=0x0) at packhand_gen.c:279
> No locals.
> #4 0x080725cb in handle_packet_input (packet=0x8, type=118) at
> civclient.c:421
> No locals.
> #5 0x0807612f in input_from_server (fd=4) at clinet.c:379
> result = true
> packet = (void *) 0x8a90798
> type = PACKET_RULESET_NATION_GROUPS
> #6 0x403296ab in gdk_get_show_events () from /usr/lib/libgdk-x11-2.0.so.0
> No symbol table info available.
> #7 0x00000004 in ?? ()
> No symbol table info available.
> #8 0x00000004 in ?? ()
> No symbol table info available.
> #9 0x00000001 in ?? ()
> No symbol table info available.
> #10 0x404ec398 in ?? () from /usr/lib/libglib-2.0.so.0
> No symbol table info available.
> #11 0x08953360 in ?? ()
> No symbol table info available.
> #12 0x40329640 in gdk_get_show_events () from /usr/lib/libgdk-x11-2.0.so.0
> No symbol table info available.
> #13 0xbffff378 in ?? ()
> No symbol table info available.
> #14 0x404b6dbf in g_vasprintf () from /usr/lib/libglib-2.0.so.0
> No symbol table info available.
> #15 0x404b6dbf in g_vasprintf () from /usr/lib/libglib-2.0.so.0
> No symbol table info available.
> #16 0x40491582 in g_main_depth () from /usr/lib/libglib-2.0.so.0
> No symbol table info available.
> #17 0x404925f8 in g_main_context_dispatch () from
/usr/lib/libglib-2.0.so.0
> No symbol table info available.
> ---Type <return> to continue, or q <return> to quit---
> #18 0x40492930 in g_main_context_dispatch () from
/usr/lib/libglib-2.0.so.0
> No symbol table info available.
> #19 0x40492ed3 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
> No symbol table info available.
> #20 0x40151bb3 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
> No symbol table info available.
> #21 0x0812a46e in ui_main (argc=1, argv=0xbffff7c4) at gui_main.c:1340
> home = (const gchar *) 0x8 <Address 0x8 out of bounds>
> sig = 8
> style = (GtkStyle *) 0x8341a30
> #22 0x08071cea in main (argc=1, argv=0xbffff7c4) at civclient.c:378
> i = 3
> loglevel = 3
> ui_options = 0
> ui_separator = false
> option = 0x200 <Address 0x200 out of bounds>
>
> Starting civserver seperately avoids the crash.
Here's a patch. The problem is the nation groups are being sent twice.
-jason
Index: common/game.c
===================================================================
--- common/game.c (revision 11788)
+++ common/game.c (working copy)
@@ -359,6 +359,7 @@
city_styles_free();
terrains_free();
ruleset_cache_free();
+ nation_groups_free();
}
/***************************************************************
Index: common/nation.c
===================================================================
--- common/nation.c (revision 11788)
+++ common/nation.c (working copy)
@@ -358,7 +358,7 @@
for (i = 0; i < num_nation_groups; i++) {
if (mystrcasecmp(Qn_(name), Qn_(nation_groups[i].name)) == 0) {
freelog(LOG_FATAL, "Duplicate group name %s.",
- Qn_(group->name));
+ Qn_(name));
exit(EXIT_FAILURE);
}
}
@@ -433,6 +433,14 @@
}
/****************************************************************************
+ Frees and resets all nation group data.
+****************************************************************************/
+void nation_groups_free(void)
+{
+ num_nation_groups = 0;
+}
+
+/****************************************************************************
Return TRUE iff the editor is allowed to edit the player's nation in
pregame.
****************************************************************************/
Index: common/nation.h
===================================================================
--- common/nation.h (revision 11788)
+++ common/nation.h (working copy)
@@ -138,6 +138,7 @@
struct nation_group *find_nation_group_by_name_orig(const char *name);
bool is_nation_in_group(struct nation_type *nation,
struct nation_group *group);
+void nation_groups_free(void);
#define nation_groups_iterate(pgroup) \
{ \
Index: client/packhand.c
===================================================================
--- client/packhand.c (revision 11788)
+++ client/packhand.c (working copy)
@@ -2410,6 +2410,7 @@
{
int i;
+ nation_groups_free();
for (i = 0; i < packet->ngroups; i++) {
struct nation_group *group = add_new_nation_group(packet->groups[i]);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#16009) client crash in /load,
Jason Short <=
|
|