Complete.Org: Mailing Lists: Archives: freeciv-ai: December 2002:
[freeciv-ai] Re: [Freeciv-Dev] Re: (PR#2518) ai reading from raw memory?
Home

[freeciv-ai] Re: [Freeciv-Dev] Re: (PR#2518) ai reading from raw memory?

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kaufman@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: [Freeciv-Dev] Re: (PR#2518) ai reading from raw memory?
From: "Raimar Falke via RT" <rt@xxxxxxxxxxxxxx>
Date: Mon, 9 Dec 2002 00:24:55 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Sun, Dec 08, 2002 at 03:13:54PM -0800, Raimar Falke via RT wrote:
> On Sun, Dec 08, 2002 at 02:41:54PM -0800, Mike Kaufman via RT wrote:
> > 
> > while testing my general effects patch, I noticed that I was getting
> > diverging savegames. Because I am fairly sure I wasn't touching any code
> > that would cause such a thing, I did a bit of investigation (but not too
> > much, otherwise you guys wouldn't get to have any fun...)
> > 
> > it seems that somewhere, the ai is looking at raw memory and making
> > calculations based on this.
> > 
> > Procedure:
> > 
> > 1. compile two trees with debugging
> > 2. apply this diff to one tree:
> 
> Sounds like a nice job for valgrind.

And the two errors it found:
==14500== Conditional jump or move depends on uninitialised value(s)
==14500==    at 0x80A12CE: contemplate_new_city (settlers.c:1565)
==14500==    by 0x80D0203: ai_manage_cities (aicity.c:494)
==14500==    by 0x80D2A82: ai_do_last_activities (aihand.c:377)
==14500==    by 0x804EB9E: end_turn (srv_main.c:485)
==14500==
==14500== Conditional jump or move depends on uninitialised value(s)
==14500==    at 0x80D49ED: copy_if_better_choice (aitools.c:451)
==14500==    by 0x80D39B8: ai_next_tech_goal (aitech.c:247)
==14500==    by 0x8084920: choose_goal_tech (plrhand.c:433)
==14500==    by 0x8084238: found_new_tech (plrhand.c:274)

The first one is obvious. ->type is uninitialised in the second one.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Many of my assistants were fans of Tolkien, who wrote 'Lord of the Rings'
  and a number of other children's stories for adults.  The first character
  alphabet that was programmed for my plotter was Elvish rather than Latin."
    -- from SAIs "life as a computer for a quarter of a century"




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