Keep getting this crash sometimes when I load up.
Sometimes I would say maybe 1 in 3 times I load up tmodloader I get this crash, its not a huge deal but does anyone have any ideas?
client.log94.88KB
client.logILHook to a method which already had an ILHook and is currently executing.DrawMenu, which is already IL hooked by InnoVault, but it looks like HighFPSSupport adds two IL hooks to DoDraw itself, which is the method I've seen in other stack traces.InnoVault and HighFPSSupport hooking the same method, HighFPSSupport could temporarily work around this by merging its two IL hooks.QueueMainThreadAction to avoid the race conditionInnoVault hooks first, so it can't trigger the race, but if another mod was to load before it, or the hook order isn't deterministic, then they would also need to use QueueMainThreadActionMain.QueueMainThreadAction(). Hopefully that worksLoad() seems like a reasonable place for mods to apply IL hooks that affect drawing/UI. Obviously fixing the MonoMod bug itself is ideal, but deferring mod loading to not happen while the game is drawing would have also avoided thisQueueMainThreadAction lets you apply your hook at a time when there is no drawing or updating happening(client.log)client.logILHookILHookDrawMenuInnoVaultInnoVaultInnoVaultHighFPSSupportHighFPSSupportHighFPSSupportDoDraw[22:47:16.896] [.NET TP Worker/DEBUG] [tML]: ILHook Terraria.Main::DrawMenu(GameTime) added by InnoVault
...
[22:47:20.803] [.NET TP Worker/DEBUG] [tML]: Hook Terraria.Main::DoDraw(GameTime) added by HighFPSSupport
...
[22:47:20.847] [.NET TP Worker/DEBUG] [tML]: ILHook Terraria.Main::DoDraw(GameTime) added by HighFPSSupport
...
[22:47:20.912] [.NET TP Worker/DEBUG] [tML]: ILHook Terraria.Main::DoDraw(GameTime) added by HighFPSSupport
[22:47:20.996] [Main Thread/ERROR] [Terraria]: System.ArgumentException: Referenced cell no longer exists (Parameter 'cellRef')
at MonoMod.Utils.DynamicReferenceManager.GetCell(DynamicReferenceCell cellRef) in /_/src/MonoMod.Utils/DynamicReferenceManager.cs:line 167
at MonoMod.Utils.DynamicReferenceManager.GetValueRefUnsafe[T](DynamicReferenceCell cellRef) in /_/src/MonoMod.Utils/DynamicReferenceManager.cs:line 219
at MonoMod.Utils.DynamicReferenceManager.GetValueTUnsafe[T](Int32 index, Int32 hash) in /_/src/MonoMod.Utils/DynamicReferenceManager.cs:line 251
at DMD<DMD<>?29812957::Terraria.Main::DrawMenu>(Main this, GameTime gameTime)
at SyncProxy<System.Void Terraria.Main:DrawMenu(Microsoft.Xna.Framework.GameTime)>(Main , GameTime )
at DMD<DMD<>?47174377::Terraria.Main::DoDraw>(Main this, GameTime gameTime)
at HighFPSSupport.TickRateModifier.OnDraw(orig_DoDraw orig, Main self, GameTime gameTime) in HighFPSSupport\TickRateModifier.cs:line 77
at Hook<System.Void HighFPSSupport.TickRateModifier::OnDraw(Terraria.On_Main+orig_DoDraw,Terraria.Main,Microsoft.Xna.Framework.GameTime)>(Main , GameTime )
at SyncProxy<System.Void Terraria.Main:DoDraw(Microsoft.Xna.Framework.GameTime)>(Main , GameTime )
at Terraria.Main.Draw_Inner(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 53070
at Terraria.Main.Draw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 53057
[22:47:21.025] [.NET TP Worker/DEBUG] [tML]: ILHook Terraria.Main::DrawMenu(GameTime) added by HighFPSSupportQueueMainThreadActionQueueMainThreadActionQueueMainThreadAction Main.QueueMainThreadAction(() => {
IL_Main.DoUpdate += PatchDoUpdate;
});Main.QueueMainThreadAction()Load()