Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2003:
[Freeciv-Dev] Re: (PR#4260) get_defender bug
Home

[Freeciv-Dev] Re: (PR#4260) get_defender bug

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#4260) get_defender bug
From: "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 19 May 2003 08:17:08 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Mon, May 19, 2003 at 04:59:58AM -0700, Gregory Berkolaiko wrote:
> 
> On Sun, 18 May 2003, Per I. Mathisen wrote:
> 
> > On Sun, 18 May 2003, Mike Kaufman wrote:
> > > 1: get_defender bug: Gro Harlem Brundtland's Archers vs Tassilo III's
> > > Archers (total 4 units) on Ocean at (9,36).
> > > > civserver: combat.c:514: get_defender: Assertion `0' failed.
> > > Aborted (core dumped)
> > >
> > > #00x400e3021 in __kill () at __kill:-1
> > > #10x400e2ca8 in raise (sig=1075741620) at ../sysdeps/posix/raise.c:27
> > > #20x400e456c in *__GI_abort () at ../sysdeps/generic/abort.c:88
> > > #30x400dc01a in *__GI___assert_fail (assertion=0x0, file=0x0, line=0,
> > >   function=0x80f0489 "get_defender") at assert.c:83
> > > #40x080a197b in get_defender (attacker=0x8687738, x=9, y=36) at
> > > combat.c:514
> > > #50x080d003f in find_something_to_kill (pplayer=0x817e088,
> > > punit=0x8687738,
> > >   x=0xbffffb54, y=0xbffffb58) at aiunit.c:2229
> > 
> 
> I believe it's normally caused by units in a transport belonging to 
> another player.  Mike, is it the case here?

Only possibly, but it's bug if so, we don't have any allies, this is a 
straight AI autogame. What's interesting is that there is only one of 
Gro Harlem Brundtland' archers are anywhere close to (9,36) and he's pretty 
far away (I don't think even a great convoy of transporting triremes can 
get him to 9,36). And this assert happens that same turn. I would guess 
that the owner got changed somehow, yet taking over Gro and sitting there
will avoid the core...

I've uploaded the game in question:

Gro_and_Tass_get_defender.sav.gz to incoming/
 
> > Yes. This has been discussed before but we didn't agree on a short-term
> > fix. It was introduced by Greg's fstk cleanup. I suggested adding a call
> > to can_unit_attack_unit_at_tile() before this call to get_defender(). The
> > bug is that we try to attack units on board a ferry, which does not yield
> > a valid defender. Greg's suggested short-term fix was AFAICT removing the
> > assert in get_defender(). Both will do as a kludge.
> 
> I think Per's suggestion is not a kludge and should be done anyway.  Mike, 
> please add
>  if (!can_unit_attack_unit_at_tile(punit, aunit, aunit->x, aunit->y) {
>    continue;
>  }
> 
> on line 2228 in aunit.c

well, this avoided it, but a turn later we get:
> civserver: sanitycheck.c:244: check_units: Assertion
> `ground_unit_transporter_capacity(x, y, pplayer) >= 0' failed.

so I think we're bugged elsewhere.

-mike



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