This object is in archive! 
Crash in MyTurretControlBlock.EndShoot
Solved
Game version: 1.200.027
A player reported that every time a custom turret controller is using a crane is crashes his dedicated server.
How to reproduce:
Load the attached world into a Dedicated Server. It will crash right when the world loads.
Reproducibility: 100%
Dedicated Server logs attached, no client was needed to reproduce the issue.
Root cause:
I did not have enough time to fully root cause it yet, but the exception is very telling.
The likely cause is a logic bug, not disabling updates while moving grids between grid groups.
It also affects performance. Why does it update resource distribution before finishing the complete group merge?
Exception occurred: System.NullReferenceException: Object reference not set to an instance of an object. at SpaceEngineers.Game.Entities.Blocks.MyTurretControlBlock.EndShoot(MyShootActionEnum action) at SpaceEngineers.Game.Entities.Blocks.MyTurretControlBlock.OnStopWorking() at System.Action`1.Invoke(T obj) at Sandbox.Game.Entities.MyCubeBlock.UpdateIsWorking() at SpaceEngineers.Game.Entities.Blocks.MyTurretControlBlock.PowerReceiver_IsPoweredChanged() at System.Action.Invoke() at System.DelegateExtensions.InvokeIfNotNull(Action handler) at Sandbox.Game.EntityComponents.MyResourceSinkComponent.SetInputFromDistributor(MyDefinitionId resourceTypeId, Single newResourceInput, Boolean isAdaptible, Boolean fireEvents) at Sandbox.Game.EntityComponents.MyResourceDistributorComponent.RecomputeResourceDistributionPartial(MyDefinitionId& typeId, Int32 startPriorityIdx, MySinkGroupData[] sinkDataByPriority, MySourceGroupData[] sourceDataByPriority, MyTuple`2& sinkSourceData, HashSet`1[] sinksByPriority, HashSet`1[] sourcesByPriority, List`1 sinkSourcePairs, MyList`1 stockpilingStorageList, MyList`1 otherStorageList, Single availableResource) at Sandbox.Game.EntityComponents.MyResourceDistributorComponent.RecomputeResourceDistribution(MyDefinitionId& typeId, Boolean updateChanges) at Sandbox.Game.EntityComponents.MyResourceDistributorComponent.UpdateBeforeSimulation() at Sandbox.Game.Entities.Cube.MyCubeGridSystems.OnRemovedFromGroup(MyGridLogicalGroupData group) at Sandbox.Game.Entities.MyCubeGrid.OnRemovedFromGroup(MyGridLogicalGroupData group) at Sandbox.Game.Entities.MyGridLogicalGroupData.OnNodeRemoved[TGroupData](MyCubeGrid entity, TGroupData nextGroup) at VRage.Groups.MyGroups`2.Node.set_m_group(Group value) at VRage.Groups.MyGroups`2.MergeGroups(Group groupA, Group groupB) at VRage.Groups.MyGroups`2.CreateLink(Int64 linkId, TNode parentNode, TNode childNode) at Sandbox.Game.Entities.MyCubeGridGroups.CreateLink(GridLinkTypeEnum type, Int64 linkId, MyCubeGrid parent, MyCubeGrid child) at Sandbox.Game.Entities.MyCubeBlock.OnConstraintAdded(GridLinkTypeEnum type, IMyEntity attachedEntity) at Sandbox.Game.Entities.Blocks.MyMechanicalConnectionBlockBase.Attach(MyAttachableTopBlockBase topBlock, Boolean updateGroup) at Sandbox.Game.Entities.Blocks.MyPistonBase.Attach(MyAttachableTopBlockBase topBlock, Boolean updateGroup) at Sandbox.Game.Entities.Blocks.MyMechanicalConnectionBlockBase.UpdateAttachState() at Sandbox.Game.Entities.Blocks.MyMechanicalConnectionBlockBase.UpdateOnceBeforeFrame() at Sandbox.Game.Entities.Blocks.MyPistonBase.UpdateOnceBeforeFrame() at Sandbox.Game.Entities.MyParallelEntityUpdateOrchestrator.DispatchOnceBeforeFrame() at Sandbox.Game.Entities.MyEntities.UpdateBeforeSimulation() at Sandbox.Game.World.MySector.UpdateBeforeSimulation() at Sandbox.Game.World.MySession.UpdateComponents() at Sandbox.Game.World.MySession.Update(MyTimeSpan updateTime) at Sandbox.MySandboxGame.Update()I have seen this exact same exception happening before in various situations when the custom turret controller intermittently lost power due rotor head attachment, which also causes a move between grid groups (MergeGroups).
Hello!
Thank you for your report. I reproduced the crash and reported it internally for further investigation.
Kind regards,
Keen Software House, QA Department
Hello!
Thank you for your report. I reproduced the crash and reported it internally for further investigation.
Kind regards,
Keen Software House, QA Department
I seem to have the same bug, but in single player, with an unfinished custom turret on a powered down grid. (It had two hinges and a camera but no guns.) The crash only seems to happen while loading a saved game and isn't totally consistent.
I backtracked backups to one where the grid I suspected of causing the problem was powered, and that save loaded. I saved it, saved it again with the grid off as a new save, then backed out and tried to load the save with it powered off. It worked. However, at the time I was some distance away from other grids, and the crash did happen later on (again) in an area with a bunch of grids, subgrids, and scripts. The vehicle in question wasn't connected to any of those grids either time. (Which is why it was shut down.) For now, I got rid of the turret controller until I'm ready to build the full turret and hopefully there won't be any more problems. (I have other custom turret controllers in use, but they should all be on powered grids and are finished functioning turrets.)
I seem to have the same bug, but in single player, with an unfinished custom turret on a powered down grid. (It had two hinges and a camera but no guns.) The crash only seems to happen while loading a saved game and isn't totally consistent.
I backtracked backups to one where the grid I suspected of causing the problem was powered, and that save loaded. I saved it, saved it again with the grid off as a new save, then backed out and tried to load the save with it powered off. It worked. However, at the time I was some distance away from other grids, and the crash did happen later on (again) in an area with a bunch of grids, subgrids, and scripts. The vehicle in question wasn't connected to any of those grids either time. (Which is why it was shut down.) For now, I got rid of the turret controller until I'm ready to build the full turret and hopefully there won't be any more problems. (I have other custom turret controllers in use, but they should all be on powered grids and are finished functioning turrets.)
Related crash on grinding any active (shooting) turret. It crashes the game client, highly reproducible. It also crashes in multiplayer, but only the client, the server continues to run with no errors. This is a client side issue.
Related crash on grinding any active (shooting) turret. It crashes the game client, highly reproducible. It also crashes in multiplayer, but only the client, the server continues to run with no errors. This is a client side issue.
Hello, Engineers!
The fix for this is in v201
Thank you.
Kind Regards,
Keen Software House: QA Department
Hello, Engineers!
The fix for this is in v201
Thank you.
Kind Regards,
Keen Software House: QA Department
Replies have been locked on this page!