Open future-figs opened 1 year ago
Somehow forgot about logs...
Not too interesting:
$ diff opengl.log gles.log
120c120
< Matching font: 0x7695320
---
> Matching font: 0x7b78730
213,216d212
< sdl_kill: closing audio
< Sound buffer: overflows=0 underflows=23
< Enter sdlwindow_exit
< Leave sdlwindow_exit
One more interesting detail is that, on the blue info screen and "imperfect emulation" screen, I can hear some horrible sound coming from my PC case. Pretty sure it's GPU coil whine. This only happens in the problem cases, when a segfault is incoming.
I can confirm something is going wrong, even after the latest updates (as of 0b67aa20c703ae7602ade2c0c12790d2eafe167c). It’s reproducible on Windows as well, although it doesn’t manifest as a crash, just a black screen. This is a blocker for making BGFX default. I’ll mention it on #10859.
For some reason, GLES works with these games on Windows, but not Vulkan.
For completeness, I’m testing on Windows 10 Pro 20H2 with consumer GeForce driver version 517.66.
I can confirm I hit an assert on linux with the asan build.
mamed: ../../../../../src/mame/konami/k053246_k053247_k055673.cpp:903: virtual void k055673_device::device_start(): Assertion `!(m_gfxrom.length() & (m_gfxrom.length() - 1))' failed.
zsh: IOT instruction (core dumped) ./mamed sexyparo -video bgfx -bgfx_backend vulkan
I can commented out the assert here is the output. It happens on the opengl and vulkan backend look very simular to the lethaj issue
=================================================================
==73533==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f0695b09810 at pc 0x563c3df9dccc bp 0x7f06abd191f0 sp 0x7f06abd189b0
READ of size 4096 at 0x7f0695b09810 thread T1
#0 0x563c3df9dccb in __interceptor_memcpy.part.0 asan_interceptors.cpp.o
#1 0x7f06a84bb696 (/usr/lib/dri/radeonsi_dri.so+0x174696) (BuildId: 15828f698bc436620bdee5aafafbb8dd3bf93555)
#2 0x7f06a847cd01 (/usr/lib/dri/radeonsi_dri.so+0x135d01) (BuildId: 15828f698bc436620bdee5aafafbb8dd3bf93555)
#3 0x7f06a8481023 (/usr/lib/dri/radeonsi_dri.so+0x13a023) (BuildId: 15828f698bc436620bdee5aafafbb8dd3bf93555)
#4 0x7f06a848951b (/usr/lib/dri/radeonsi_dri.so+0x14251b) (BuildId: 15828f698bc436620bdee5aafafbb8dd3bf93555)
#5 0x563c55c43261 in texSubImage /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bgfx/src/renderer_gl.cpp:1404:4
#6 0x563c55c43261 in bgfx::gl::TextureGL::update(unsigned char, unsigned char, bgfx::Rect const&, unsigned short, unsigned short, unsigned short, bgfx::Memory const*) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bgfx/src/renderer_gl.cpp:6042:4
#7 0x563c55c6b2f3 in bgfx::gl::RendererContextGL::updateTexture(bgfx::TextureHandle, unsigned char, unsigned char, bgfx::Rect const&, unsigned short, unsigned short, unsigned short, bgfx::Memory const*) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bgfx/src/renderer_gl.cpp:3376:28
#8 0x563c55b164be in bgfx::Context::flushTextureUpdateBatch(bgfx::CommandBuffer&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bgfx/src/bgfx.cpp:2578:18
#9 0x563c55b144a3 in bgfx::Context::rendererExecCommands(bgfx::CommandBuffer&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bgfx/src/bgfx.cpp:3365:3
#10 0x563c55b06e30 in bgfx::Context::renderFrame(int) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bgfx/src/bgfx.cpp:2448:5
#11 0x563c55b06b1f in bgfx::renderFrame(int) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bgfx/src/bgfx.cpp:1489:38
#12 0x563c55b3ff69 in bgfx::Context::renderThread(bx::Thread*, void*) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bgfx/src/bgfx_p.h:3148:35
#13 0x563c55dd68cb in entry /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bx/src/thread.cpp:328:20
#14 0x563c55dd68cb in bx::ThreadInternal::threadFunc(void*) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bx/src/thread.cpp:95:20
#15 0x7f06b79eb8fc (/usr/lib/libc.so.6+0x868fc) (BuildId: 768945cdf5e5796c2ab39f38ed160748fd94d12e)
#16 0x7f06b7a6dd1f (/usr/lib/libc.so.6+0x108d1f) (BuildId: 768945cdf5e5796c2ab39f38ed160748fd94d12e)
0x7f0695b09810 is located 0 bytes to the right of 344080-byte region [0x7f0695ab5800,0x7f0695b09810)
allocated by thread T0 here:
#0 0x563c3dfb6a79 in __interceptor_malloc (/home/misty/Source/mame/mamed+0xc15aa79) (BuildId: 88412cc1020e2904572125e0ce81f9d84c188bf4)
#1 0x563c55b64f2d in bgfx::AllocatorStub::realloc(void*, unsigned long, unsigned long, char const*, unsigned int) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bgfx/src/bgfx.cpp:220:13
#2 0x563c55b1cd36 in alloc /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bx/include/bx/inline/allocator.inl:37:22
#3 0x563c55b1cd36 in alloc /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bgfx/src/bgfx.cpp:4068:26
#4 0x563c55b1cd36 in bgfx::copy(void const*, unsigned int) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bgfx/src/bgfx.cpp:4077:23
#5 0x563c53d1f385 in bgfx_util::mame_texture_data_to_bgfx_texture_data(bgfx::TextureFormat::Enum&, unsigned int, int, int, int, rgb_t const*, void*, unsigned short&, int&, int&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/modules/render/bgfxutil.cpp
#6 0x563c53cb2d1a in chain_manager::update_screen_textures(unsigned int, render_primitive*, osd_window&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/modules/render/bgfx/chainmanager.cpp:560:29
#7 0x563c53b602cc in renderer_bgfx::draw(int) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/modules/render/drawbgfx.cpp:1154:35
#8 0x563c53c1e1e0 in sdl_window_info::update() /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/window.cpp:538:17
#9 0x563c53c181c3 in sdl_osd_interface::update(bool) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/video.cpp:104:12
#10 0x563c53a1638b in video_manager::frame_update(bool) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/video.cpp:242:18
#11 0x563c5393f8da in screen_device::vblank_end(int) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/screen.cpp:1679:21
#12 0x563c5392e62a in operator() /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
#13 0x563c5392e62a in device_scheduler::execute_timers() /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:951:5
#14 0x563c53928836 in device_scheduler::timeslice() /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:505:2
#15 0x563c537e839b in running_machine::run(bool) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:330:17
#16 0x563c55deaf0b in mame_machine_manager::execute() /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:287:19
#17 0x563c55faa355 in 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&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/clifront.cpp:277:22
#18 0x563c55fadbf9 in 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>>>>&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/clifront.cpp:293:3
#19 0x563c55dee590 in 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>>>>&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:454:18
#20 0x563c53b1a7f5 in main /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:100:9
#21 0x7f06b798828f (/usr/lib/libc.so.6+0x2328f) (BuildId: 768945cdf5e5796c2ab39f38ed160748fd94d12e)
Thread T1 created by T0 here:
#0 0x563c3df283f8 in __interceptor_pthread_create (/home/misty/Source/mame/mamed+0xc0cc3f8) (BuildId: 88412cc1020e2904572125e0ce81f9d84c188bf4)
#1 0x563c55dd733e in bx::Thread::init(int (*)(bx::Thread*, void*), void*, unsigned int, char const*) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bx/src/thread.cpp:184:12
#2 0x563c55b0806d in bgfx::Context::init(bgfx::Init const&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bgfx/src/bgfx.cpp:1934:13
#3 0x563c55b178c7 in bgfx::init(bgfx::Init const&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../3rdparty/bgfx/src/bgfx.cpp:3554:14
#4 0x563c53b689f4 in init_bgfx_library /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/modules/render/drawbgfx.cpp:364:7
#5 0x563c53b689f4 in osd::(anonymous namespace)::video_bgfx::create(osd_window&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/modules/render/drawbgfx.cpp:272:8
#6 0x563c53b69471 in non-virtual thunk to osd::(anonymous namespace)::video_bgfx::create(osd_window&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/modules/render/drawbgfx.cpp
#7 0x563c53ca14e6 in osd_window::renderer_create() /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/modules/osdwindow.cpp:119:32
#8 0x563c53c1b48f in sdl_window_info::complete_create() /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/window.cpp:704:2
#9 0x563c53c1cab4 in sdl_window_info::window_init() /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/window.cpp:356:15
#10 0x563c53c17125 in sdl_osd_interface::video_init() /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/video.cpp:70:12
#11 0x563c53b1f462 in osd_common_t::init_subsystems() /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/modules/lib/osdobj_common.cpp:625:7
#12 0x563c53c0f226 in sdl_osd_interface::init(running_machine&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/osdsdl.cpp:279:16
#13 0x563c537e3d54 in running_machine::start() /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:152:18
#14 0x563c537e7b1a in running_machine::run(bool) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:282:3
#15 0x563c55deaf0b in mame_machine_manager::execute() /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:287:19
#16 0x563c55faa355 in 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&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/clifront.cpp:277:22
#17 0x563c55fadbf9 in 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>>>>&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/clifront.cpp:293:3
#18 0x563c55dee590 in 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>>>>&) /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:454:18
#19 0x563c53b1a7f5 in main /home/misty/Source/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:100:9
#20 0x7f06b798828f (/usr/lib/libc.so.6+0x2328f) (BuildId: 768945cdf5e5796c2ab39f38ed160748fd94d12e)
SUMMARY: AddressSanitizer: heap-buffer-overflow asan_interceptors.cpp.o in __interceptor_memcpy.part.0
Shadow bytes around the buggy address:
0x0fe152b592b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe152b592c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe152b592d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe152b592e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe152b592f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fe152b59300: 00 00[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0fe152b59310: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0fe152b59320: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0fe152b59330: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0fe152b59340: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0fe152b59350: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==73533==ABORTING
~/Source/mame master *1 !2 1 ✘ 8s
Thanks for the ASAN report, that should make it easy enough for me to track down on Windows.
I do find it odd that it might be nothing but i started this with backend vulkan and its referencing gl calls
It's almost as if both Vulkan and OpenGL are both managed by Khronos Group. Just let me handle it.
Testing again with MAME 0.254, these titles now all work by default. Using -video bgfx -bgfx_backend vulkan
or -video bgfx -bgfx_backend gles
still cause a crash as originally described. Maybe -video bgfx -bgfx_backend opengl
is being automatically selected now?
MAME version
0.251 8df400b6b9d05fc12644e2314bceb86aaf5792ce
System information
Fedora 36, x86-64, 16GB RAM, RTX 2080Ti, nvidia proprietary driver 525.60.11
Built with all symbols for debug purposes:
make VERBOSE=1 REGENIE=1 SYMBOLS=1 SYMLEVEL=3 OPTIMIZE=0 SOURCES=src/mame/konami/konamigx.cpp,src/mame/sony/taitogn.cpp -j16
But issue also presents with a standard build, i.e.
make -j16
. Issue observed in GroovyMAME 0.251 as well.INI configuration details
Emulated system/software
crzcross daiskiss le2 salmndr2 sexyparo soccerss tbyahhoo tkmmpzdm vsnetscr
Incorrect behaviour
The default video backend settings work fine for all systems I've tried, except the Konami GX system. After the "imperfect emulation" warning, there is a black screen for a couple seconds followed by a segfault on about half of the software titles.
More than half the software titles for the Konami GX system do not work. After the "imperfect emulation" popup, there is a black screen for a couple seconds followed by a segfault on about half of the software titles.
Affected:
Not affected:
The following video backend settings reproduce this issue on my machine:
-video bgfx -bgfx_backend vulkan
-video bgfx -bgfx_backend gles
auto
inmame.ini
for both settings)And the following settings resolve the issue:
-video none
-video soft
-video accel
-video opengl
-video bgfx -bgfx_backend opengl
I haven't seen issues like this outside of the konamigx system.
Expected behaviour
Segfaults should not occur. Vulkan and GLES should work normally, given that they are supported on my machine.
Steps to reproduce
Fresh install of MAME from git.
mame.ini
is completely default from./mame -createconfig
, except for the removal of$HOME/.mame/
frominipath
.Either load software from commandline or select from UI.
Additional details
Backtraces: