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.18k stars 382 forks source link

Octoshock crashes when playing and dumping movie with different input configuration #1842

Closed Zinfidel closed 4 years ago

Zinfidel commented 4 years ago

Affects at least version 2.4 and latest master commit 0075693ec79793a9751edadc86927fbcb9586ffe

This issue is directly related to issue #1787

Playing and dumping a movie that has a different input configuration than the current configuration at the time of playing the movie causes Octoshock to crash. For example, if the current configuration is for a Dualshock controller for P1 and a Dualshock controller for P2, loading and dumping a movie with a Dualshock controller for P1, but no controller for P2 will cause the crash. Sometimes no AVI dumping is needed, and the core will crash with just the movie, but this behavior is inconsistent.

Both NES and both SNES cores have also been tested for this behavior, and none of them exhibit it. Only the Ocotoshock core thus far.

For reproducing the bug, you need a movie file that is configured to use a Dualshock controller for P1 w/ memcard, and no controller or memcard for P2. My file started from a save state, and was a tasproj movie. Not sure if those are relevant.

Reproduction steps are very finicky, follow carefully:

  1. Launch BizHawk
  2. Load PSX game
  3. PSX > Controller / Memcard Configuration
  4. Change both players to use Dualshock controllers w/ memcards. If this is how it is already set up, click stuff to get the "reboot required" message to appear post config.
  5. Reboot Octoshock core
  6. Pause the emulator
  7. File > Movie > Play Movie
  8. Select the movie with different input configuration
  9. File > AVI/WAV > Record (or configure)
  10. Set up dump (avi-lossless used for testing)
  11. Unpause emulator
  12. Access violation / crash to desktop

The crash is occurring in the UpdateInput() function in psx.cpp: image It appears that the ports memory is getting clobbered or is otherwise corrupt at the time the movie is resumed. It will crash when trying to dereference the no-controller device at index 1.

A possibly relevant observation is that when BizHawk successfully loads and starts dumping movies, upon closing and restarting the emulator, the input settings will have been modified to match the previous movie. When the AV crash occurs however, BizHawk will frequently start up with the input configuration that causes the crash.

I can furnish all of the files necessary to reproduce this bug if requested.

Zinfidel commented 4 years ago

Probably fixed by 28ae6d44134c46ce13b2fb335b9a581f2c6f8a46.