[Freeciv-Dev] Re: (PR#4536) pcity->ai.urgency not updated after reload
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
--On Friday, July 11, 2003 09:29:35 -0700 Gregory Berkolaiko
<Gregory.Berkolaiko@xxxxxxxxxxxx> wrote:
>
> On Fri, 11 Jul 2003, Jason Short wrote:
>
>> Valgrind shows that pcity->ai.urgency is never updated after a saved
>> game is loaded.
>
> AFAIU it was introduced by commenting out srv_main.c:1772
> ===================
> Revision 1.125 / (download) - [select for diffs] , Fri May 2 16:41:04
> 2003 UTC (2 months, 1 week ago) by per
> Changes since 1.124: +1 -1 lines
> Diff to previous 1.124
>
> Kludge fix for a bug that appear with AI government code change. The bug
> appears because we send unit info before data has been properly
> initialized in the client. A call to assess_danger_player() that seems
> totally unnecessary triggers the bug, and has therefore been removed.
> Further investigation and fixing is in order, however.
> ===================
>
> For more info see 4107.
>
>> Most likely this is a bug; the urgency should be recalculated when it is
>> needed. Possibly the urgency should be saved. This patch simply
>> initializes it to 0.
>
> Does valgrind tell us where is it used uninitialized?
==32185== Conditional jump or move depends on uninitialised value(s)
==32185== at 0x80C9D74: ai_airlift (aiunit.c:110)
==32185== by 0x80CFDF3: ai_manage_units (aiunit.c:2894)
==32185== by 0x804DEA8: ai_start_turn (srv_main.c:432)
==32185== by 0x804F6E2: main_loop (srv_main.c:1438)
==32185==
==32185== Conditional jump or move depends on uninitialised value(s)
==32185== at 0x80CD4A1: ai_military_findjob (aiunit.c:1655)
==32185== by 0x80CF8A8: ai_manage_military (aiunit.c:2746)
==32185== by 0x80CFEAD: ai_manage_units (aiunit.c:2896)
==32185== by 0x804DEA8: ai_start_turn (srv_main.c:432)
==32185==
==32185== Conditional jump or move depends on uninitialised value(s)
==32185== at 0x80CB252: stay_and_defend (aiunit.c:791)
==32185== by 0x80CD07A: ai_military_findjob (aiunit.c:1692)
==32185== by 0x80CF8A8: ai_manage_military (aiunit.c:2746)
==32185== by 0x80CFEAD: ai_manage_units (aiunit.c:2896)
==32185==
==32185== Conditional jump or move depends on uninitialised value(s)
==32185== at 0x80CD088: ai_military_findjob (aiunit.c:1698)
==32185== by 0x80CF8A8: ai_manage_military (aiunit.c:2746)
==32185== by 0x80CFEAD: ai_manage_units (aiunit.c:2896)
==32185== by 0x804DEA8: ai_start_turn (srv_main.c:432)
After a few more like these it gives the "30000 errors detected" message.
When ai.urgency is initialized only a few errors are left.
In other words, it is first used uninitialized in aiunit.c:110, then
successively many other places.
jason
[Freeciv-Dev] Re: (PR#4536) pcity->ai.urgency not updated after reload, Gregory Berkolaiko, 2003/07/11
[Freeciv-Dev] Re: (PR#4536) pcity->ai.urgency not updated after reload, Per I. Mathisen, 2003/07/15
[Freeciv-Dev] Re: (PR#4536) pcity->ai.urgency not updated after reload, Gregory Berkolaiko, 2003/07/15
[Freeciv-Dev] Re: (PR#4536) pcity->ai.urgency not updated after reload, Per I. Mathisen, 2003/07/15
|
|