[ オリジナルレポート ]

BugID: #07372

カテゴリ 重要度 ステータス 解決状況 登録日時 最終更新
クラッシュ/フリーズ重要 (本体)解決済み修正済み2019-07-07 07:432019-10-20 03:52
 
テスターGeorgeMcMullen担当者GeorgeMcMullenソース
バージョン0.211発生バージョン修正バージョン0.215
修正コミットプルリク
フラグ
セット
セット詳細
 
概 要X11光線銃ルーチンが正しいX11ディスプレイを確認しないためクラッシュする。
詳 細Greetings,

First bug report, thanks in advance for your patience.

@MrGW reported an issue (https://mametesters.org/view.php?id=7350) with regards to MAME v0.210 crashing immediately on startup, which seemed to be caused by changes in v0.210 which enable X11 and XInput on Linux based systems by default. The workaround is to either compile with X11/XInput explicitly disabled, or start MAME with the option '-lightgunprovider none'. I believe I've found the cause of the issue.

I'm filing a new bug because I'm unable to comment on or reopen the original bug. Also, this is a lower level bug report for the code itself.

Platforms Affected:
- Raspberry Pi (3, 3+, 2, 0)
- Raspbian Stretch or RetroPie 4.4 (based on Raspbian Stretch)

The issue is caused by the Lightgun routine attempting to reference an X11 display when there is none. Thus, this issue is likely to occur on other Linux based platforms where X11 is not being used (e.g. directfb).

The actual crash happens at this line:

https://github.com/mamedev/mame/blob/173962bf18acf20ada60d1b592bf798be28a32a5/src/osd/modules/input/input_x11.cpp#L316

That routine should check that m_display is not null before proceeding to XPending(), which evidently also doesn't check that it's been passed a null value.

But this may also be averted by checking that the X11 initialization routine has actually successfully completed as in the following line:

https://github.com/mamedev/mame/blob/173962bf18acf20ada60d1b592bf798be28a32a5/src/osd/modules/input/input_x11.cpp#L454

A simple check on the return value of initialize will avert the lightgun routine from completing its own initialization, and subsequently causing the crash.
再現手順git pull latest MAME source.
Compile MAME using the standard 'makefile' using the 'make' command
Launch MAME. The UI will just start to show and then it dies with a segmentation fault.

Launch MAME with the following command line options:

mame -verbose

You will get output such as the following:

Lightgun: Begin initialization
Unable to connect to X server
Lightgun: End initialization
Joystick: Start initialization
Joystick: End initialization
Searching font Liberation Sans in -. path/s
font Liberation Sans|Regular is not TrueType or BDF, using MAME default
Segmentation fault

Launching MAME with the following command line options is a workaround, which will allow you to use MAME.

mame -lightgunprovider none
追加情報 
 
添付ファイル