anegostudios / VintageStory-Issues

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

Random Crashes via Fruit Tree #1834

Closed Tingcat closed 1 month ago

Tingcat commented 2 years ago

Game Version: v1.16.5-rc.1 (Unstable) Platform: Windows Modded: Yes (I don't think this is a mod issue though) SP/MP: Multiplayer

Description

Every so often the game crashes to desktop.

How to reproduce

I think it might have something to do with the fruit tree sapling near our base? It has grown a block every time I check on it after a crash, and the two crashes so far seem to have been an appropriate length of time for the tree to grow once in that time. I don't know if the tree itself is bugged or not.

Logs

CLIENT-CRASH.TXT

Game Version: v1.16.5-rc.1 (Unstable)
Loaded Mods: acorns@0.5.0, weaponpacka@1.2.4, weaponpackbeta@1.0.0, betterarchery@3.0.0, buildingplus@1.1.2, composter@1.0.3, cottagewindows@1.0.6, expandedfoods@1.5.3-pre.5, extrachests@1.4.0-rc.2, foundrymod@1.0.0, weaponpackg@1.0.0, oxygennotincluded@0.2.4, pieontheshelf@1.0.0, peifme@1.0.0, potontheshelf@1.0.0, primitivesurvival@2.8.0, speararrowheadbits@1.0.0, spyglass@0.4.5, superfuel@2.0.7, tradeomat@1.6.0, visibleore@1.0.1, game@1.16.5-rc.1, vsprospectorinfo@4.0.2, egocaribautomapmarkers@2.3.0, carrycapacity@0.6.5, fancyplanters@1.0.4, farmlanddropssoil@1.4.0, farmlife@1.2.3, fromgoldencombs@1.3.11, hudclock@2.7.0, lichen@1.6.1, medievalexpansion@3.7.1, petai@1.3.7, pei@1.2.1, peifm@1.0.2, petool@1.0.0, playercorpse@1.3.1, prospectorinfo@3.1.2, stonequarry@1.6.5, tpnet@1.5.1, usefulstuff@2.3.2, creative@1.16.5-rc.1, survival@1.16.5-rc.1, wildfarming@1.2.8, woodbarrels@1.0.2, workbenchexpansion@1.4.1, xrowboat@0.0.3, metalrecovery@0.1.16, bricklayers@0.9.0, cats@1.3.4, wattleworld@1.0.1, wolftaming@1.3.3
02/04/2022 15:33:02: Critical error occurred
System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
   at Vintagestory.GameContent.BlockFruitTreeBranch.OnBeforeRender(ICoreClientAPI capi, ItemStack itemstack, EnumItemRenderTarget target, ItemRenderInfo& renderinfo)
   at Vintagestory.Client.NoObf.InventoryItemRenderer.GetItemStackRenderInfo(ClientMain game, ItemSlot inSlot, EnumItemRenderTarget target, Single dt)
   at Vintagestory.Client.NoObf.InventoryItemRenderer.RenderItemstackToGui(ItemSlot inSlot, Double posX, Double posY, Double posZ, Single size, Int32 color, Boolean shading, Boolean origRotate, Boolean showStackSize)
   at Vintagestory.Client.NoObf.DrawWorldInteractionUtil.<>c__DisplayClass11_1.<ComposeBlockWorldInteractionHelp>b__0(Single dt, ElementBounds bounds)
   at Vintagestory.API.Client.GuiComposer.Render(Single deltaTime)
   at Vintagestory.API.Client.GuiDialog.OnRenderGUI(Single deltaTime)
   at Vintagestory.API.Client.HudElement.OnRenderGUI(Single deltaTime)
   at Vintagestory.Client.NoObf.HudElementBlockInteractionHelp.OnRenderGUI(Single deltaTime)
   at Vintagestory.Client.NoObf.GuiManager.OnRenderFrameGUI(Single deltaTime)
   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 _o9akP4VIsdbyLDvrrQ5yRuFW0kf._KZvgpn2RkMFbKaA2m1tAYrJFxYx(Single )
   at _nAidxnGe1HRzSfUOv4SH07I37vf._TnM5TSdghGddEZQuPFQ5q1SaaVy(Single )
   at _nAidxnGe1HRzSfUOv4SH07I37vf._9fUzz7LJZg9L6MxVIrYbozYhi9m(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 _TMlc0SVi1veOk3WmBa9fJGYHBkJ._nKpQGPZPKMHALS5qaTLoxqhCR9O(_KkN6emy6owjnJ1fsZJmPr1AZx0f , String[] )
   at _iv6cwviezE8MtOIBckvWYzXitAC._nKpQGPZPKMHALS5qaTLoxqhCR9O(ThreadStart )
-------------------------------
Craluminum2413 commented 2 years ago

What mods are installed?

Craluminum2413 commented 2 years ago

I found almost the same crash log in resolved issue #1429

copygirl commented 2 years ago

Yeah this is a very similar crash. It has to do with displaying the item as an icon.

Tingcat commented 2 years ago

What mods are installed?

Nothing that adds fruit trees, I'd have thought? I'd have removed them to see if the crash is reproducible, but the crash seems random and I was playing on a server with friends. I'm unsure if they have anything to do with it. Fancy planters was added after the game crashed twice already.

Additionally, I removed the fruit tree from our base and still experienced a crash.

- acorns@0.5.0, 
- weaponpacka@1.2.4, 
- weaponpackbeta@1.0.0, 
- betterarchery@3.0.0, 
- buildingplus@1.1.2, 
- composter@1.0.3, 
- cottagewindows@1.0.6, 
- expandedfoods@1.5.3-pre.5, 
- extrachests@1.4.0-rc.2, 
- foundrymod@1.0.0, 
- weaponpackg@1.0.0, 
- oxygennotincluded@0.2.4,
- pieontheshelf@1.0.0, 
- peifme@1.0.0, 
- potontheshelf@1.0.0, 
- primitivesurvival@2.8.0, 
- speararrowheadbits@1.0.0, 
- spyglass@0.4.5, 
- superfuel@2.0.7, 
- tradeomat@1.6.0, 
- visibleore@1.0.1, 
- vsprospectorinfo@4.0.2, 
- egocaribautomapmarkers@2.3.0, 
- carrycapacity@0.6.5, 
- fancyplanters@1.0.4, 
- farmlanddropssoil@1.4.0, 
- farmlife@1.2.3, 
- fromgoldencombs@1.3.11, 
- hudclock@2.7.0, 
- lichen@1.6.1, 
- medievalexpansion@3.7.1, 
- petai@1.3.7, 
- pei@1.2.1, 
- peifm@1.0.2, 
- petool@1.0.0, 
- playercorpse@1.3.1, 
- prospectorinfo@3.1.2, 
- stonequarry@1.6.5, 
- tpnet@1.5.1, 
- usefulstuff@2.3.2, 
- wildfarming@1.2.8, 
- woodbarrels@1.0.2, 
- workbenchexpansion@1.4.1, 
- xrowboat@0.0.3, 
- metalrecovery@0.1.16, 
- bricklayers@0.9.0, 
- cats@1.3.4, 
- wattleworld@1.0.1, 
- wolftaming@1.3.3
Craluminum2413 commented 1 year ago
Running on 64 bit Windows with 16 GB RAM 
Game Version: v1.18.0-pre.8 (Unstable)
3/31/2023 16:57:51: Critical error occurred
Loaded Mods: commonlib@1.0.1, cralutweaks@1.0.2, extraclayforming@1.0.0, midnight-texturepack@1.1.0, playercorpse@1.6.0-rc.1, game@1.18.0-pre.8, betterfirepit@1.0.0, canbeignited@1.1.0, carryon@0.13.0-pre.3, farmlanddropssoil@1.4.0, fixhandbookclutter@1.0.5, immersivecrafting@1.1.0, kilnspreading@1.0.0, kilntimeviewer@1.0.0, morepiles@1.3.0, mcrate@1.0.4, nemi@1.1.0, prospectorinfo@4.1.5-pre, stepup@1.2.0, creative@1.18.0-pre.8, survival@1.18.0-pre.8, woodbarrels@1.0.4, woodchests@1.0.5
System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
   at Vintagestory.GameContent.BlockFruitTreeBranch.OnBeforeRender(ICoreClientAPI capi, ItemStack itemstack, EnumItemRenderTarget target, ItemRenderInfo& renderinfo) in VSSurvivalMod\Systems\FruitTree\BlockFruitTreeBranch.cs:line 138
   at Vintagestory.Client.NoObf.InventoryItemRenderer.GetItemStackRenderInfo(ClientMain game, ItemSlot inSlot, EnumItemRenderTarget target, Single dt) in VintagestoryLib\Client\Render\InventoryItemRenderer.cs:line 397
   at Vintagestory.Client.NoObf.InventoryItemRenderer.RenderItemstackToGui(ItemSlot inSlot, Double posX, Double posY, Double posZ, Single size, Int32 color, Single dt, Boolean shading, Boolean origRotate, Boolean showStackSize) in VintagestoryLib\Client\Render\InventoryItemRenderer.cs:line 197
   at Vintagestory.Client.NoObf.RenderAPIGame.RenderItemstackToGui(ItemStack itemstack, Double posX, Double posY, Double posZ, Single size, Int32 color, Boolean shading, Boolean rotate, Boolean showStacksize) in VintagestoryLib\Client\API\RenderAPIGame.cs:line 276
   at Vintagestory.Client.NoObf.DrawWorldInteractionUtil.<>c__DisplayClass11_1.<ComposeBlockWorldInteractionHelp>b__0(Single dt, ElementBounds bounds) in VintagestoryLib\Client\Systems\Gui\Huds\HudElementBlockInteractionHelp.cs:line 92
   at Vintagestory.API.Client.GuiComposer.Render(Single deltaTime) in VintagestoryApi\Client\UI\GuiComposer.cs:line 713
   at Vintagestory.API.Client.GuiDialog.OnRenderGUI(Single deltaTime) in VintagestoryApi\Client\UI\Dialog\GuiDialog.cs:line 373
   at Vintagestory.API.Client.HudElement.OnRenderGUI(Single deltaTime) in VintagestoryApi\Client\UI\HudElement.cs:line 31
   at Vintagestory.Client.NoObf.HudElementBlockInteractionHelp.OnRenderGUI(Single deltaTime) in VintagestoryLib\Client\Systems\Gui\Huds\HudElementBlockInteractionHelp.cs:line 418
   at Vintagestory.Client.NoObf.GuiManager.OnRenderFrameGUI(Single deltaTime) in VintagestoryLib\Client\Systems\Gui\GuiManager.cs:line 303
   at Vintagestory.Client.NoObf.ClientEventManager.TriggerRenderStage(EnumRenderStage stage, Single dt) in VintagestoryLib\Client\Util\ClientEventManager.cs:line 192
   at Vintagestory.Client.NoObf.ClientMain.TriggerRenderStage(EnumRenderStage stage, Single dt) in VintagestoryLib\Client\ClientMain.cs:line 787
   at Vintagestory.Client.NoObf.ClientMain.RenderToDefaultFramebuffer(Single dt) in VintagestoryLib\Client\ClientMain.cs:line 965
   at Vintagestory.Client.GuiScreenRunningGame.RenderToDefaultFramebuffer(Single dt) in VintagestoryLib\Client\MainMenu\Screens\GuiScreenRunningGame.cs:line 243
   at Vintagestory.Client.ScreenManager.Render(Single dt) in VintagestoryLib\Client\ScreenManager.cs:line 724
   at Vintagestory.Client.ScreenManager.OnNewFrame(Single dt) in VintagestoryLib\Client\ScreenManager.cs:line 627
   at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame(Object sender, FrameEventArgs e) in VintagestoryLib\Client\ClientPlatform\GameWindow.cs:line 126
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at OpenTK.GameWindow.RaiseRenderFrame(Double elapsed, Double& timestamp) in C:\Users\Nexrem\Desktop\transfer\opentk\src\OpenTK\GameWindow.cs:line 479
   at OpenTK.GameWindow.DispatchRenderFrame() in C:\Users\Nexrem\Desktop\transfer\opentk\src\OpenTK\GameWindow.cs:line 454
   at OpenTK.GameWindow.Run(Double updates_per_second, Double frames_per_second) in C:\Users\Nexrem\Desktop\transfer\opentk\src\OpenTK\GameWindow.cs:line 375
   at Vintagestory.Client.ClientProgram.Start(ClientProgramArgs args, String[] rawArgs)
   at Vintagestory.ClientNative.CrashReporter.Start(ThreadStart start) in VintagestoryLib\Client\ClientPlatform\ClientNative\CrashReporter.cs:line 93
Craluminum2413 commented 1 year ago

Coordinates where it happened: 78, 110, 8 Save file https://mega.nz/file/6EAFAZYJ#mmj2OpCoQGVBJsTR1JERGfoALaX6bL6WMwRCkBQzFGk

Bumber64 commented 1 year ago

Still present in v1.18.10. Not sure how it's happening for you, but you can force the crash to occur by giving yourself a generic tree cutting.

Backup your save, then use the command /giveblock fruittree-cutting. The client will crash, and will probably crash each time you try to rejoin.

The crash occurs as a result of this code here, which hasn't ensured curTreeType isn't null before attempting to use it as a dictionary key.

Changing the relevant code from curTreeType = itemstack.Attributes.GetString("type") to curTreeType = itemstack.Attributes.GetString("type", "") would probably solve the crash itself.

Craluminum2413 commented 1 month ago

Closing due to inactivity