Skip to content

Loadstate crashes if the state has memcard or gamepad settings different to the loaded core #2781

Closed as duplicate of#2090
@ghost

Description

Summary

This is 2 issues that do happen under similar circumstances:

The first being triggered by just loading a previous state with different settings on memcards/controllers enabled.
This makes bizhawk crash when the said state tried to load, but can be avoided by simply manually setting the proper configuration, rebooting the core (in this case Octoshock), and then loading the state.
The problem is that this tends to be a problem when states are needed not in a single usage of the emulator, so for example when doing research on games before tasing, whereas different settings give different pros and cons. So coming back days later on bizhawk, forces to just delete the states and restart from the beginning, if the user didnt write down what config of memcards/controller X or Y state had.

The second issue fortunately doesnt crash the emulator itself, but prompts an error message on TAStudio that re-happens while tasing, once it gets triggered the first time.
Happens when switching from a TAS without memcard/multitap (in this instance) to another TAS with memcard and multitap.

Repro # 1:

  1. Open bizhawk
  2. Open a rom, enable memcard/controller 2/3etc
  3. Save a state
  4. Change settings of memcards/controllers, reboot core, save configs
  5. Take another savestate in a different slot
  6. Close and re open bizhawk
  7. Load the first state
  8. Bizhawk crashes

Output # 1 (bizhawk crash):

System.InvalidOperationException: Save buffer size mismatch!
   in BizHawk.Emulation.Cores.Sony.PSX.Octoshock.LoadStateBinary(BinaryReader reader)
   in BizHawk.Client.Common.ZipStateLoader.GetLump(BinaryStateLump lump, Boolean abort, Action`2 callback)
   in BizHawk.Client.Common.ZipStateLoader.GetCoreState(Action`1 callbackBinary, Action`1 callbackText)
   in BizHawk.Client.Common.SavestateFile.Load(String path)
   in BizHawk.Client.EmuHawk.MainForm.LoadState(String path, String userFriendlyStateName, Boolean suppressOSD)
   in BizHawk.Client.EmuHawk.MainForm.LoadQuickSave(String quickSlotName, Boolean suppressOSD)
   in BizHawk.Client.EmuHawk.MainForm.CheckHotkey(String trigger)
   in BizHawk.Client.EmuHawk.MainForm.<ProcessInput>b__125_0(Boolean current, String trigger)
   in System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
   in BizHawk.Client.EmuHawk.MainForm.ProcessInput(InputCoalescer hotkeyCoalescer, ControllerInputCoalescer finalHostController, Func`2 searchHotkeyBindings, Func`2 activeControllerHasBinding)
   in BizHawk.Client.EmuHawk.MainForm.ProgramRunLoop()
   in BizHawk.Client.EmuHawk.Program.SubMain(String[] args)

Repro # 2 (TAStudio)

  1. Open bizhawk, set just 1 controller in psx settings
  2. Reboot core, save config and restart bizhawk
  3. Open a .tasproj that has different settings with memcards/controllers (as its shown in the video, that tasproj has 1 memcard, 1 multitap with 4 controllers attached)

Output # 2:

************** Testo dell'eccezione **************
System.IndexOutOfRangeException: Indice oltre i limiti della matrice.
   in BizHawk.Client.EmuHawk.TAStudio.UpdateAutoFire(String button, Nullable`1 isOn)
   in BizHawk.Client.EmuHawk.TAStudio.UpdateAutoFire()
   in BizHawk.Client.EmuHawk.TAStudio.LoadFile(FileInfo file, Boolean startsFromSavestate, Int32 gotoFrame)
   in BizHawk.Client.EmuHawk.TAStudio.LoadFileWithFallback(String path)
   in BizHawk.Client.EmuHawk.TAStudio.OpenTasMenuItem_Click(Object sender, EventArgs e)
   in System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   in System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   in System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   in System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   in System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   in System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   in System.Windows.Forms.Control.WndProc(Message& m)
   in System.Windows.Forms.ToolStrip.WndProc(Message& m)
   in System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Visual repro of both issues: https://www.youtube.com/watch?v=tPReaCuvdiw video delisted

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions