bbradson / Performance-Fish

Performance Mod for RimWorld
Mozilla Public License 2.0
423 stars 34 forks source link

Tons of errors: Failed to find parent index in FishTable<PerformanceFish.GroupThingPair, System.Int32> #26

Closed DarkDaskin closed 2 months ago

DarkDaskin commented 4 months ago

After installing the mod and playing for an hour or so, I started getting bunches of errors from time to time.

Did not find yet what broke or what causes the errors.

Exception ticking Yak3025493 (at (144, 0, 136)): System.InvalidOperationException: Failed to find parent index in FishTable<PerformanceFish.GroupThingPair, System.Int32> for key: 'GroupThingPair { ThingRequestGroup = Everything, ThingIDNumber = 3444550 }', hashCode: '36998982', value: '36', count: '239', bucket array length: '1024', total tailing entries count: '33', known chain of tails:
{ index: '430' key: 'GroupThingPair { ThingRequestGroup = AttackTarget, ThingIDNumber = 2877492 }', hashCode: '271312948', value: '0 }
at (wrapper dynamic-method) Verse.Pawn.Verse.Pawn.Tick_Patch1(Verse.Pawn)
at (wrapper dynamic-method) Verse.TickList.Verse.TickList.Tick_Patch2(Verse.TickList)

 Verse.Pawn.Verse.Pawn.Tick_Patch1 was patched by:
        TRANS:
    Soyuz.Patches.Pawn_Tick_Patch.Transpiler

 Verse.TickList.Verse.TickList.Tick_Patch2 was patched by:
        POST:
    TD_Enhancement_Pack.TickGrow_PlantHarvest.Postfix,
    TD_Enhancement_Pack.TickGrow.Postfix

HugsLib.log

bbradson commented 4 months ago

That does look like a bug with Fish's cache alright, but all of the other tons of errors in that log thrown before the message don't have anything to do with it.
The message alone is a bit unhelpful. Rocketman stripped away all data about the method it's thrown from there, so removing that would be required to at least see what patch that really is. Pawn.Tick and PathFollower there are patched by Rocketman, but not by Fish and all lines between error and Rocketman's patches are just missing. Simply spawning in a bunch of yaks and letting the game run with that modlist doesn't lead to anything similar looking I could work with for fixing either

bbradson commented 2 months ago

I added locks in case of this being caused by unsafe threaded access from other mods now, possibly fixing this, though I can't guarantee anything as it's impossible to reproduce for me

DarkDaskin commented 2 months ago

Yes, it's almost impossible to reproduce. Since my original report, it happened again only once. Simply saving and loading again clears the issue, so even if it is not fixed, I consider it a minor problem.