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

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

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [Freeciv-Dev] Re: civclient: cma_core.c:1198: add_combination: Zusicherung »invalid_slot_for_ insert != ((void *)0) « nicht erfüllt. (P Message-ID: <20020302143120.A4179@xxxxxxxxxxxxxxxxxxxxxxx>
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 2 Mar 2002 14:31:20 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sat, Mar 02, 2002 at 07:18:49AM -0500, Jason Short wrote:
> 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.

And increases MAX_COMBINATIONS.

> 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.

Allocating things statically is a lot easier. However this causes
extra memory usage: cache2 is 225k and cache3 is 411k.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Understanding is a three-edged sword; 
  your side, their side, and the truth."
    -- a well-known Vorlon



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