flyinghead / flycast

Flycast is a multiplatform Sega Dreamcast, Naomi, Naomi 2 and Atomiswave emulator
GNU General Public License v2.0
1.36k stars 167 forks source link

[FreeBSD] crashed with dynarec #1401

Closed Aminavy closed 6 months ago

Aminavy commented 6 months ago

PC / FreeBSD / x86_64:

I fetched master branch yesterday Version: v2.2-169-g44fa364f3 Git Hash: 44fa364f3

Hardware: x86_64 with FreeBSD

When CPU Mode is set to dynarec games crashed on startup. but in interpreter mode works (but very slow) in the past (few months ago i tested) its works fine and fast

The terminal output:


% flycast
00:00:394 sdl/sdl.cpp:695 N[RENDERER]: Monitor refresh rate: 60 Hz (1366 x 768)
00:00:405 rend/vulkan/vulkan_context.cpp:237 N[RENDERER]: Vulkan API 1.1. Device AMD Radeon Vega 3 Graphics (RADV RAVEN2)
00:00:465 rend/vulkan/vulkan_context.h:269 N[RENDERER]: Using depth format D32SfloatS8Uint tiling Optimal
00:00:478 rend/gui.cpp:304 N[RENDERER]: Screen DPI is 136, size 706 x 531. Scaling by 1.02
00:00:483 rend/vulkan/vulkan_renderer.cpp:30 N[RENDERER]: VulkanRenderer::Init
00:16:139 hw/mem/addrspace.cpp:431 N[VMEM]: Info: nvmem is enabled
00:16:170 hw/mem/addrspace.cpp:467 N[VMEM]: BASE 0x8543d0000 RAM(16 MB) 0x8603d0000 VRAM64(8 MB) 0x8583d0000 ARAM(2 MB) 0x8743d0000
00:16:197 hw/mem/addrspace.cpp:431 N[VMEM]: Info: nvmem is enabled
00:16:226 hw/mem/addrspace.cpp:467 N[VMEM]: BASE 0x8543d0000 RAM(16 MB) 0x8603d0000 VRAM64(8 MB) 0x8583d0000 ARAM(2 MB) 0x8743d0000
00:16:244 emulator.cpp:55 N[BOOT]: Game ID is [MK-51028]
00:16:251 emulator.cpp:55 N[BOOT]: Game ID is [MK-51028]
Segmentation fault (core dumped)
flyinghead commented 6 months ago

It would be helpful to find out at which commit this problem started to happen. Also, can you debug flycast with gdb and post the stacktrace when it crashes?

Message ID: @.***>

Aminavy commented 6 months ago

Currently I haven't gdb The core file backtrace with lldb: core_file_backtrace.txt

Sorry I compiled flycast without debug symbols! the running in lldb: run_in_lldb.txt

flyinghead commented 6 months ago

According to this information, thread #9 is crashing, which is the SDL2 audio thread. Can you try to use a different audio driver (or even the null audio driver to see if it fixes the crash)? Also can you upgrade your local libSDL2.so?

Recompiling with symbols would be nice if we need to investigate further (cmake build type RelWithDebInfo)

Aminavy commented 6 months ago

with other audio drivers still crashing! with debug_info ,GDB and null audio driver:

debug_output.txt

flyinghead commented 6 months ago

For some reason, these important messages were missing from the log you first posted:

00:37:441 rec-x64/rec_x64.cpp:799 E[DYNAREC]: rewriteMemAccess code not found: host pc 0xe7d162
00:37:441 rend/gui.cpp:3329 E[COMMON]: Fatal error : Failed to match the code
 in rewriteMemAccess -> /home/aminavy/Downloads/flycast/core/rec-x64/rec_x64.cpp : 800

Now I don't know why this is happening, or why it wasn't happening before. I will need to build a freebsd virtual machine and debug it. This is going to take a while.

flyinghead commented 6 months ago

Should be fixed on the dev branch