Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
09187 Crash/Freeze Major Always 14 days ago 11 days ago
Tester Augusto View Status Public Platform
Assigned To Resolution Open OS
Status [?] Confirmed Driver
Version 0.277 Fixed in Version Build
Fixed in Git Commit Github Pull Request #
Summary 09187: MAME cannot load any system if "bgfx_screen_chains" settings not are same in both mame.ini and game.cfg
Description Hello.
Thanks for reading my bug report.

Edit the mame.ini in
# BGFX POST-PROCESSING OPTIONS
bgfx_screen_chains

to
bgfx_screen_chains none

Try load a game or system.
After select any BGFX screen effect for example CRT-GEOM. That shader will work in current loaded game system.
Close the game system.
Try restart the previous game system. MAME will crash with message "Segmentation fault (core dumped)".
Need edit mame.ini and remove any value in "bgfx_screen_chains" or delete the game system.cfg.

MAME previous versions ( only tested 0.275) not had that issue being possible in mame.ini "bgfx_screen_chains none" and using an selected different BGFX shader for any game system.
That bug are happening in MAME recent versions.

Have an nice day.
Steps To Reproduce
Additional Information
Github Commit
Flags
Regression Version
Affected Sets / Systems
Attached Files
 
Relationships
Notes
9
User avatar
No.23379
cuavas
Administrator
14 days ago
I can't reproduce this. I test that the screen chains setting in the CFG file is applied on every release candidate (it's one of my standard tests). Are you sure it isn't a GPU driver issue?
User avatar
No.23380
Robbbert
Moderator
14 days ago
Unable to replicate this crash in Windows.

Maybe someone with unix can try.
User avatar
No.23381
Kale
Developer
13 days ago
Can't repro either.
User avatar
No.23383
hap
Developer
13 days ago
edited on: 13 days ago
It's the crash I mentioned here:
https://mametesters.org/view.php?id=9186

How I can repro it:
open mame.ini and change video to bgfx, and bgfx_screen_chains to literally nothing
To be clear, surrounding contents look like this.

bgfx_path bgfx
bgfx_backend auto
bgfx_debug 0
bgfx_screen_chains
bgfx_shadow_mask slot-mask.png
bgfx_lut lut-default.png
bgfx_avi_name auto

delete cfg/pacman.cfg
mame pacman, exit mame

the newly saved pacman.cfg should include this now:
        <bgfx>
            <window index="0">
                <screen index="0" chain="default" />
            </window>
        </bgfx>

change mame.ini bgfx_screen_chains to none
mame pacman
mame crashes

if I do this after:
mame pacman -bgfx_screen_chains none
it does not crash

FWIW I'm also getting the crash on 0.275, contradicting what Augusto claims.
I tried as far back as 0.256 (oldest version I have here), and it also crashes with this method.
User avatar
No.23384
Augusto
Tester
13 days ago
edited on: 13 days ago
@cuavas
"Are you sure it isn't a GPU driver issue?"
GT 640 using driver 470.256.
Not any driver issue.

@hap
You have figured the issue and details about the crash.

"FWIW I'm also getting the crash on 0.275, contradicting what Augusto claims. I tried as far back as 0.256 (oldest version I have here), and it also crashes with this method."
I remember here that had happened only recently so for me was 0.277 being the version updated then 0.275.
However is better follow the informations detailed by hap that has replied more details than my report.
User avatar
No.23386
Robbbert
Moderator
12 days ago
The procedure from hap is reproducible, and we finally have the elusive dump. Not entirely sure if this is what Augusto is referring to though.

-----------------------------------------------------
Exception at EIP=00007ff7c5175d57 (bgfx_chain_entry::setup_view(texture_manager&, int, unsigned short, unsigned short, int, unsigned short&, unsigned short&) const+0x05a7): ACCESS VIOLATION
While attempting to read memory at 0000000000000000
-----------------------------------------------------
RAX=0000000000000000 RBX=0000028eb1702ae0 RCX=0000000000000000 RDX=000001c078d43060
RSI=0000000000000000 RDI=000000ce39af8f90 RBP=000000ce39af8f80 RSP=000000ce39af8f10
 R8=0000000000000006 R9=0000000000000000 R10=000000ce39af8f98 R11=0000000000000008
R12=000000ce39af8fc0 R13=000000ce39af8fb0 R14=0000000000000000 R15=0000028ea13f2630
-----------------------------------------------------
Stack crawl:
  000000ce39af90e0: 00007ff7c5175d57 (luaopen_lfs+0x7e4c77)
  000000ce39af9200: 00007ff7c517638e (luaopen_lfs+0x7e52ae)
  000000ce39af9310: 00007ff7c4ff209a (luaopen_lfs+0x660fba)
  000000ce39af9390: 00007ff7c4b5e7d2 (luaopen_lfs+0x1cd6f2)
  000000ce39af9430: 00007ff7c4b5e955 (luaopen_lfs+0x1cd875)
  000000ce39af9590: 00007ff7c39b087b (renderer_bgfx::draw(int)+0x044b)
  000000ce39af95f0: 00007ff7bfb7e29b (win_window_info::draw_video_contents(HDC__*, bool)+0x005b)
  000000ce39af96f0: 00007ff7bfb82806 (win_window_info::video_window_proc(HWND__*, unsigned int, unsigned long long, long long)+0x0266)
  000000ce39af9880: 00007ffeccc2ef5c (CallWindowProcW+0x060c)
  000000ce39af9920: 00007ffeccc2dfbb (SendMessageW+0x092b)
  000000ce39af9980: 00007ffeccc2d814 (SendMessageW+0x0184)
  000000ce39af99c0: 00007ff7bfb8d3ea (windows_osd_interface::update(bool)+0x003a)
  000000ce39af9a50: 00007ff7bfcd8c59 (video_manager::frame_update(bool)+0x00a9)
  000000ce39af9ab0: 00007ff7bc81f63a (screen_device::vblank_begin(int)+0x022a)
  000000ce39af9b30: 00007ff7bc80e6fb (device_scheduler::timeslice()+0x013b)
  000000ce39af9cb0: 00007ff7bc80b925 (running_machine::run(bool)+0x01c5)
  000000ce39aff370: 00007ff7bfb623cc (mame_machine_manager::execute()+0x024c)
  000000ce39aff760: 00007ff7c38ffc5a (cli_frontend::start_execution(mame_machine_manager*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x03ea)
  000000ce39affa70: 00007ff7c390028a (cli_frontend::execute(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)+0x007a)
  000000ce39affad0: 00007ff7bfb5d167 (emulator_info::start_frontend(emu_options&, osd_interface&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)+0x0027)
  000000ce39affea0: 00007ff7c56c4801 (luaopen_lfs+0xd33721)
  000000ce39affef0: 00007ff7b8a312ee (__tmainCRTStartup+0x016e)
  000000ce39afff20: 00007ff7b8a31406 (mainCRTStartup+0x0016)
  000000ce39afff50: 00007ffecc587374 (BaseThreadInitThunk+0x0014)
  000000ce39afffd0: 00007ffecd11cc91 (RtlUserThreadStart+0x0021)
User avatar
No.23387
cuavas
Administrator
12 days ago
It still doesn't reproduce for me on Windows with Intel or NVIDIA or Linux with llvmpipe.
User avatar
No.23388
Robbbert
Moderator
11 days ago
Error occurs on line 309 of src/osd/modules/render/bgfx/chainentry.cpp

Referring to any of the textures.provider(name) elements crashes. Perhaps the structure is null.

name = "screen0"
User avatar
No.23389
Augusto
Tester
11 days ago
@Robbbert
"The procedure from hap is reproducible, and we finally have the elusive dump. Not entirely sure if this is what Augusto is referring to though."
hap are correct with my bug report.
IMO is better hap continue keeping control over that topic issue than me.