anegostudios / VintageStory-Issues

Vintage Story's public issue tracker for reporting bugs, crashes and the like
46 stars 16 forks source link

Crash in BEBehaviorMPAngledGears.CheckLargeGearJoin #1262

Closed bluelightning32 closed 3 years ago

bluelightning32 commented 3 years ago

Game Version: 1.15.4-rc.1 Platform: Linux Modded: Yes

$ ls -1 Mods/
AncientTools_V1.1.0.zip
bricklayers-0.3.2.zip
CarryCapacity-VS1.15.0-v0.6.2.zip
fancydoors_v1.15.0-1.0.5-B.zip
instruments_1.0.10.zip
Lichen-v1.5.0.zip
medievalexpansion-3.5.4.zip
'MoreRoads 1.3.9.zip'
necessaries_v1.15.2-0.8.12.zip
PlayerCorpse_v1.15.1_v1.1.2.zip
PrimitiveSurvival2.6.2.zip
RabbitTechUtils_v0.3.0.zip
RainbowRoads1.0.1.zip
'Rope Bridges v1.1.0 for VS1.15.zip'
spyglass_v0.3.0.zip
survivalcats_v1.15.2-1.2.10.zip
tradeomat_v1.15.0-1.5.7.zip
usefulstuff_v2.1.1.zip
ViesCraft-VS1.15.2-v1.0.4.zip
VSCreativeMod.dll
VSEssentials.dll
VSHUD.dll
vsprospectorinfo_v4.1.0.zip
VSSurvivalMod.dll
workbench-expansion-1.3.0.zip
xlib_v0.6.0-pre.6.zip
xskills_v0.6.0-pre.8.zip
yabba_100.zip
zeekea_v1.15.0-1.4.10.zip

I was using a custom Harmony dll in order for VSHUD to work on Linux. I was using the one posted by 0x0ade in the harmony-contributors channel in the Harmony discord. See https://github.com/pardeike/Harmony/issues/414 for more info.

Description

The game crashes when I visit the NW spawn on the RabbitTech server. I tried relogging multiple times, and it kept crashing. There were other players near me at NW spawn, so it must have been something specific with my client.

How to reproduce

  1. Visit NW spawn on RabbitTech. There must be other factors since the other players were not having crashes. I'm not sure if it's because I'm running Linux, or because I have extra mods installed. The only extra ones I have (not part of RabbitTech modpack) are vsprospectorinfo_v4 and VSHUD.

Logs

8.8.2021 00:52:04 [Fatal] System.NullReferenceException: Object reference not set to an instance of an object
  at Vintagestory.GameContent.Mechanics.BEBehaviorMPAngledGears.CheckLargeGearJoin () [0x00041] in <7d6319f12f824d8ca81a5d9aca0624af>:0
  at Vintagestory.GameContent.Mechanics.BEBehaviorMPAngledGears.SetOrientations () [0x007ed] in <7d6319f12f824d8ca81a5d9aca0624af>:0
  at Vintagestory.GameContent.Mechanics.BEBehaviorMPBase.FromTreeAttributes (Vintagestory.API.Datastructures.ITreeAttribute tree, Vintagestory.API.Common.IWorldAccessor worldAccessForResolve) [0x000c0] in <7d6319f12f824d8ca81a5d9aca0624af>:0
  at Vintagestory.GameContent.Mechanics.BEBehaviorMPAngledGears.FromTreeAttributes (Vintagestory.API.Datastructures.ITreeAttribute tree, Vintagestory.API.Common.IWorldAccessor worldAccessForResolve) [0x00000] in <7d6319f12f824d8ca81a5d9aca0624af>:0
  at Vintagestory.API.Common.BlockEntity.FromTreeAttributes (Vintagestory.API.Datastructures.ITreeAttribute tree, Vintagestory.API.Common.IWorldAccessor worldAccessForResolve) [0x00044] in <f5618d8cc94a4f63bf2fa986b4dbf256>:0
  at Vintagestory.Client.NoObf.ClientChunk.PreLoadBlockEntitiesFromPacket (_KBZCUSZM4BJHz7oOrpRa8H3VKHB[] blockEntities, System.Int32 blockEntitiesCount, Vintagestory.Client.NoObf.ClientMain game) [0x00084] in <1a20f3d5820c4789b7f5f1b546395e14>:0
  at Vintagestory.Client.NoObf.ClientWorldMap.LoadChunkFromPacket (_ctU1UlWt621cdxAuw1qnucD75cB p) [0x00117] in <1a20f3d5820c4789b7f5f1b546395e14>:0
  at Vintagestory.Client.NoObf.SystemNetworkProcess.ProcessInBackground (_xvsTyOnSv7SiiZtyBXXalZ8Ymin packet) [0x001ae] in <1a20f3d5820c4789b7f5f1b546395e14>:0
  at Vintagestory.Client.NoObf.SystemNetworkProcess.TryReadPacket (System.Byte[] data, System.Int32 dataLength) [0x00060] in <1a20f3d5820c4789b7f5f1b546395e14>:0
  at Vintagestory.Client.NoObf.SystemNetworkProcess.NetworkProcess () [0x00055] in <1a20f3d5820c4789b7f5f1b546395e14>:0
  at Vintagestory.Client.NoObf.SystemNetworkProcess.OnSeperateThreadGameTick (System.Single dt) [0x00000] in <1a20f3d5820c4789b7f5f1b546395e14>:0
  at Vintagestory.Client.NoObf.ClientThread.Update () [0x0005e] in <1a20f3d5820c4789b7f5f1b546395e14>:0
  at Vintagestory.Client.NoObf.ClientThread.Process () [0x0000b] in <1a20f3d5820c4789b7f5f1b546395e14>:0
Craluminum2413 commented 3 years ago

What version of VSHUD mod you are using? https://github.com/Novocain1/MiscMods/issues/1

bluelightning32 commented 3 years ago

VSHUD v2.0.15.

$ sha1sum VSHUD.dll 
aef948bf6ac681390a4b99f9fdd77d57be3add91  VSHUD.dll
copygirl commented 3 years ago

Can you reproduce this with VSHUD disabled?

bluelightning32 commented 3 years ago

I removed VSHUD, and it still crashed.

02:01:12 [Client Fatal] Caught unhandled exception in thread 'networkproc'. Exiting game.
02:01:12 [Client Fatal] System.NullReferenceException: Object reference not set to an instance of an object
  at Vintagestory.GameContent.Mechanics.BEBehaviorMPAngledGears.CheckLargeGearJoin () [0x00041] in <7d6319f12f824d8ca81a5d9aca0624af>:0 
  at Vintagestory.GameContent.Mechanics.BEBehaviorMPAngledGears.SetOrientations () [0x007ed] in <7d6319f12f824d8ca81a5d9aca0624af>:0 
  at Vintagestory.GameContent.Mechanics.BEBehaviorMPBase.FromTreeAttributes (Vintagestory.API.Datastructures.ITreeAttribute tree, Vintagestory.API.Common.IWorldAccessor worldAccessForResolve) [0x000c0] in <7d6319f12f824d8ca81a5d9aca0624af>:0 
  at Vintagestory.GameContent.Mechanics.BEBehaviorMPAngledGears.FromTreeAttributes (Vintagestory.API.Datastructures.ITreeAttribute tree, Vintagestory.API.Common.IWorldAccessor worldAccessForResolve) [0x00000] in <7d6319f12f824d8ca81a5d9aca0624af>:0 
  at Vintagestory.API.Common.BlockEntity.FromTreeAttributes (Vintagestory.API.Datastructures.ITreeAttribute tree, Vintagestory.API.Common.IWorldAccessor worldAccessForResolve) [0x00044] in <f5618d8cc94a4f63bf2fa986b4dbf256>:0 
  at Vintagestory.Client.NoObf.ClientChunk.PreLoadBlockEntitiesFromPacket (_KBZCUSZM4BJHz7oOrpRa8H3VKHB[] blockEntities, System.Int32 blockEntitiesCount, Vintagestory.Client.NoObf.ClientMain game) [0x00084] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.Client.NoObf.ClientWorldMap.LoadChunkFromPacket (_ctU1UlWt621cdxAuw1qnucD75cB p) [0x00117] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.Client.NoObf.SystemNetworkProcess.ProcessInBackground (_xvsTyOnSv7SiiZtyBXXalZ8Ymin packet) [0x001ae] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.Client.NoObf.SystemNetworkProcess.TryReadPacket (System.Byte[] data, System.Int32 dataLength) [0x00060] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.Client.NoObf.SystemNetworkProcess.NetworkProcess () [0x00055] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.Client.NoObf.SystemNetworkProcess.OnSeperateThreadGameTick (System.Single dt) [0x00000] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.Client.NoObf.ClientThread.Update () [0x0005e] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.Client.NoObf.ClientThread.Process () [0x0000b] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
bluelightning32 commented 3 years ago

I additionally removed vsprospectorinfo_v4.1.0.zip, and it still crashed.

Craluminum2413 commented 3 years ago

Can you try without mods?

bluelightning32 commented 3 years ago

I reinstalled VS with the RabbitTech modpack (no custom harmony, no VSHUD, no vsprospectorinfo), and it still crashed.

Can you try without mods?

I don't know how to reproduce it in single player mode. I tried placing an angled gear on a large gear in creative, and it didn't crash. I can't join the RabbitTech server without their modpack.

bluelightning32 commented 3 years ago

Okay, in creative mode I got a different but similar crash when I broke a block of the large gear: image

02:11:12 [Client Fatal] Version: v1.15.4-rc.1 (Unstable)8/8/2021 2:11:12 AM: Critical error occurred
System.NullReferenceException: Object reference not set to an instance of an object
  at Vintagestory.GameContent.Mechanics.BlockMPBase.ExchangeBlockAt (Vintagestory.API.Common.IWorldAccessor world, Vintagestory.API.MathTools.BlockPos pos) [0x0001e] in <7d6319f12f824d8ca81a5d9aca0624af>:0 
  at Vintagestory.GameContent.Mechanics.BlockAngledGears.ToPegGear (Vintagestory.API.Common.IWorldAccessor world, Vintagestory.API.MathTools.BlockPos pos) [0x00055] in <7d6319f12f824d8ca81a5d9aca0624af>:0 
  at Vintagestory.GameContent.Mechanics.BlockLargeGear3m.OnBlockRemoved (Vintagestory.API.Common.IWorldAccessor world, Vintagestory.API.MathTools.BlockPos pos) [0x0008f] in <7d6319f12f824d8ca81a5d9aca0624af>:0 
  at Vintagestory.Common.BlockAccessorRelaxed.SetBlock (System.Int32 blockId, Vintagestory.API.MathTools.BlockPos pos, Vintagestory.API.Common.ItemStack byItemstack) [0x00258] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.Common.BlockAccessorBase.SetBlock (System.Int32 blockId, Vintagestory.API.MathTools.BlockPos pos) [0x00000] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.API.Common.Block.OnBlockBroken (Vintagestory.API.Common.IWorldAccessor world, Vintagestory.API.MathTools.BlockPos pos, Vintagestory.API.Common.IPlayer byPlayer, System.Single dropQuantityMultiplier) [0x00157] in <f5618d8cc94a4f63bf2fa986b4dbf256>:0 
  at Vintagestory.GameContent.Mechanics.BlockMPMultiblockGear.OnBlockBroken (Vintagestory.API.Common.IWorldAccessor world, Vintagestory.API.MathTools.BlockPos pos, Vintagestory.API.Common.IPlayer byPlayer, System.Single dropQuantityMultiplier) [0x00042] in <7d6319f12f824d8ca81a5d9aca0624af>:0 
  at Vintagestory.Client.NoObf.ClientMain.OnPlayerTryDestroyBlock (Vintagestory.API.Common.BlockSelection blockSelection) [0x0008b] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.Client.NoObf.SystemMouseInWorldInteractions.HandleMouseInteractionsBlockSelected (System.Single dt) [0x001ca] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.Client.NoObf.SystemMouseInWorldInteractions.UpdatePicking (System.Single dt) [0x0009e] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.Client.NoObf.SystemMouseInWorldInteractions.OnFinalizeFrame (System.Single dt) [0x0004a] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.API.Client.DummyRenderer.OnRenderFrame (System.Single deltaTime, Vintagestory.API.Client.EnumRenderStage stage) [0x00000] in <f5618d8cc94a4f63bf2fa986b4dbf256>:0 
  at Vintagestory.Client.NoObf.ClientEventManager.TriggerRenderStage (Vintagestory.API.Client.EnumRenderStage stage, System.Single dt) [0x00072] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.Client.NoObf.ClientMain.TriggerRenderStage (Vintagestory.API.Client.EnumRenderStage stage, System.Single dt) [0x00028] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.Client.NoObf.ClientMain.RenderToDefaultFramebuffer (System.Single dt) [0x00092] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at _iTgescuUf0kXKNXu6dfxHeIMvfG._Jsc49uDUI51AZhxyjjQNMgVXhKm (System.Single ) [0x0003e] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at _igaury40RDGQNtdY51dKy1LFQaG._PsCGkT7lMIncUD4FDdqauQ3AaTl (System.Single ) [0x001b4] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at _igaury40RDGQNtdY51dKy1LFQaG._1lUbSLybYeKj0UTZLOdfdtQwqRJ (System.Single ) [0x000cc] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame (System.Object sender, OpenTK.FrameEventArgs e) [0x00141] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
  at (wrapper delegate-invoke) System.EventHandler`1[OpenTK.FrameEventArgs].invoke_void_object_TEventArgs(object,OpenTK.FrameEventArgs)
  at OpenTK.GameWindow.OnRenderFrame (OpenTK.FrameEventArgs e) [0x00000] in <90b019caed434e81aee7f93ee8c94ce2>:0 
  at OpenTK.GameWindow.OnRenderFrameInternal (OpenTK.FrameEventArgs e) [0x00010] in <90b019caed434e81aee7f93ee8c94ce2>:0 
  at OpenTK.GameWindow.RaiseRenderFrame (System.Double elapsed, System.Double& timestamp) [0x0000c] in <90b019caed434e81aee7f93ee8c94ce2>:0 
  at OpenTK.GameWindow.DispatchRenderFrame () [0x00038] in <90b019caed434e81aee7f93ee8c94ce2>:0 
  at OpenTK.GameWindow.Run (System.Double updates_per_second, System.Double frames_per_second) [0x00104] in <90b019caed434e81aee7f93ee8c94ce2>:0 
  at OpenTK.GameWindow.Run () [0x00000] in <90b019caed434e81aee7f93ee8c94ce2>:0 
  at _Yit8BJyfwe0pl1vnZXdnsUXBHeK._qejIe9laMG7hmFafani6nftUNCU (_OtB8vvTzxo67cRDgokUIe37bIfO , System.String[] ) [0x003e2] in <c0fdd27c8f8647efb1250328a4745d10>:0 
  at _Yit8BJyfwe0pl1vnZXdnsUXBHeK+_Iq2B4uH78rzfdIjBRfApeyfrojBb._7PfyNm9CPaMOc0usFYpQpMs2Xjf () [0x00000] in <c0fdd27c8f8647efb1250328a4745d10>:0 
  at _lO2cybHaCglaEphC0FED3uFtHRh._qejIe9laMG7hmFafani6nftUNCU (System.Threading.ThreadStart ) [0x00007] in <1a20f3d5820c4789b7f5f1b546395e14>:0 
bluelightning32 commented 3 years ago

That single player mode crash reproduced without any mods installed.

bluelightning32 commented 3 years ago

In single player mode everything turns correctly when I first place it, but then when I exit and re-enter the world, the angled gear connected to the large wheel is no longer turning.

image

bluelightning32 commented 3 years ago

The single player problems (angled gear not turning and the crash on breaking the large gear) also reproduce with 1.15.3 and 1.15.2.

Craluminum2413 commented 3 years ago

I reproduced this too by destroying rotating large gear in survival. @copygirl could you mark this as critical?

Running on 64 bit Windows with 16 GB RAM 
Version: v1.15.4-rc.1 (Unstable)08/08/2021 13:52:06: Critical error occurred
System.NullReferenceException: Object reference not set to an instance of an object.
   at Vintagestory.GameContent.Mechanics.BlockMPBase.ExchangeBlockAt(IWorldAccessor world, BlockPos pos)
   at Vintagestory.GameContent.Mechanics.BlockAngledGears.ToPegGear(IWorldAccessor world, BlockPos pos)
   at Vintagestory.GameContent.Mechanics.BlockLargeGear3m.OnBlockRemoved(IWorldAccessor world, BlockPos pos)
   at Vintagestory.Common.BlockAccessorRelaxed.SetBlock(Int32 blockId, BlockPos pos, ItemStack byItemstack)
   at Vintagestory.API.Common.Block.OnBlockBroken(IWorldAccessor world, BlockPos pos, IPlayer byPlayer, Single dropQuantityMultiplier)
   at Vintagestory.API.Common.CollectibleObject.OnBlockBrokenWith(IWorldAccessor world, Entity byEntity, ItemSlot itemslot, BlockSelection blockSel, Single dropQuantityMultiplier)
   at Vintagestory.Client.NoObf.ClientMain.OnPlayerTryDestroyBlock(BlockSelection blockSelection)
   at Vintagestory.Client.NoObf.SystemMouseInWorldInteractions.ContinueBreakSurvival(BlockSelection blockSelection, Block block, Single dt)
   at Vintagestory.Client.NoObf.SystemMouseInWorldInteractions.HandleMouseInteractionsBlockSelected(Single dt)
   at Vintagestory.Client.NoObf.SystemMouseInWorldInteractions.OnFinalizeFrame(Single dt)
   at Vintagestory.Client.NoObf.ClientEventManager.TriggerRenderStage(EnumRenderStage stage, Single dt)
   at Vintagestory.Client.NoObf.ClientMain.TriggerRenderStage(EnumRenderStage stage, Single dt)
   at Vintagestory.Client.NoObf.ClientMain.RenderToDefaultFramebuffer(Single dt)
   at _iTgescuUf0kXKNXu6dfxHeIMvfG._Jsc49uDUI51AZhxyjjQNMgVXhKm(Single )
   at _igaury40RDGQNtdY51dKy1LFQaG._PsCGkT7lMIncUD4FDdqauQ3AaTl(Single )
   at _igaury40RDGQNtdY51dKy1LFQaG._1lUbSLybYeKj0UTZLOdfdtQwqRJ(Single )
   at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame(Object sender, FrameEventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at OpenTK.GameWindow.RaiseRenderFrame(Double elapsed, Double& timestamp)
   at OpenTK.GameWindow.DispatchRenderFrame()
   at OpenTK.GameWindow.Run(Double updates_per_second, Double frames_per_second)
   at _Yit8BJyfwe0pl1vnZXdnsUXBHeK._qejIe9laMG7hmFafani6nftUNCU(_OtB8vvTzxo67cRDgokUIe37bIfO , String[] )
   at _lO2cybHaCglaEphC0FED3uFtHRh._qejIe9laMG7hmFafani6nftUNCU(ThreadStart )

served-debug.txt

8.8.2021 13:55:28 [VerboseDebug] Failed loading a blockentity in a chunk. Will discard it. Sorry. Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Vintagestory.GameContent.Mechanics.BEBehaviorMPAngledGears.CheckLargeGearJoin()
   at Vintagestory.GameContent.Mechanics.BEBehaviorMPBase.FromTreeAttributes(ITreeAttribute tree, IWorldAccessor worldAccessForResolve)
   at Vintagestory.API.Common.BlockEntity.FromTreeAttributes(ITreeAttribute tree, IWorldAccessor worldAccessForResolve)
   at Vintagestory.Server.ServerChunk.AfterDeserialization(IWorldAccessor worldAccessorForResolve)
8.8.2021 13:55:28 [VerboseDebug] Failed loading a blockentity in a chunk. Will discard it. Sorry. Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Vintagestory.GameContent.Mechanics.BEBehaviorMPAngledGears.CheckLargeGearJoin()
   at Vintagestory.GameContent.Mechanics.BEBehaviorMPBase.FromTreeAttributes(ITreeAttribute tree, IWorldAccessor worldAccessForResolve)
   at Vintagestory.API.Common.BlockEntity.FromTreeAttributes(ITreeAttribute tree, IWorldAccessor worldAccessForResolve)
   at Vintagestory.Server.ServerChunk.AfterDeserialization(IWorldAccessor worldAccessorForResolve)
copygirl commented 3 years ago

@copygirl could you mark this as critical?

@Craluminum2413 This doesn't appear to be a reoccurring crash that locks out players from their worlds / servers, or is it? Hence it's not a critical issue. However, considering it does mess up players natural progression in the game, and happens in Vanilla, I will mark it appropriately.

Craluminum2413 commented 3 years ago

It stops all mechanisms with angled gears after each rejoin the world

Craluminum2413 commented 3 years ago

Just noticed that one [VerboseDebug] Failed loading a blockentity in a chunk. equals one angled gear connected to large gear. More angled gears = more the same errors.

tyronx commented 3 years ago

this crash should be fixed next release, i hope it fixes the rest as well