Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] Re: civclient: cma_core.c:1198: add_combination: Zusicher
Home

[Freeciv-Dev] Re: civclient: cma_core.c:1198: add_combination: Zusicher

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: civclient: cma_core.c:1198: add_combination: Zusicherung »invalid_slot_for_ insert != ((void *)0) « nicht erfüllt. (PR#1290)
From: Jason Short <vze2zq63@xxxxxxxxxxx>
Date: Sat, 02 Mar 2002 07:18:49 -0500
Reply-to: jdorje@xxxxxxxxxxxx

Raimar Falke wrote:
On Fri, Mar 01, 2002 at 01:37:05PM -0800, martin@xxxxxxxxxx wrote:

Full_Name: Martin Schröder
Version: 1.12.1-devel (freeciv-cvs-Feb-28.tar.bz2)
Distribution: Built from source
Client: Gtk+
OS: Linux 2.2.10
Submission from: (NULL) (134.102.7.161)


civclient stops with

civclient: cma_core.c:1198: add_combination: Zusicherung
»invalid_slot_for_insert != ((void *)0)« nicht erfüllt.

Problem is reproducible; savegame available on request.


Patch which fixes the problem attached.

I know very little about the CMA (in fact, I can't figure out what add_combination does even after reading the comment on it), but it sure seems like this doesn't "fix" the problem at all. It just changes things from an assert (or random segfault under NDEBUG) to a freelog+exit.

A proper fix would either dynamically expand MAX_COMBINATIONS (obviously it could not then be a #define, but should be a static value of some sort), or return without adding the combination at all (possibly with an error return value). The latter is easier, assuming the calling code can deal with it with minimal fuss. The former is better almost all of the time - it can only really fail if the number of combinations ever grows without bound.

jason



[Prev in Thread] Current Thread [Next in Thread]