flyinghead / flycast

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

Crash on starting game on iOS 18 #1647

Closed yoshisuga closed 1 month ago

yoshisuga commented 1 month ago

Please Note: This form is the minimum required information for submitting bugs.
Removing this form may lead to your issue being closed until it is completed.

Platform / OS / Hardware: iOS / iOS 18.0 / iPhone 16 Pro Max

Github hash: 92555c68c6b2934cc1ad7f8930a443c600782565

Hardware: iPhone 16 Pro Max

Description of the Issue

App crashes when starting a game. Enabled JIT through attaching to debugger on Xcode or running through Xcode. Tried starting the Dreamcast BIOS.

Add a short, concise description of the issue here

Debugging Steps Tested

Logs Gathered

AVAudioSessionClient_Common.mm:424   Error: category option 'defaultToSpeaker' is only applicable with category 'playAndRecord'
AVAudioSessionClient_Common.mm:574   Failed to set properties, error: -50
AVAudioSession.setCategory:  Error Domain=NSOSStatusErrorDomain Code=-50 "(null)"
AVAudioSession.setActive:  Error Domain=NSOSStatusErrorDomain Code=-50 "(null)"
NSBundle file:///System/Library/PrivateFrameworks/MetalTools.framework/ principal class is nil because all fallbacks have failed
wsi/gl_context.cpp:43 I[RENDERER]: OpenGL version: OpenGL ES 3.0 Metal - 101\^[[0m
\^[[92mui/gui.cpp:330 N[RENDERER]: Screen DPI is 480, size 2868 x 1320. Scaling by 3.60\^[[0m
\^[[92mrend/gles/gles.cpp:637 N[RENDERER]: OpenGL ES version 3.0\^[[0m
\^[[92mrend/gles/gles.cpp:638 N[RENDERER]: Vendor 'Apple Inc.' Renderer 'Apple A18 Pro GPU' Version 'OpenGL ES 3.0 Metal - 101'\^[[0m
ui/boxart/boxart.cpp:195 D[COMMON]: Loading boxart database from /var/mobile/Containers/Data/Application/B8C4A575-3B83-44BD-96D7-C1A41E5024F4/Documents//boxart/flycast-gamedb.json\^[[0m
\^[[92mhw/mem/addrspace.cpp:431 N[VMEM]: Info: nvmem is enabled\^[[0m
hw/mem/addrspace.cpp:432 I[VMEM]: Info: p_sh4rcb: 0x10a7e0000 ram_base: 0x1127f0000\^[[0m
\^[[92mhw/mem/addrspace.cpp:467 N[VMEM]: BASE 0x1127f0000 RAM(16 MB) 0x11e7f0000 VRAM64(8 MB) 0x1167f0000 ARAM(2 MB) 0x1327f0000\^[[0m
linux/unwind_info.cpp:370 D[DYNAREC]: UnwindInfo::clear\^[[0m
linux/unwind_info.cpp:363 D[DYNAREC]: RegisterFrame 0x13ef90000 sz 4194176 tables: 1\^[[0m
hw/arm7/arm7.cpp:287 I[AICA_ARM]: AICA ARM Reset\^[[0m
linux/unwind_info.cpp:370 D[DYNAREC]: UnwindInfo::clear\^[[0m
linux/unwind_info.cpp:363 D[DYNAREC]: RegisterFrame 0x13ef90000 sz 4194176 tables: 1\^[[0m
hw/sh4/modules/serial.cpp:137 I[SH4]: SCIF: Frame size 10 cycles/bit 32770 (6103 bauds) pipe 0x0\^[[0m
hw/sh4/dyna/driver.cpp:364 I[DYNAREC]: recSh4 Init\^[[0m
rec-ARM64/rec_arm64.cpp:2189 I[DYNAREC]: Initializing the ARM64 dynarec\^[[0m
linux/unwind_info.cpp:370 D[DYNAREC]: UnwindInfo::clear\^[[0m
linux/unwind_info.cpp:363 D[DYNAREC]: RegisterFrame 0x13f390000 sz 11534208 tables: 1\^[[0m
emulator.cpp:471 I[DYNAREC]: Using Recompiler\^[[0m
emulator.cpp:508 D[BOOT]: Loading game \^[[0m
\^[[92mhw/mem/addrspace.cpp:431 N[VMEM]: Info: nvmem is enabled\^[[0m
hw/mem/addrspace.cpp:432 I[VMEM]: Info: p_sh4rcb: 0x10a7e0000 ram_base: 0x1127f0000\^[[0m
\^[[92mhw/mem/addrspace.cpp:467 N[VMEM]: BASE 0x1127f0000 RAM(16 MB) 0x11e7f0000 VRAM64(8 MB) 0x1167f0000 ARAM(2 MB) 0x1327f0000\^[[0m
hw/arm7/arm7.cpp:287 I[AICA_ARM]: AICA ARM Reset\^[[0m
linux/unwind_info.cpp:370 D[DYNAREC]: UnwindInfo::clear\^[[0m
linux/unwind_info.cpp:363 D[DYNAREC]: RegisterFrame 0x13ef90000 sz 4194176 tables: 1\^[[0m
hw/sh4/interpr/sh4_interpreter.cpp:128 I[INTERPRETER]: Sh4 Reset\^[[0m
hw/sh4/dyna/driver.cpp:95 I[DYNAREC]: recSh4:Dynarec Cache clear at A0000000 free space 10485328\^[[0m
linux/unwind_info.cpp:370 D[DYNAREC]: UnwindInfo::clear\^[[0m
linux/unwind_info.cpp:363 D[DYNAREC]: RegisterFrame 0x13f390000 sz 11534208 tables: 1\^[[0m
hw/sh4/modules/serial.cpp:137 I[SH4]: SCIF: Frame size 10 cycles/bit 32770 (6103 bauds) pipe 0x0\^[[0m
hw/flashrom/flashrom.cpp:61 I[FLASHROM]: Loaded /var/mobile/Containers/Data/Application/B8C4A575-3B83-44BD-96D7-C1A41E5024F4/Documents/dc_nvmem.bin as nvram\^[[0m
hw/flashrom/flashrom.cpp:61 I[FLASHROM]: Loaded /var/mobile/Containers/Data/Application/B8C4A575-3B83-44BD-96D7-C1A41E5024F4/Documents/dc_boot.bin as bootrom\^[[0m
emulator.cpp:907 I[DYNAREC]: Using Recompiler\^[[0m
audio/audiostream.cpp:35 I[AUDIO]: Auto-selected audio backend "coreaudio" (Core Audio).\^[[0m
audio/audiostream.cpp:74 I[AUDIO]: Initializing audio backend "coreaudio" (Core Audio)...\^[[0m
hw/sh4/dyna/driver.cpp:108 I[DYNAREC]: cntx // fpcb offset: -134283264 // pc offset: -184 // pc A0000000\^[[0m

Screenshots

Screenshot 2024-09-26 at 5 36 40 AM
flyinghead commented 1 month ago

Flycast generates lots of SIGSEGV/SIGBUS exceptions but they are handled and do not terminate the process. I found that many debuggers are confused by this and Xcode is no exception. What should work is to start Flycast in debug mode in Xcode, then detach from the process before starting a game. Can you try this?

yoshisuga commented 1 month ago

Ah! It looks like that worked - if I attach to the process, then detach, it works! I didn't know that to get JIT to work, you can attach and then detach.

Thank you!