BizHawk
BizHawk copied to clipboard
BizHawk crashes when trying to load a savestate made with different sync settings
Create a savestate with GB or PSX, then change some core settings and reboot the core. Then, if you try to load that savestate, you get this for Gambatte:
System.InvalidOperationException: Save buffer size mismatch!
at BizHawk.Emulation.Cores.Sony.PSX.Octoshock.LoadStateBinary(BinaryReader reader)
at BizHawk.Client.Common.BinaryStateLoader.GetLump(BinaryStateLump lump, Boolean abort, Action`2 callback)
at BizHawk.Client.Common.BinaryStateLoader.GetCoreState(Action`1 callbackBinary, Action`1 callbackText)
at BizHawk.Client.Common.SavestateManager.LoadStateFile(IEmulator emulator, String path)
at BizHawk.Client.EmuHawk.MainForm.LoadState(String path, String userFriendlyStateName, Boolean fromLua, Boolean suppressOSD)
at BizHawk.Client.EmuHawk.MainForm.LoadQuickSave(String quickSlotName, Boolean fromLua, Boolean suppressOSD)
at BizHawk.Client.EmuHawk.MainForm.CheckHotkey(String trigger)
at BizHawk.Client.EmuHawk.MainForm.<ProcessInput>b__101_0(Boolean current, String trigger)
at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
at BizHawk.Client.EmuHawk.MainForm.ProcessInput()
at BizHawk.Client.EmuHawk.MainForm.ProgramRunLoop()
at BizHawk.Client.EmuHawk.Program.SubMain(String[] args)
And this for Octoshock:
System.InvalidOperationException: Savestate buffer size mismatch!
at BizHawk.Emulation.Cores.Nintendo.Gameboy.Gameboy.LoadStateBinary(BinaryReader reader)
at BizHawk.Client.Common.BinaryStateLoader.GetLump(BinaryStateLump lump, Boolean abort, Action`2 callback)
at BizHawk.Client.Common.BinaryStateLoader.GetCoreState(Action`1 callbackBinary, Action`1 callbackText)
at BizHawk.Client.Common.SavestateManager.LoadStateFile(IEmulator emulator, String path)
at BizHawk.Client.EmuHawk.MainForm.LoadState(String path, String userFriendlyStateName, Boolean fromLua, Boolean suppressOSD)
at BizHawk.Client.EmuHawk.MainForm.LoadQuickSave(String quickSlotName, Boolean fromLua, Boolean suppressOSD)
at BizHawk.Client.EmuHawk.MainForm.CheckHotkey(String trigger)
at BizHawk.Client.EmuHawk.MainForm.<ProcessInput>b__101_0(Boolean current, String trigger)
at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
at BizHawk.Client.EmuHawk.MainForm.ProcessInput()
at BizHawk.Client.EmuHawk.MainForm.ProgramRunLoop()
at BizHawk.Client.EmuHawk.Program.SubMain(String[] args)
Also, after closing the error window, the BizHawk process ends instantly without updating settings.ini.
First, BizHawk shouldn't close abruptly after displaying the error window. Second, the error window should explain which are the sync settings that are different between the savestate that was attempted to load and the currently set ones for the running core.
see also #1664 for the same bug using Genplus-gx
I don't think any other issues track this at the moment, but this is something we're interested in and adelikat has been laboring tirelessly to work towards resolving it. Unfortunately, there's still a long road ahead.
A possibly related crash from Discord:
It's partially cut off and in Norwegian(?), but the stacktrace is from jumping to a marker TAStudio. Something like:
InvalidOperationException: Save buffer size mismatch!
at BizHawk.Emulation.Cores.Sony.PSX.Octoshock.LoadStateBinary
at BizHawk.Client.EmuHawk.TAStudio.LoadState
at BizHawk.Client.EmuHawk.TAStudio.StartAtNearestFrameAndEmulate
at BizHawk.Client.EmuHawk.TAStudio.GoToFrame
at BizHawk.Client.EmuHawk.MarkerControl.MarkerView_MouseDoubleClick
Also, after closing the error window, the BizHawk process ends instantly without updating settings.ini.
This doesn't seem to be the case anymore.
Second, the error window should explain which are the sync settings that are different between the savestate that was attempted to load and the currently set ones for the running core.
Sync Settings aren't stated. The error here will occur for any unexpected state size difference (which can be due to sync settings). For Gambatte it would be GB/SGB vs GBC/GBA, as their state sizes differ (GB/SGB has less VRAM and less WRAM than GBC/GBA). Perhaps the error message could just mention it might be the issue. Or maybe sync settings should be stated for comparision purposes?