Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Crash related to harvester pathfinder #19579

Closed
dnqbob opened this issue Aug 2, 2021 · 13 comments · Fixed by #19581
Closed

A Crash related to harvester pathfinder #19579

dnqbob opened this issue Aug 2, 2021 · 13 comments · Fixed by #19581

Comments

@dnqbob
Copy link
Contributor

dnqbob commented Aug 2, 2021

Post Updated to OpenRA/Bleed- f4a5878

Log

OpenRA engine version {DEV_VERSION}
Tiberian Sun mod version {DEV_VERSION}
on map e462e9e7af638481849b51fcd9f6f8dc925f73f8 (Name your map here by Your name here).
Date: 2021-08-02 23:21:49Z
Operating System: Windows (Microsoft Windows NT 10.0.19043.0)
Runtime Version: .NET CLR 5.0.7
Exception of type `System.IndexOutOfRangeException`: Index was outside the bounds of the array.
   at OpenRA.Mods.Common.Pathfinder.PathGraph.GetConnections(CPos position) in D:\work\Projects\Github\OpenRA\OpenRA.Mods.Common\Pathfinder\PathGraph.cs:line 136
   at OpenRA.Mods.Common.Pathfinder.PathSearch.Expand() in D:\work\Projects\Github\OpenRA\OpenRA.Mods.Common\Pathfinder\PathSearch.cs:line 150
   at OpenRA.Mods.Common.Traits.PathFinder.FindPath(IPathSearch search) in D:\work\Projects\Github\OpenRA\OpenRA.Mods.Common\Traits\World\PathFinder.cs:line 139
   at OpenRA.Mods.Common.Pathfinder.PathFinderUnitPathCacheDecorator.FindPath(IPathSearch search) in D:\work\Projects\Github\OpenRA\OpenRA.Mods.Common\Pathfinder\PathFinderUnitPathCacheDecorator.cs:line 82
   at OpenRA.Mods.Common.Activities.FindAndDeliverResources.ClosestHarvestablePos(Actor self) in D:\work\Projects\Github\OpenRA\OpenRA.Mods.Common\Activities\FindAndDeliverResources.cs:line 219
   at OpenRA.Mods.Common.Activities.FindAndDeliverResources.Tick(Actor self) in D:\work\Projects\Github\OpenRA\OpenRA.Mods.Common\Activities\FindAndDeliverResources.cs:line 115
   at OpenRA.Activities.Activity.TickOuter(Actor self) in D:\work\Projects\Github\OpenRA\OpenRA.Game\Activities\Activity.cs:line 108
   at OpenRA.Traits.ActivityUtils.RunActivity(Actor self, Activity act) in D:\work\Projects\Github\OpenRA\OpenRA.Game\Traits\ActivityUtils.cs:line 30
   at OpenRA.Actor.Tick() in D:\work\Projects\Github\OpenRA\OpenRA.Game\Actor.cs:line 271
   at OpenRA.World.Tick() in D:\work\Projects\Github\OpenRA\OpenRA.Game\World.cs:line 433
   at OpenRA.Game.InnerLogicTick(OrderManager orderManager) in D:\work\Projects\Github\OpenRA\OpenRA.Game\Game.cs:line 624
   at OpenRA.Game.LogicTick() in D:\work\Projects\Github\OpenRA\OpenRA.Game\Game.cs:line 639
   at OpenRA.Game.Loop() in D:\work\Projects\Github\OpenRA\OpenRA.Game\Game.cs:line 806
   at OpenRA.Game.Run() in D:\work\Projects\Github\OpenRA\OpenRA.Game\Game.cs:line 859
   at OpenRA.Game.InitializeAndRun(String[] args) in D:\work\Projects\Github\OpenRA\OpenRA.Game\Game.cs:line 277
   at OpenRA.Launcher.Program.Main(String[] args) in D:\work\Projects\Github\OpenRA\OpenRA.Launcher\Program.cs:line 32

Related map

map:
testcrash2.zip

Reproduce:

  1. use a map (like in this post)
  • of 128*64
  • without resource layer
  • in OpenRA-TS
  • made by OpenRA Map Editor
  1. build a refinery
  2. Oops
@dnqbob dnqbob added the Crash label Aug 2, 2021
@dnqbob
Copy link
Contributor Author

dnqbob commented Aug 2, 2021

128*64 map generation may be the crash spot

Update:
It can 100% reproduce in TS in my test

@pchote pchote added this to the Next release milestone Aug 2, 2021
@dnqbob
Copy link
Contributor Author

dnqbob commented Aug 2, 2021

OK, I confirmed that OpenRA TS also has this crash bug

@dnqbob
Copy link
Contributor Author

dnqbob commented Aug 2, 2021

Is there any idea on how to avoid this crash? I guess SP will have a release version soon.

@pchote
Copy link
Member

pchote commented Aug 2, 2021

This is going to be a regression from #19524. Someone needs to study that in detail with your stack trace in mind and work out what is going wrong.

@pchote
Copy link
Member

pchote commented Aug 2, 2021

OK, I confirmed that OpenRA TS also has this crash bug

Can you please upload the replay and mention which bleed commit it is based on?

@dnqbob
Copy link
Contributor Author

dnqbob commented Aug 2, 2021

Ummm wait for 1 hour, I will directly change this post to OpenRA version I tested.

@dnqbob
Copy link
Contributor Author

dnqbob commented Aug 3, 2021

@pchote done

@dnqbob dnqbob changed the title A possible Crash related to harvester pathfinder A Crash related to harvester pathfinder Aug 3, 2021
@anvilvapre
Copy link
Contributor

Line 136: var posLayer = position.Layer;

That doesn't seem to make sense?

@pchote
Copy link
Member

pchote commented Aug 3, 2021

Running the testcase in a debugger shows that it actually crashes on the new if (info[neighbor].Status == CellStatus.Closed) line. neighbour needs to be validated as a valid cell first!

@anvilvapre
Copy link
Contributor

It happens when the neighbour position falls outside map bounds?

@anvilvapre
Copy link
Contributor

Yeah, Locomotor does this check (ofcourse):
if (!world.Map.Contains(destNode)) return short.MaxValue;

@anvilvapre
Copy link
Contributor

The/a solution would be combine the two if's and to only check the status when neighbour is not max int.

@pchote
Copy link
Member

pchote commented Aug 3, 2021

That sounds reasonable. Do you want to file a PR with that fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants