TASEmulators / BizHawk

BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores.
http://tasvideos.org/BizHawk.html
Other
2.2k stars 385 forks source link

Super Mario 64 + RetroAchievements: Crash on Bob-omb Battlefield entry #4000

Closed yoshiweegee closed 3 months ago

yoshiweegee commented 3 months ago

Summary

With RetroAchievements enabled, upon entering Bob-omb Battlefield after selecting a star from its star selection menu, after the fade to white, BizHawk crashes.

In case it makes any difference, fast-forward was not used to make the intro cutscene pass faster.

A possible clue is that, once during much earlier testing to get RetroAchievements set up, I heard what I believe to be the power-up sound from New Super Mario Bros. after logging in to RetroAchievements (after it had been started). I have never heard this sound before or again after that occurrence. The errors seem to be related to playing sounds, hence my suspicion.

Repro

  1. Ensure RetroAchievements is started and logged in.
  2. Open Super Mario 64 (USA).
  3. Proceed through game normally in order to enter Bob-omb Battlefield.
  4. Select a star, and wait for the screen to fade to white. BizHawk will crash shortly after the fade completes.

Output


Unhandled Exception:
System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
  at System.Buffer.BlockCopy (System.Array src, System.Int32 srcOffset, System.Array dst, System.Int32 dstOffset, System.Int32 count) [0x0007e] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.IO.MemoryStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x000f0] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Media.SoundPlayer.LoadFromStream (System.IO.Stream s) [0x00018] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.LoadFromUri (System.String location) [0x00039] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.Load () [0x0001f] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.Start () [0x0002a] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.PlaySync () [0x00000] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_delegate_end_invoke(object,intptr)
  at (wrapper delegate-end-invoke) <Module>.end_invoke_void__this___IAsyncResult(System.IAsyncResult)
  at System.Media.SoundPlayer.AsyncFinished (System.IAsyncResult ar) [0x00006] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at (wrapper managed-to-native) System.Runtime.Remoting.Messaging.AsyncResult.Invoke(System.Runtime.Remoting.Messaging.AsyncResult)
  at System.Runtime.Remoting.Messaging.AsyncResult.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <d636f104d58046fd9b195699bcb1a744>:0 

Unhandled Exception:
System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
  at System.Buffer.BlockCopy (System.Array src, System.Int32 srcOffset, System.Array dst, System.Int32 dstOffset, System.Int32 count) [0x0007e] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.IO.MemoryStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x000f0] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Media.SoundPlayer.LoadFromStream (System.IO.Stream s) [0x00018] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.LoadFromUri (System.String location) [0x00039] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.Load () [0x0001f] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.Start () [0x0002a] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.PlaySync () [0x00000] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_delegate_end_invoke(object,intptr)
  at (wrapper delegate-end-invoke) <Module>.end_invoke_void__this___IAsyncResult(System.IAsyncResult)
  at System.Media.SoundPlayer.AsyncFinished (System.IAsyncResult ar) [0x00006] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at (wrapper managed-to-native) System.Runtime.Remoting.Messaging.AsyncResult.Invoke(System.Runtime.Remoting.Messaging.AsyncResult)
  at System.Runtime.Remoting.Messaging.AsyncResult.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <d636f104d58046fd9b195699bcb1a744>:0 

Unhandled Exception:
System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
  at System.Buffer.BlockCopy (System.Array src, System.Int32 srcOffset, System.Array dst, System.Int32 dstOffset, System.Int32 count) [0x0007e] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.IO.MemoryStream.set_Capacity (System.Int32 value) [0x00061] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.IO.MemoryStream.EnsureCapacity (System.Int32 value) [0x0005c] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.IO.MemoryStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x00093] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Media.SoundPlayer.LoadFromStream (System.IO.Stream s) [0x00018] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.LoadFromUri (System.String location) [0x00039] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.Load () [0x0001f] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.Start () [0x0002a] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.PlaySync () [0x00000] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_delegate_end_invoke(object,intptr)
  at (wrapper delegate-end-invoke) <Module>.end_invoke_void__this___IAsyncResult(System.IAsyncResult)
  at System.Media.SoundPlayer.AsyncFinished (System.IAsyncResult ar) [0x00006] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at (wrapper managed-to-native) System.Runtime.Remoting.Messaging.AsyncResult.Invoke(System.Runtime.Remoting.Messaging.AsyncResult)
  at System.Runtime.Remoting.Messaging.AsyncResult.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <d636f104d58046fd9b195699bcb1a744>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
  at System.Buffer.BlockCopy (System.Array src, System.Int32 srcOffset, System.Array dst, System.Int32 dstOffset, System.Int32 count) [0x0007e] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.IO.MemoryStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x000f0] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Media.SoundPlayer.LoadFromStream (System.IO.Stream s) [0x00018] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.LoadFromUri (System.String location) [0x00039] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.Load () [0x0001f] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.Start () [0x0002a] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.PlaySync () [0x00000] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_delegate_end_invoke(object,intptr)
  at (wrapper delegate-end-invoke) <Module>.end_invoke_void__this___IAsyncResult(System.IAsyncResult)
  at System.Media.SoundPlayer.AsyncFinished (System.IAsyncResult ar) [0x00006] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at (wrapper managed-to-native) System.Runtime.Remoting.Messaging.AsyncResult.Invoke(System.Runtime.Remoting.Messaging.AsyncResult)
  at System.Runtime.Remoting.Messaging.AsyncResult.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <d636f104d58046fd9b195699bcb1a744>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
  at System.Buffer.BlockCopy (System.Array src, System.Int32 srcOffset, System.Array dst, System.Int32 dstOffset, System.Int32 count) [0x0007e] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.IO.MemoryStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x000f0] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Media.SoundPlayer.LoadFromStream (System.IO.Stream s) [0x00018] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.LoadFromUri (System.String location) [0x00039] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.Load () [0x0001f] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.Start () [0x0002a] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.PlaySync () [0x00000] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_delegate_end_invoke(object,intptr)
  at (wrapper delegate-end-invoke) <Module>.end_invoke_void__this___IAsyncResult(System.IAsyncResult)
  at System.Media.SoundPlayer.AsyncFinished (System.IAsyncResult ar) [0x00006] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at (wrapper managed-to-native) System.Runtime.Remoting.Messaging.AsyncResult.Invoke(System.Runtime.Remoting.Messaging.AsyncResult)
  at System.Runtime.Remoting.Messaging.AsyncResult.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <d636f104d58046fd9b195699bcb1a744>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
  at System.Buffer.BlockCopy (System.Array src, System.Int32 srcOffset, System.Array dst, System.Int32 dstOffset, System.Int32 count) [0x0007e] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.IO.MemoryStream.set_Capacity (System.Int32 value) [0x00061] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.IO.MemoryStream.EnsureCapacity (System.Int32 value) [0x0005c] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.IO.MemoryStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x00093] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Media.SoundPlayer.LoadFromStream (System.IO.Stream s) [0x00018] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.LoadFromUri (System.String location) [0x00039] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.Load () [0x0001f] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.Start () [0x0002a] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Media.SoundPlayer.PlaySync () [0x00000] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_delegate_end_invoke(object,intptr)
  at (wrapper delegate-end-invoke) <Module>.end_invoke_void__this___IAsyncResult(System.IAsyncResult)
  at System.Media.SoundPlayer.AsyncFinished (System.IAsyncResult ar) [0x00006] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at (wrapper managed-to-native) System.Runtime.Remoting.Messaging.AsyncResult.Invoke(System.Runtime.Remoting.Messaging.AsyncResult)
  at System.Runtime.Remoting.Messaging.AsyncResult.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <d636f104d58046fd9b195699bcb1a744>:0 
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <d636f104d58046fd9b195699bcb1a744>:0 
Aborted (core dumped)

Host env.

BizHawk 2.9.1 (x64; EmuHawkMono.sh); Linux Mint Cinnamon 21.3 (Ubuntu 22.04); AMD Ryzen 5 7600/NVIDIA GeForce RTX 4070

CasualPokePlayer commented 3 months ago

This should be fixed in the latest dev builds, as System.Media.SoundPlayer usage was removed and replaced with our own sound system playing some .wav file. This is just some crash due to some buggy Mono implementation of System.Media.SoundPlayer.