[ オリジナルレポート ]

BugID: #05704

カテゴリ 重要度 ステータス 解決状況 登録日時 最終更新
クラッシュ/フリーズ重要 (本体)解決済み修正済み2014-09-24 05:092016-11-13 21:30
 
テスターTestweazle担当者 ソース
バージョン0.154発生バージョン修正バージョン
修正コミットプルリク
フラグ
セット ddcrew
セット詳細
ddcrew - D.D.クルー (海外版, 3 Players) (FD1094 317-0190)
 
概 要セーブステート保存時にクラッシュする。
詳 細When creating a save state on certain games, such as ddcrew.zip (D.D. Crew) and mt_srage.zip (Megatech Streets of Rage), it will crash the emulator.

The issue is described as follows by the developer of MAMEHub:

------------------------------------------------------------------------------------------------------------------------------------------------------------------
When mame starts ddcrew, it creates some bitmaps that are the size of the screen:
https://github.com/MisterTea/MAMEHub/blob/master/Sources/Emulator/src/emu/video/315_5124.c#L1791

Those bitmaps are marked to remember that they should be the size of the screen here:
https://github.com/MisterTea/MAMEHub/blob/master/Sources/Emulator/src/emu/screen.c#L800

At the same time, it adds a bitmap of that size to the save state:
https://github.com/MisterTea/MAMEHub/blob/master/Sources/Emulator/src/emu/video/315_5124.c#L1825

The problem comes when you resize the screen (which happens automatically after a few frames if you have maximize set to 1), it resizes the bitmap, destroying the original:
https://github.com/MisterTea/MAMEHub/blob/master/Sources/Emulator/src/emu/screen.c#L538

But the save state is still pointing to the original, hence the crash.
------------------------------------------------------------------------------------------------------------------------------------------------------------------


For the discussion thread on GitHub go here: https://github.com/MisterTea/MAMEHub/issues/252

It is very likely that the same issue is present in MESS as well (if so do I need to create a duplicate report for MESS?). I also tested the games on MAME 0.149 and I was able to create a save-state without any problems.


The following access violation is produced after the crash:

-----------------------------------------------------
Exception at EIP=77C46FA3 (register_frame_ctor+0x743b2993): ACCESS VIOLATION
While attempting to read memory at 0920C000
-----------------------------------------------------
EAX=0920EED2 EBX=06288C08 ECX=00000BB5 EDX=00000000
ESI=0920BFFE EDI=06297404 EBP=0022B348 ESP=0022B340
-----------------------------------------------------
Stack crawl:
0022B348: 77C46FA3 (memcpy+0x0033)
0022B398: 021F3A23 (fill_window+0x0093)
0022B3D8: 021F3FA8 (deflate_slow+0x01c8)
0022B428: 021F5E3F (deflate+0x00ff)
0022B488: 02040C7F (core_fwrite(core_file*, void const*, unsigned int)+0x00ef)

0022B4A8: 01EF3EFB (emu_file::write(void const*, unsigned int)+0x002b)
0022B508: 01EC1BB4 (save_manager::write_file(emu_file&)+0x0164)
0022B6F8: 01E875A2 (running_machine::handle_saveload()+0x01c2)
0022B7A8: 01E8A36D (running_machine::run(bool)+0x03cd)
0022F708: 01E9F16A (machine_manager::execute()+0x05aa)
0022F978: 01F3101B (cli_frontend::execute(int, char**)+0x0f0b)
0022FEB8: 01332635 (utf8_main(int, char**)+0x04a5)
0022FEF8: 021FA8DE (wmain+0x006e)
0022FFC0: 0040140B (__tmainCRTStartup+0x028b)
0022FFF0: 7C81776F (RegisterWaitForInputIdle+0x0049)
再現手順 
追加情報Removing the bitmaps from the save states fixes the crash. This has been tested in the custom build used by MAMEHub. Save states now function normally.
 
添付ファイル