Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TAStudio error: Index was out of range & System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. #606

Closed
Niamek opened this issue Mar 24, 2016 · 4 comments
Assignees

Comments

@Niamek
Copy link

Niamek commented Mar 24, 2016

Alright, got it more reliably. I tseems that it's the deleting that breaks.

Steps I do:
->Open a ROM(I tested with a GBA game, but I got the same bug with a GBC rom too.
->Open TAStudio
->Let the movie play some frames(idealy an 100 so you have some rooms)
->Save a branch
->Delete a chunk of frames(like 20 frames in one delete)
->During the seeking, save a branch
->Select branches
->Error should be thrown.

Doing the same thing with cloning gives me this error:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.SortedList2.GetByIndex(Int32 index) at System.Collections.Generic.SortedList2.ValueList.get_Item(Int32 index)
at BizHawk.Client.Common.TasStateManager.stateHasDuplicate(Int32 frame, Int32 branchHash)
at BizHawk.Client.Common.TasStateManager.RemoveState(Int32 frame, Int32 branch)
at BizHawk.Client.Common.TasStateManager.Invalidate(Int32 frame)
at BizHawk.Client.Common.TasMovie.InvalidateAfter(Int32 frame)
at BizHawk.Client.Common.TasMovie.ToggleBoolState(Int32 frame, String buttonName)
at BizHawk.Client.EmuHawk.TAStudio.TasView_MouseDown(Object sender, MouseEventArgs e)
at System.Windows.Forms.Control.OnMouseDown(MouseEventArgs e)
at BizHawk.Client.EmuHawk.InputRoll.OnMouseDown(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

EDIT: Removed the duplicate exception text.

@Niamek
Copy link
Author

Niamek commented Mar 24, 2016

Woops, sorry for the lenghty title. I didn't think before.

I should've put a title like:
deleting or cloning a group of frames, then saving a branch, then selecting a branch = error

@vadosnaprimer vadosnaprimer self-assigned this Mar 24, 2016
@Niamek
Copy link
Author

Niamek commented Apr 1, 2016

Finally, it seems that it's not relied only to deleting/cloning a group of frames since I got it by TASing and avoiding deleting groups of frames by deleting one by one. Won't give repro steps since it's the same bug.

EDIT: It seems that even if I don't clone/delete, I eventually get this bug too, it just takes a longer time.(I just had it without doing cloning or deleting), so I guess it's pretty much the branches that are busted. :(

Thank you in advance Vadosnaprimer for looking eventually into this bug.

@SamsaraTAS
Copy link

That error always happens for me when I update a branch and then try to edit anything in the greenzone after that, so that's probably a more reliable reproduction assuming I'm not the only one it happens to.

@vadosnaprimer
Copy link
Contributor

vadosnaprimer commented Apr 17, 2016

Branch manipulation during seeking. All of these will get lost if I stop using bg threads for seeking and saving. it was a bad idea, taseditor uses a special Proc for progressbar and it handles events separately, also separately updating.

It looked like a nice feature here, but it was designed utterly wrong. Maybe someday someone wants to do it right, until then I'll kill it.

EDIT:

Woops, it's not progressbar related at all! It's branch states related ONCE FUCKING AGAIN. Jeez, that's what we want to kill since forever.

vadosnaprimer pushed a commit to vadosnaprimer/BizHawk that referenced this issue May 8, 2016
should properly handle branches created during seeking.
fix TASEmulators#606 I hope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants