View Issue Details

IDProjectCategoryLast Update
0025716AI War 2Gameplay IssueDec 20, 2021 6:35 pm
ReporterBadgerBadger Assigned ToChris_McElligottPark  
Status resolvedResolutionfixed 
Product VersionBeta 3.742 "Classic Map" For DLC1 
Fixed in VersionBeta 3.770 Bug Roasting 
Summary0025716: Primary key could not be found but its not in death registry
DescriptionI had just loaded a save game when I saw this error:

10/29/2021 6:29:26 PM 3.741 SINGLEP Start load save: /home/wdavis/AIWar2/PlayerData/Save/FortBriggs/zxc.save Source1: AnythingElse Source3: LoadingSaveGame
10/29/2021 6:29:28 PM 3.741 SINGLEP Recalculated Strengths For Loaded Galaxy Map in 43ms
10/29/2021 6:29:28 PM 3.741 SINGLEP Finish load save in 2,097.6ms
10/29/2021 6:29:39 PM 3.741 SINGLEP DELAYED8: The PrimaryKeyID 3187 could not be found for the last 10 seconds, but it is not in the death registry. Where did it go!?
  at System.Environment.get_StackTrace () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
  at Arcen.Universal.ArcenDebugging.ArcenDebugLog (System.String Message, Arcen.Universal.Verbosity Verbosity) [0x00012] in /home/arcengames_aiw-ultra/CodeCrossProject/ArcenUniversal/src/UtilityLibraries/ArcenDebugging.cs:258
  at Arcen.AIW2.Core.LazyLoadSquadWrapper.HandleDictCall () [0x000b2] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/GameEntity/LazyLoadSquadWrapper.cs:140
  at Arcen.AIW2.Core.LazyLoadSquadWrapper.GetSquadAndIgnoreAnyPermaNull () [0x00011] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/GameEntity/LazyLoadSquadWrapper.cs:81
  at Arcen.AIW2.Core.LazyLoadSquadWrapper.GetPrimaryKeyID () [0x00015] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/GameEntity/LazyLoadSquadWrapper.cs:63
  at Arcen.AIW2.External.EntitySimLogicImplementation_BaseInfo.AttackerLogic_Combat (Arcen.AIW2.Core.ArcenClientOrHostSimContextCore Context, Arcen.AIW2.Core.GameEntity_Squad Entity, Arcen.AIW2.Core.EntityOrder order, Arcen.AIW2.Core.GameEntity_Squad guarded, System.Boolean AllowOverridingHumanOrders, Arcen.AIW2.Core.FleetMembership fleetMem, Arcen.AIW2.Core.GameEntityTypeData+MarkLevelStats entityMarkData, Arcen.AIW2.Core.Faction faction, Arcen.AIW2.Core.EntityOrderCollection entityOrders) [0x00000] in <3dd16d06478e4f419ddb70f54c11e83d>:0
  at Arcen.AIW2.External.EntitySimLogicImplementation_BaseInfo.AttackerLogic (Arcen.AIW2.Core.ArcenClientOrHostSimContextCore Context, Arcen.AIW2.Core.GameEntity_Squad Entity, Arcen.AIW2.Core.EntityOrder order, Arcen.AIW2.Core.GameEntity_Squad guarded, System.Boolean AllowOverridingHumanOrders, System.Boolean OnlyInRange, Arcen.AIW2.Core.FleetMembership fleetMem, Arcen.AIW2.Core.GameEntityTypeData+MarkLevelStats entityMarkData, Arcen.AIW2.Core.Faction faction, Arcen.AIW2.Core.EntityOrderCollection entityOrders) [0x00000] in <3dd16d06478e4f419ddb70f54c11e83d>:0
  at Arcen.AIW2.External.EntitySimLogicImplementation_BaseInfo.ReevaluateUnitOrders (Arcen.AIW2.Core.ArcenClientOrHostSimContextCore Context, Arcen.AIW2.Core.GameEntity_Squad Entity) [0x00000] in <3dd16d06478e4f419ddb70f54c11e83d>:0
  at Arcen.AIW2.External.EntitySimLogicImplementation_BaseInfo+<DoShipAILogic>c__AnonStorey19.<>m__1 (Arcen.AIW2.Core.GameEntity_Squad entity) [0x00000] in <3dd16d06478e4f419ddb70f54c11e83d>:0
  at Arcen.AIW2.Core.EntityCollection.DoForEntities (Arcen.AIW2.Core.GameEntity_Squad+ProcessorDelegate Processor) [0x0004d] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/GameEntity/EntityCollection.cs:737
  at Arcen.AIW2.Core.Planet.DoForEntities (Arcen.AIW2.Core.GameEntity_Squad+ProcessorDelegate Processor) [0x0002a] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/Mapping/Planet.cs:2939
  at Arcen.AIW2.External.EntitySimLogicImplementation_BaseInfo+<DoShipAILogic>c__AnonStorey19.<>m__0 (Arcen.AIW2.Core.Planet planet) [0x00000] in <3dd16d06478e4f419ddb70f54c11e83d>:0
  at Arcen.AIW2.Core.Galaxy.DoForPlanetsSingleThread (System.Boolean IncludeDestroyed, Arcen.AIW2.Core.Planet+ProcessorDelegate Processor) [0x00044] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/Mapping/Galaxy.cs:421
  at Arcen.AIW2.Core.World_AIW2.DoForPlanetsSingleThread (System.Boolean IncludeDestroyed, Arcen.AIW2.Core.Planet+ProcessorDelegate Processor) [0x0001f] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/World_AIW2.cs:4011
  at Arcen.AIW2.External.EntitySimLogicImplementation_BaseInfo.DoShipAILogic (Arcen.AIW2.Core.ArcenClientOrHostSimContextCore Context) [0x00000] in <3dd16d06478e4f419ddb70f54c11e83d>:0
  at Arcen.AIW2.External.EntitySimLogicImplementation_BaseInfo.DoWorldStepLogic_ClientOrHost_FromSimBGThread (Arcen.AIW2.Core.ArcenClientOrHostSimContextCore Context) [0x00000] in <3dd16d06478e4f419ddb70f54c11e83d>:0
  at Arcen.AIW2.External.SimExecution.Execute () [0x00000] in <3dd16d06478e4f419ddb70f54c11e83d>:0
  at Arcen.AIW2.External.ArcenClientOrHostSimPlanningContext.InnerRun () [0x00000] in <3dd16d06478e4f419ddb70f54c11e83d>:0
  at Arcen.AIW2.External.ArcenExecutionContext.InnerRun () [0x00000] in <3dd16d06478e4f419ddb70f54c11e83d>:0
  at Arcen.AIW2.External.ArcenThread.InternalActualThreadFunction () [0x00000] in <3dd16d06478e4f419ddb70f54c11e83d>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0

This is on the most recent svn
TagsNo tags attached.

Activities

Daniexpert

Oct 30, 2021 4:48 pm

manager   ~0063071

I found it also. Seems to be pretty rare.

BadgerBadger

Nov 1, 2021 2:26 am

manager   ~0063106

I've seen this a number of times in recent testing

Chris_McElligottPark

Nov 1, 2021 9:49 am

administrator   ~0063116

Okay, good to know. I haven't, but I haven't been letting battles go on for long enough. I think what I'm going to do tomorrow is set it up so that there's a thread that kicks off once per second that loops through all the units and finds them, and then adds them to the central registry if they are missing. I can use basically the same sort of logic I did for the TimeBasedPool stuff ticking over.

As far as why this happens in the first place, I can then instrument the code where things are registered and unregistered and look for anomalies. That in itself will be pretty hard to parse as far as data goes, so I think what I'll do is log internally to some data structure, then only actually write the relevant backhistory when it finds a problem case that had to be repaired. That way I only get the history of the problem ones, once I know they are a problem, versus having to look past the histories of all the ones that are working correctly.

This particular bug affects targeting (always has), affects fireteams after savegame load (relatively newly, because of the lazy load squad wrapper use there), and is the cause of multiplayer ghosts. If I can figure out what is going on to cause it, that would be ideal. If I can just repair it with a background thread, then that's an acceptable fallback.

Other than the memory leak, this is actually the most severe bug the game has in terms of long-running effect on things (MP most of all, naturally, but SP also).

Chris_McElligottPark

Dec 20, 2021 6:35 pm

administrator   ~0063535

Should be fixed now, thanks!

Issue History

Date Modified Username Field Change
Oct 29, 2021 8:35 pm BadgerBadger New Issue
Oct 29, 2021 8:35 pm BadgerBadger Status new => assigned
Oct 29, 2021 8:35 pm BadgerBadger Assigned To => Chris_McElligottPark
Oct 30, 2021 4:48 pm Daniexpert Note Added: 0063071
Nov 1, 2021 2:26 am BadgerBadger Note Added: 0063106
Nov 1, 2021 9:49 am Chris_McElligottPark Note Added: 0063116
Dec 20, 2021 6:35 pm Chris_McElligottPark Status assigned => resolved
Dec 20, 2021 6:35 pm Chris_McElligottPark Resolution open => fixed
Dec 20, 2021 6:35 pm Chris_McElligottPark Fixed in Version => Beta 3.770 Bug Roasting
Dec 20, 2021 6:35 pm Chris_McElligottPark Note Added: 0063535