flyinghead / flycast

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

Vulkan: Load custom textures crashes on M1 #414

Open dvessel opened 2 years ago

dvessel commented 2 years ago

Platform / OS / Hardware: MacOS Monterey 12.01 / M1 Max MacBook Pro.

Github hash: net-rollback, 33fd8a.

Hardware: See the bottom of the crash log.

Description of the Issue

Loading custom textures with the Vulkan renderer will crash on the M1. Tested with Soul Calibur. Crashes on character select.

And thank you Flyinghead for adding Vulkan!

Debugging Steps Tested

Logs Gathered

Flycast Log:
2021-11-22 19:29:59.869 Flycast[35207:574204] linux/common.cpp:70 E[COMMON]: SIGSEGV @ 0x10783f97c -> 0x9 was not in vram, dynacode:0
2021-11-22 19:29:59.869 Flycast[35207:574204] rend/gui.cpp:2529 E[COMMON]: Fatal error : segfault
 in fault_handler -> /Users/runner/work/flycast/flycast/core/linux/common.cpp : 81

Crash Dump:
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               Flycast [35207]
Path:                  /Applications/Flycast.app/Contents/MacOS/Flycast
Identifier:            com.flyinghead.Flycast
Version:               1.0 (1)
Code Type:             ARM-64 (Native)
Parent Process:        Exited process [35189]
Responsible:           iTerm2 [15066]
User ID:               501

Date/Time:             2021-11-22 19:29:59.8949 -0500
OS Version:            macOS 12.0.1 (21A559)
Report Version:        12
Anonymous UUID:        5DD1FCF7-5081-E6B6-D95F-02D45F723684

Sleep/Wake UUID:       094C3D7D-9C57-40A7-AEA9-0729E5EEE1C0

Time Awake Since Boot: 58000 seconds
Time Since Wake:       4599 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000001, 0x00000001012c85cc
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process:   exc handler [35207]

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   Flycast                                0x1012c85cc 0x100cdc000 + 6211020
1   Flycast                                0x1012c85cc 0x100cdc000 + 6211020
2   Flycast                                0x100eaa9fc fault_handler(int, __siginfo*, void*) + 388
3   libsystem_platform.dylib               0x19dcb84e4 _sigtramp + 56
4   libvulkan.dylib                        0x107840d74 MVKImage::applyImageMemoryBarrier(unsigned int, unsigned int, MVKPipelineBarrier&, MVKCommandEncoder*, MVKCommandUse) + 96
5   libvulkan.dylib                        0x107840d74 MVKImage::applyImageMemoryBarrier(unsigned int, unsigned int, MVKPipelineBarrier&, MVKCommandEncoder*, MVKCommandUse) + 96
6   libvulkan.dylib                        0x1078b8fe8 MVKCmdPipelineBarrier<1ul>::encode(MVKCommandEncoder*) + 724
7   libvulkan.dylib                        0x1078577a4 MVKCommandEncoder::encode(id<MTLCommandBuffer>, MVKCommandEncodingContext*) + 144
8   libvulkan.dylib                        0x107857640 MVKCommandBuffer::submit(MVKQueueCommandBufferSubmission*, MVKCommandEncodingContext*) + 244
9   libvulkan.dylib                        0x107896dd8 MVKQueueFullCommandBufferSubmission<16ul>::submitCommandBuffers() + 60
10  libvulkan.dylib                        0x10789524c MVKQueueCommandBufferSubmission::execute() + 200
11  libvulkan.dylib                        0x107894010 MVKQueue::submit(unsigned int, VkSubmitInfo const*, VkFence_T*, MVKCommandUse) + 272
12  libvulkan.dylib                        0x107816e3c vkQueueSubmit + 264
13  Flycast                                0x100f3a604 0x100cdc000 + 2483716
14  Flycast                                0x100f320e4 0x100cdc000 + 2449636
15  Flycast                                0x100f37a3c ScreenDrawer::EndRenderPass() + 72
16  Flycast                                0x100fbc678 0x100cdc000 + 3016312
17  Flycast                                0x100e5e8e4 rend_single_frame(bool const&) + 1032
18  Flycast                                0x100e5ecd8 rend_start_render() + 280
19  ???                                    0x1210dcbc0 ???
20  ???                                  0xb9d72b1847d ???

Thread 1:
0   libsystem_pthread.dylib                0x19dc9c2bc start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib                0x19dc9c2bc start_wqthread + 0

Thread 3:
0   libsystem_pthread.dylib                0x19dc9c2bc start_wqthread + 0

Thread 4:: com.apple.NSEventThread
0   libsystem_kernel.dylib                 0x19dc65954 mach_msg_trap + 8
1   libsystem_kernel.dylib                 0x19dc65d00 mach_msg + 76
2   CoreFoundation                         0x19dd6ce38 __CFRunLoopServiceMachPort + 372
3   CoreFoundation                         0x19dd6b2f0 __CFRunLoopRun + 1212
4   CoreFoundation                         0x19dd6a694 CFRunLoopRunSpecific + 600
5   AppKit                                 0x1a0a2cc24 _NSEventThread + 196
6   libsystem_pthread.dylib                0x19dca14ec _pthread_start + 148
7   libsystem_pthread.dylib                0x19dc9c2d0 thread_start + 8

Thread 5:
0   libsystem_pthread.dylib                0x19dc9c2bc start_wqthread + 0

Thread 6:: AMCP Logging Spool
0   libsystem_kernel.dylib                 0x19dc65990 semaphore_wait_trap + 8
1   caulk                                  0x1a66558ac caulk::mach::semaphore::wait_or_error() + 28
2   caulk                                  0x1a663865c caulk::concurrent::details::worker_thread::run() + 56
3   caulk                                  0x1a663827c void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*> > >(void*) + 96
4   libsystem_pthread.dylib                0x19dca14ec _pthread_start + 148
5   libsystem_pthread.dylib                0x19dc9c2d0 thread_start + 8

Thread 7:: com.apple.audio.IOThread.client
0   libsystem_kernel.dylib                 0x19dc65954 mach_msg_trap + 8
1   libsystem_kernel.dylib                 0x19dc65d00 mach_msg + 76
2   CoreAudio                              0x19f9aa518 HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int) + 104
3   CoreAudio                              0x19f8399ac HALC_ProxyIOContext::IOWorkLoop() + 3360
4   CoreAudio                              0x19f838688 invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) + 100
5   CoreAudio                              0x19fa0386c HALB_IOThread::Entry(void*) + 88
6   libsystem_pthread.dylib                0x19dca14ec _pthread_start + 148
7   libsystem_pthread.dylib                0x19dc9c2d0 thread_start + 8

Thread 8:
0   Flycast                                0x100ede288 0x100cdc000 + 2105992
1   Flycast                                0x100ede570 0x100cdc000 + 2106736
2   Flycast                                0x100ef1154 0x100cdc000 + 2183508
3   Flycast                                0x100ee5bec 0x100cdc000 + 2137068
4   Flycast                                0x100edc790 0x100cdc000 + 2099088
5   Flycast                                0x100ee4488 CustomTexture::LoadCustomTexture(unsigned int, int&, int&) + 364
6   Flycast                                0x100ee3c8c CustomTexture::LoaderThread() + 176
7   Flycast                                0x100ef55c4 CustomTexture::loader_thread_func(void*) + 12
8   Flycast                                0x100fcb118 0x100cdc000 + 3076376
9   libsystem_pthread.dylib                0x19dca14ec _pthread_start + 148
10  libsystem_pthread.dylib                0x19dc9c2d0 thread_start + 8

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000001   x1: 0xfffffefd3fb2296f   x2: 0xfffffefd3fb2296f   x3: 0x0000000fffffc088
    x4: 0xffffa0016e010fe8   x5: 0x0000000000000010   x6: 0x0000000000000069   x7: 0x000000016f11e2b8
    x8: 0x21d4b683a222009d   x9: 0x21d4b683a222009d  x10: 0x0000000000000000  x11: 0x0000000000000002
   x12: 0x00000000016e3600  x13: 0x0000000000009ac0  x14: 0x000000005f000000  x15: 0x0000000000002000
   x16: 0x000000019dc9bf98  x17: 0x00000001f8083f48  x18: 0x0000000128013940  x19: 0x000000016f11ebf8
   x20: 0x000000016f11eb90  x21: 0x000000000000000b  x22: 0x0000000000000000  x23: 0x0000000000000000
   x24: 0x0000000122f684a0  x25: 0x0000000000000000  x26: 0x0000000000000001  x27: 0x0000000107c60528
   x28: 0x0000000000000000   fp: 0x000000016f11eb00   lr: 0x00000001012c85cc
    sp: 0x000000016f11eae0   pc: 0x00000001012c85cc cpsr: 0x60000000
   far: 0x0000000000000009  esr: 0xf2000001 (Breakpoint) brk 1

Binary Images:
       0x100cdc000 -        0x1013d7fff com.flyinghead.Flycast (1.0) <26659282-beed-3ab3-b13d-2b3c77bce427> /Applications/Flycast.app/Contents/MacOS/Flycast
       0x19dcb4000 -        0x19dcbbfff libsystem_platform.dylib (*) <06ce953d-f22a-3724-b6d5-829b45179897> /usr/lib/system/libsystem_platform.dylib
       0x107800000 -        0x107c57fff libvulkan.dylib (*) <928c192a-8ac7-381e-9cd4-8eaeca6908cd> /Applications/Flycast.app/Contents/Frameworks/libvulkan.dylib
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
       0x19dc9a000 -        0x19dca6fff libsystem_pthread.dylib (*) <4786e19a-9312-38e6-80ef-9c1394548118> /usr/lib/system/libsystem_pthread.dylib
       0x19dc64000 -        0x19dc99fff libsystem_kernel.dylib (*) <c8524c02-b14f-30bd-a228-c44b4a448e68> /usr/lib/system/libsystem_kernel.dylib
       0x19dce8000 -        0x19e22bfff com.apple.CoreFoundation (6.9) <b2ff96d0-ae99-31ef-9014-fc9964b4f3e0> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
       0x1a087e000 -        0x1a172ffff com.apple.AppKit (6.9) <518f4e68-c324-320f-9d7f-85c224eae972> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
       0x1a6636000 -        0x1a665dfff com.apple.audio.caulk (1.0) <c8b77e54-af14-37e1-8a72-6437f54c6fd1> /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk
       0x19f671000 -        0x19fd9dfff com.apple.audio.CoreAudio (5.0) <fe0ecef8-4ac8-37a2-aefb-255af920e2ef> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 1
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=846.3M resident=0K(0%) swapped_out_or_unallocated=846.3M(100%)
Writable regions: Total=1.6G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.6G(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Accelerate framework               256K        2 
Activity Tracing                   256K        1 
CG backing stores                 5568K        4 
CG image                            96K        3 
ColorSync                          512K       25 
CoreAnimation                      160K        9 
CoreGraphics                        16K        1 
CoreUI image data                  928K        7 
Foundation                          16K        1 
Kernel Alloc Once                   32K        1 
MALLOC                           401.4M       69 
MALLOC guard page                  192K       10 
MALLOC_MEDIUM (reserved)         768.0M        7         reserved VM address space (unallocated)
MALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)
STACK GUARD                       56.1M        9 
Stack                             12.2M        9 
VM_ALLOCATE                        3.7G      273 
__AUTH                            1919K      189 
__AUTH_CONST                      11.4M      348 
__DATA                            33.6M      339 
__DATA_CONST                      11.9M      353 
__DATA_DIRTY                       737K      121 
__FONT_DATA                          4K        1 
__LINKEDIT                       573.4M        7 
__OBJC_CONST                      1620K      157 
__OBJC_RO                         81.8M        1 
__OBJC_RW                         3088K        1 
__TEXT                           272.9M      369 
__UNICODE                          588K        1 
dyld private memory               1024K        1 
mapped file                      604.6M      229 
shared memory                      992K       19 
===========                     =======  ======= 
TOTAL                              6.9G     2568 
TOTAL, minus reserved VM space     5.7G     2568 

-----------
Full Report
-----------

{"app_name":"Flycast","timestamp":"2021-11-22 19:29:59.00 -0500","app_version":"1.0","slice_uuid":"26659282-beed-3ab3-b13d-2b3c77bce427","build_version":"1","platform":1,"bundleID":"com.flyinghead.Flycast","share_with_app_devs":1,"is_first_party":0,"bug_type":"309","os_version":"macOS 12.0.1 (21A559)","incident_id":"D8F3A198-E273-4FCD-ACB7-881991BD87ED","name":"Flycast"}
{
  "uptime" : 58000,
  "procLaunch" : "2021-11-22 19:29:32.5863 -0500",
  "procRole" : "Foreground",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "MacBookPro18,2",
  "procStartAbsTime" : 1412727531184,
  "coalitionID" : 1017,
  "osVersion" : {
    "train" : "macOS 12.0.1",
    "build" : "21A559",
    "releaseType" : "User"
  },
  "captureTime" : "2021-11-22 19:29:59.8949 -0500",
  "incident" : "D8F3A198-E273-4FCD-ACB7-881991BD87ED",
  "bug_type" : "309",
  "pid" : 35207,
  "procExitAbsTime" : 1413382353533,
  "translated" : false,
  "cpuType" : "ARM-64",
  "procName" : "Flycast",
  "procPath" : "\/Applications\/Flycast.app\/Contents\/MacOS\/Flycast",
  "bundleInfo" : {"CFBundleShortVersionString":"1.0","CFBundleVersion":"1","CFBundleIdentifier":"com.flyinghead.Flycast"},
  "storeInfo" : {"deviceIdentifierForVendor":"6EF6CCEE-DC6F-57A3-AC10-9005FD293873","thirdParty":true},
  "parentProc" : "Exited process",
  "parentPid" : 35189,
  "coalitionName" : "com.googlecode.iterm2",
  "crashReporterKey" : "5DD1FCF7-5081-E6B6-D95F-02D45F723684",
  "responsiblePid" : 15066,
  "responsibleProc" : "iTerm2",
  "wakeTime" : 4599,
  "sleepWakeUUID" : "094C3D7D-9C57-40A7-AEA9-0729E5EEE1C0",
  "sip" : "enabled",
  "isCorpse" : 1,
  "exception" : {"codes":"0x0000000000000001, 0x00000001012c85cc","rawCodes":[1,4314662348],"type":"EXC_BREAKPOINT","signal":"SIGTRAP"},
  "termination" : {"flags":0,"code":5,"namespace":"SIGNAL","indicator":"Trace\/BPT trap: 5","byProc":"exc handler","byPid":35207},
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":1},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":574204,"threadState":{"x":[{"value":1},{"value":18446742962381662575},{"value":18446742962381662575},{"value":68719460488},{"value":18446638526733815784},{"value":16},{"value":105},{"value":6158410424},{"value":2437773974791389341},{"value":2437773974791389341},{"value":0},{"value":2},{"value":24000000},{"value":39616},{"value":1593835520},{"value":8192},{"value":6942211992,"symbolLocation":0,"symbol":"pthread_mutex_unlock"},{"value":8456257352},{"value":4966136128},{"value":6158412792},{"value":6158412688},{"value":11},{"value":0},{"value":0},{"value":4881548448},{"value":0},{"value":1},{"value":4425385256,"symbolLocation":0,"symbol":"__block_descriptor_40_e5_v8\u0001?0l"},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":4314662348},"cpsr":{"value":1610612736},"fp":{"value":6158412544},"sp":{"value":6158412512},"esr":{"value":4060086273,"description":"(Breakpoint) brk 1"},"pc":{"value":4314662348,"matchesCrashFrame":1},"far":{"value":9}},"queue":"com.apple.main-thread","frames":[{"imageOffset":6211020,"imageIndex":0},{"imageOffset":6211020,"imageIndex":0},{"imageOffset":1894908,"symbol":"fault_handler(int, __siginfo*, void*)","symbolLocation":388,"imageIndex":0},{"imageOffset":17636,"symbol":"_sigtramp","symbolLocation":56,"imageIndex":1},{"imageOffset":265588,"symbol":"MVKImage::applyImageMemoryBarrier(unsigned int, unsigned int, MVKPipelineBarrier&, MVKCommandEncoder*, MVKCommandUse)","symbolLocation":96,"imageIndex":2},{"imageOffset":265588,"symbol":"MVKImage::applyImageMemoryBarrier(unsigned int, unsigned int, MVKPipelineBarrier&, MVKCommandEncoder*, MVKCommandUse)","symbolLocation":96,"imageIndex":2},{"imageOffset":757736,"symbol":"MVKCmdPipelineBarrier<1ul>::encode(MVKCommandEncoder*)","symbolLocation":724,"imageIndex":2},{"imageOffset":358308,"symbol":"MVKCommandEncoder::encode(id<MTLCommandBuffer>, MVKCommandEncodingContext*)","symbolLocation":144,"imageIndex":2},{"imageOffset":357952,"symbol":"MVKCommandBuffer::submit(MVKQueueCommandBufferSubmission*, MVKCommandEncodingContext*)","symbolLocation":244,"imageIndex":2},{"imageOffset":617944,"symbol":"MVKQueueFullCommandBufferSubmission<16ul>::submitCommandBuffers()","symbolLocation":60,"imageIndex":2},{"imageOffset":610892,"symbol":"MVKQueueCommandBufferSubmission::execute()","symbolLocation":200,"imageIndex":2},{"imageOffset":606224,"symbol":"MVKQueue::submit(unsigned int, VkSubmitInfo const*, VkFence_T*, MVKCommandUse)","symbolLocation":272,"imageIndex":2},{"imageOffset":93756,"symbol":"vkQueueSubmit","symbolLocation":264,"imageIndex":2},{"imageOffset":2483716,"imageIndex":0},{"imageOffset":2449636,"imageIndex":0},{"imageOffset":2472508,"symbol":"ScreenDrawer::EndRenderPass()","symbolLocation":72,"imageIndex":0},{"imageOffset":3016312,"imageIndex":0},{"imageOffset":1583332,"symbol":"rend_single_frame(bool const&)","symbolLocation":1032,"imageIndex":0},{"imageOffset":1584344,"symbol":"rend_start_render()","symbolLocation":280,"imageIndex":0},{"imageOffset":4849519552,"imageIndex":3},{"imageOffset":12770862007421,"imageIndex":3}]},{"id":574205,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":4}]},{"id":574206,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":4}]},{"id":574217,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":4}]},{"id":574244,"name":"com.apple.NSEventThread","frames":[{"imageOffset":6484,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":5},{"imageOffset":7424,"symbol":"mach_msg","symbolLocation":76,"imageIndex":5},{"imageOffset":544312,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":372,"imageIndex":6},{"imageOffset":537328,"symbol":"__CFRunLoopRun","symbolLocation":1212,"imageIndex":6},{"imageOffset":534164,"symbol":"CFRunLoopRunSpecific","symbolLocation":600,"imageIndex":6},{"imageOffset":1764388,"symbol":"_NSEventThread","symbolLocation":196,"imageIndex":7},{"imageOffset":29932,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":4},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":4}]},{"id":574245,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":4}]},{"id":574248,"name":"AMCP Logging Spool","frames":[{"imageOffset":6544,"symbol":"semaphore_wait_trap","symbolLocation":8,"imageIndex":5},{"imageOffset":129196,"symbol":"caulk::mach::semaphore::wait_or_error()","symbolLocation":28,"imageIndex":8},{"imageOffset":9820,"symbol":"caulk::concurrent::details::worker_thread::run()","symbolLocation":56,"imageIndex":8},{"imageOffset":8828,"symbol":"void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*> > >(void*)","symbolLocation":96,"imageIndex":8},{"imageOffset":29932,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":4},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":4}]},{"id":574262,"name":"com.apple.audio.IOThread.client","frames":[{"imageOffset":6484,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":5},{"imageOffset":7424,"symbol":"mach_msg","symbolLocation":76,"imageIndex":5},{"imageOffset":3380504,"symbol":"HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int)","symbolLocation":104,"imageIndex":9},{"imageOffset":1870252,"symbol":"HALC_ProxyIOContext::IOWorkLoop()","symbolLocation":3360,"imageIndex":9},{"imageOffset":1865352,"symbol":"invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int)","symbolLocation":100,"imageIndex":9},{"imageOffset":3745900,"symbol":"HALB_IOThread::Entry(void*)","symbolLocation":88,"imageIndex":9},{"imageOffset":29932,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":4},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":4}]},{"id":574277,"frames":[{"imageOffset":2105992,"imageIndex":0},{"imageOffset":2106736,"imageIndex":0},{"imageOffset":2183508,"imageIndex":0},{"imageOffset":2137068,"imageIndex":0},{"imageOffset":2099088,"imageIndex":0},{"imageOffset":2131080,"symbol":"CustomTexture::LoadCustomTexture(unsigned int, int&, int&)","symbolLocation":364,"imageIndex":0},{"imageOffset":2129036,"symbol":"CustomTexture::LoaderThread()","symbolLocation":176,"imageIndex":0},{"imageOffset":2201028,"symbol":"CustomTexture::loader_thread_func(void*)","symbolLocation":12,"imageIndex":0},{"imageOffset":3076376,"imageIndex":0},{"imageOffset":29932,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":4},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":4}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4308451328,
    "CFBundleShortVersionString" : "1.0",
    "CFBundleIdentifier" : "com.flyinghead.Flycast",
    "size" : 7323648,
    "uuid" : "26659282-beed-3ab3-b13d-2b3c77bce427",
    "path" : "\/Applications\/Flycast.app\/Contents\/MacOS\/Flycast",
    "name" : "Flycast",
    "CFBundleVersion" : "1"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6942310400,
    "size" : 32768,
    "uuid" : "06ce953d-f22a-3724-b6d5-829b45179897",
    "path" : "\/usr\/lib\/system\/libsystem_platform.dylib",
    "name" : "libsystem_platform.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4420796416,
    "size" : 4554752,
    "uuid" : "928c192a-8ac7-381e-9cd4-8eaeca6908cd",
    "path" : "\/Applications\/Flycast.app\/Contents\/Frameworks\/libvulkan.dylib",
    "name" : "libvulkan.dylib"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6942203904,
    "size" : 53248,
    "uuid" : "4786e19a-9312-38e6-80ef-9c1394548118",
    "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib",
    "name" : "libsystem_pthread.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6941982720,
    "size" : 221184,
    "uuid" : "c8524c02-b14f-30bd-a228-c44b4a448e68",
    "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib",
    "name" : "libsystem_kernel.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6942523392,
    "CFBundleShortVersionString" : "6.9",
    "CFBundleIdentifier" : "com.apple.CoreFoundation",
    "size" : 5521408,
    "uuid" : "b2ff96d0-ae99-31ef-9014-fc9964b4f3e0",
    "path" : "\/System\/Library\/Frameworks\/CoreFoundation.framework\/Versions\/A\/CoreFoundation",
    "name" : "CoreFoundation",
    "CFBundleVersion" : "1855.105"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6988226560,
    "CFBundleShortVersionString" : "6.9",
    "CFBundleIdentifier" : "com.apple.AppKit",
    "size" : 15409152,
    "uuid" : "518f4e68-c324-320f-9d7f-85c224eae972",
    "path" : "\/System\/Library\/Frameworks\/AppKit.framework\/Versions\/C\/AppKit",
    "name" : "AppKit",
    "CFBundleVersion" : "2113"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 7086497792,
    "CFBundleShortVersionString" : "1.0",
    "CFBundleIdentifier" : "com.apple.audio.caulk",
    "size" : 163840,
    "uuid" : "c8b77e54-af14-37e1-8a72-6437f54c6fd1",
    "path" : "\/System\/Library\/PrivateFrameworks\/caulk.framework\/Versions\/A\/caulk",
    "name" : "caulk"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6969298944,
    "CFBundleShortVersionString" : "5.0",
    "CFBundleIdentifier" : "com.apple.audio.CoreAudio",
    "size" : 7524352,
    "uuid" : "fe0ecef8-4ac8-37a2-aefb-255af920e2ef",
    "path" : "\/System\/Library\/Frameworks\/CoreAudio.framework\/Versions\/A\/CoreAudio",
    "name" : "CoreAudio",
    "CFBundleVersion" : "5.0"
  }
],
  "sharedCache" : {
  "base" : 6939033600,
  "size" : 3072180224,
  "uuid" : "a6162d66-93e3-3251-93cc-b11f7c8c830e"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=846.3M resident=0K(0%) swapped_out_or_unallocated=846.3M(100%)\nWritable regions: Total=1.6G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.6G(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nAccelerate framework               256K        2 \nActivity Tracing                   256K        1 \nCG backing stores                 5568K        4 \nCG image                            96K        3 \nColorSync                          512K       25 \nCoreAnimation                      160K        9 \nCoreGraphics                        16K        1 \nCoreUI image data                  928K        7 \nFoundation                          16K        1 \nKernel Alloc Once                   32K        1 \nMALLOC                           401.4M       69 \nMALLOC guard page                  192K       10 \nMALLOC_MEDIUM (reserved)         768.0M        7         reserved VM address space (unallocated)\nMALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)\nSTACK GUARD                       56.1M        9 \nStack                             12.2M        9 \nVM_ALLOCATE                        3.7G      273 \n__AUTH                            1919K      189 \n__AUTH_CONST                      11.4M      348 \n__DATA                            33.6M      339 \n__DATA_CONST                      11.9M      353 \n__DATA_DIRTY                       737K      121 \n__FONT_DATA                          4K        1 \n__LINKEDIT                       573.4M        7 \n__OBJC_CONST                      1620K      157 \n__OBJC_RO                         81.8M        1 \n__OBJC_RW                         3088K        1 \n__TEXT                           272.9M      369 \n__UNICODE                          588K        1 \ndyld private memory               1024K        1 \nmapped file                      604.6M      229 \nshared memory                      992K       19 \n===========                     =======  ======= \nTOTAL                              6.9G     2568 \nTOTAL, minus reserved VM space     5.7G     2568 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "queue" : "com.apple.main-thread"
  }
},
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "60356660bbe37970735c5624",
      "factorPackIds" : {

      },
      "deploymentId" : 250000016
    },
    {
      "rolloutId" : "601d9415f79519000ccd4b69",
      "factorPackIds" : {
        "SIRI_TEXT_TO_SPEECH" : "6193e7ac2171a2330e561ea0"
      },
      "deploymentId" : 250000320
    },
    {
      "rolloutId" : "5fc94383418129005b4e9ae0",
      "factorPackIds" : {

      },
      "deploymentId" : 250000160
    },
    {
      "rolloutId" : "602ad4dac86151000cf27e46",
      "factorPackIds" : {
        "SIRI_DICTATION_ASSETS" : "6181ebb28763315b9604755e"
      },
      "deploymentId" : 250000266
    },
    {
      "rolloutId" : "5ffde50ce2aacd000d47a95f",
      "factorPackIds" : {

      },
      "deploymentId" : 250000063
    },
    {
      "rolloutId" : "60da5e84ab0ca017dace9abf",
      "factorPackIds" : {

      },
      "deploymentId" : 250000007
    },
    {
      "rolloutId" : "607844aa04477260f58a8077",
      "factorPackIds" : {
        "SIRI_MORPHUN_ASSETS" : "60ef663fa2f864203caf575c"
      },
      "deploymentId" : 250000055
    }
  ],
  "experiments" : [

  ]
}
}

Model: MacBookPro18,2, BootROM 7429.41.5, proc 10:8:2 processors, 32 GB, SMC 
Graphics: Apple M1 Max, Apple M1 Max, Built-In
Display: Color LCD, 3456 x 2234 Retina, Main, MirrorOff, Online
Memory Module: LPDDR5
AirPort: Wi-Fi, wl0: Sep 24 2021 15:49:44 version 20.10.853.23.8.7.106 FWID 01-78e271b2
Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
USB Device: USB31Bus
USB Device: 4-Port USB 3.0 Hub
USB Device: 4-Port USB 2.0 Hub
USB Device: USB31Bus
USB Device: USB31Bus
USB Device: Helix
Thunderbolt Bus: MacBook Pro, Apple Inc.
Thunderbolt Bus: MacBook Pro, Apple Inc.
Thunderbolt Bus: MacBook Pro, Apple Inc.
dvessel commented 2 years ago

I just tried it on Shenmue and the textures load fine. It seems like the texture type (atlas?) on Soul Calibur is causing the crash. I just tried a fresh dump through SC and it crashes on character select.

flyinghead commented 2 years ago

It's been a while since you reported it but I can't reproduce it on my Intel macbook. When you get a chance, can you check if this is still happening?

dvessel commented 2 years ago

It still crashes. This line is emitted right before the crash:

linux/posix_vmem.cpp:80 W[VMEM]: mem_region_set_exec: mprotect failed. errno 13

Running Monterey 12.4 (21F79)

And here’s the crash log:

Process:               Flycast [77238]
Path:                  /Applications/Flycast.app/Contents/MacOS/Flycast
Identifier:            com.flyinghead.Flycast
Version:               1.0 (1)
Code Type:             ARM-64 (Native)
Parent Process:        Exited process [77207]
User ID:               501

Date/Time:             2022-05-27 13:44:01.244 -04:00
OS Version:            macOS 12.4 (21F79)
Report Version:        12
Anonymous UUID:        5DD1FCF7-5081-E6B6-D95F-02D45F723684

Sleep/Wake UUID:       6ABB21F4-0EBF-4496-8046-7B05CAED2D12
Time Awake Since Boot: 150000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000001, 0x0000000102cf2ccc
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 0x5
Terminating Process:   exc handler [77238]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread

0   com.flyinghead.Flycast            0x0000000102cf2ccc 0x10277c000 + 5729484
1   com.flyinghead.Flycast            0x0000000102cf2ccc 0x10277c000 + 5729484
2   com.flyinghead.Flycast            0x000000010295b214 fault_handler(int, __siginfo*, void*) + 436
3   libsystem_platform.dylib          0x00000001b22874a4 _sigtramp + 56
4   libvulkan.dylib                   0x000000010c6acbb0 MVKImage::applyImageMemoryBarrier(unsigned int, unsigned int, MVKPipelineBarrier&, MVKCommandEncoder*, MVKCommandUse) + 96
5   libvulkan.dylib                   0x000000010c6acbb0 MVKImage::applyImageMemoryBarrier(unsigned int, unsigned int, MVKPipelineBarrier&, MVKCommandEncoder*, MVKCommandUse) + 96
6   libvulkan.dylib                   0x000000010c725554 MVKCmdPipelineBarrier<1ul>::encode(MVKCommandEncoder*) + 724
7   libvulkan.dylib                   0x000000010c6c3330 MVKCommandEncoder::encode(id<MTLCommandBuffer>, MVKCommandEncodingContext*) + 152
8   libvulkan.dylib                   0x000000010c6c31c8 MVKCommandBuffer::submit(MVKQueueCommandBufferSubmission*, MVKCommandEncodingContext*) + 244
9   libvulkan.dylib                   0x000000010c7032f8 MVKQueueFullCommandBufferSubmission<16ul>::submitCommandBuffers() + 84
10  libvulkan.dylib                   0x000000010c7016c8 MVKQueueCommandBufferSubmission::execute() + 200
11  libvulkan.dylib                   0x000000010c700518 MVKQueue::submit(unsigned int, VkSubmitInfo const*, VkFence_T*, MVKCommandUse) + 272
12  libvulkan.dylib                   0x000000010c682b88 vkQueueSubmit + 264
13  com.flyinghead.Flycast            0x00000001029ed87c 0x10277c000 + 2562172
14  com.flyinghead.Flycast            0x00000001029e3370 0x10277c000 + 2519920
15  com.flyinghead.Flycast            0x00000001029f9050 0x10277c000 + 2609232
16  com.flyinghead.Flycast            0x0000000102a00c80 0x10277c000 + 2641024
17  com.flyinghead.Flycast            0x000000010290c5e0 rend_single_frame(bool const&) + 248
18  com.flyinghead.Flycast            0x000000010290ca48 rend_start_render(TA_context*) + 436
19  ???                               0x00000001184dcbc0 0x0 + 4702718912

Thread 1:

0   libsystem_pthread.dylib           0x00000001b226b078 start_wqthread + 0

Thread 2:

0   libsystem_pthread.dylib           0x00000001b226b078 start_wqthread + 0

Thread 3:

0   libsystem_pthread.dylib           0x00000001b226b078 start_wqthread + 0

Thread 4:

0   libsystem_kernel.dylib            0x00000001b22328b0 mach_msg_trap + 8
1   libsystem_kernel.dylib            0x00000001b2232d20 mach_msg + 76
2   com.apple.CoreFoundation          0x00000001b233d2b0 __CFRunLoopServiceMachPort + 372
3   com.apple.CoreFoundation          0x00000001b233b760 __CFRunLoopRun + 1180
4   com.apple.CoreFoundation          0x00000001b233ab24 CFRunLoopRunSpecific + 600
5   com.apple.AppKit                  0x00000001b500e374 _NSEventThread + 196
6   libsystem_pthread.dylib           0x00000001b227026c _pthread_start + 148
7   libsystem_pthread.dylib           0x00000001b226b08c thread_start + 8

Thread 5:

0   libsystem_kernel.dylib            0x00000001b22328ec semaphore_wait_trap + 8
1   com.apple.audio.caulk             0x00000001bacdea2c caulk::mach::semaphore::wait_or_error() + 28
2   com.apple.audio.caulk             0x00000001bacc27ac caulk::concurrent::details::worker_thread::run() + 56
3   com.apple.audio.caulk             0x00000001bacc23cc void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*> > >(void*) + 96
4   libsystem_pthread.dylib           0x00000001b227026c _pthread_start + 148
5   libsystem_pthread.dylib           0x00000001b226b08c thread_start + 8

Thread 6:

0   libsystem_kernel.dylib            0x00000001b22328b0 mach_msg_trap + 8
1   libsystem_kernel.dylib            0x00000001b2232d20 mach_msg + 76
2   com.apple.audio.CoreAudio         0x00000001b3f81ef4 HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int) + 104
3   com.apple.audio.CoreAudio         0x00000001b3e0f238 HALC_ProxyIOContext::IOWorkLoop() + 3396
4   com.apple.audio.CoreAudio         0x00000001b3e0defc invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) + 100
5   com.apple.audio.CoreAudio         0x00000001b3fda304 HALB_IOThread::Entry(void*) + 88
6   libsystem_pthread.dylib           0x00000001b227026c _pthread_start + 148
7   libsystem_pthread.dylib           0x00000001b226b08c thread_start + 8

Thread 7:

0   libsystem_kernel.dylib            0x00000001b22349ec __read_nocancel + 8
1   libsystem_c.dylib                 0x00000001b2162714 __sread + 24
2   libsystem_c.dylib                 0x00000001b213d618 _sread + 32
3   libsystem_c.dylib                 0x00000001b213d5ac __srefill1 + 36
4   libsystem_c.dylib                 0x00000001b213d76c __fread + 256
5   libsystem_c.dylib                 0x00000001b2147c38 fread + 64
6   com.flyinghead.Flycast            0x0000000102995ed4 0x10277c000 + 2203348
7   com.flyinghead.Flycast            0x00000001029a17c0 0x10277c000 + 2250688
8   com.flyinghead.Flycast            0x00000001029960a4 0x10277c000 + 2203812
9   com.flyinghead.Flycast            0x000000010298c368 0x10277c000 + 2163560
10  com.flyinghead.Flycast            0x000000010299498c CustomTexture::LoadCustomTexture(unsigned int, int&, int&) + 364
11  com.flyinghead.Flycast            0x0000000102994138 CustomTexture::LoaderThread() + 168
12  com.flyinghead.Flycast            0x00000001029a7040 CustomTexture::loader_thread_func(void*) + 12
13  com.flyinghead.Flycast            0x0000000102a7c514 0x10277c000 + 3147028
14  libsystem_pthread.dylib           0x00000001b227026c _pthread_start + 148
15  libsystem_pthread.dylib           0x00000001b226b08c thread_start + 8

Thread 8:

0   libsystem_pthread.dylib           0x00000001b226b078 start_wqthread + 0

Thread 0 crashed with ARM Thread State (64-bit):
   x0: 0x0000000000000000   x1: 0xfffffffa18061c37   x2: 0xfffffffa18061c37   x3: 0x0000000fffffc088
   x4: 0xffffa0016d5f3ca8   x5: 0x0000000000000010   x6: 0x0000000000000069   x7: 0x000000016d67e398
   x8: 0x04276cc20f1c00c3   x9: 0x04276cc20f1c00c3  x10: 0x0000000000000000  x11: 0x0000000000000002
  x12: 0x0000000000018c46  x13: 0x00000000016e3600  x14: 0x0000000012e00000  x15: 0x000000000000000b
  x16: 0x00000001b226ad4c  x17: 0x000000020c2f8098  x18: 0x0000000000000000  x19: 0x000000016d67ecd8
  x20: 0x000000016d67ec70  x21: 0x000000000000000b  x22: 0x0000000000000000  x23: 0x0000000000000001
  x24: 0x000000012b795f30  x25: 0x0000000000000000  x26: 0x0000000000000001  x27: 0x000000010cae0520
  x28: 0x0000000000000000   fp: 0x000000016d67ebe0   lr: 0x0000000102cf2ccc
   sp: 0x000000016d67ebc0   pc: 0x0000000102cf2ccc cpsr: 0x0000000060001000
  far: 0x0000000000000009  esr: 0x00000000f2000001

Binary Images:
               0x0 -                0x0 +??? (???) <00000000-0000-0000-0000-000000000000> ???
       0x10277c000 -        0x102e0c000 +com.flyinghead.Flycast (1.0 - 1) <9840CED0-DB22-322D-B353-BF42E5466E79> /Applications/Flycast.app/Contents/MacOS/Flycast
       0x10c66c000 -        0x10cad8000 +libvulkan.dylib (???) <91CE7BE4-A0C5-31FF-8A6D-C360B8554686> /Applications/Flycast.app/Contents/Frameworks/libvulkan.dylib
       0x1b2130000 -        0x1b21b2000 libsystem_c.dylib (???) <86746B94-88E3-342D-B2B2-54303404E492> /usr/lib/system/libsystem_c.dylib
       0x1b2231000 -        0x1b2269000 libsystem_kernel.dylib (???) <03F48DC5-CAA7-3678-AF61-1A3C7FA8B06E> /usr/lib/system/libsystem_kernel.dylib
       0x1b2269000 -        0x1b2276000 libsystem_pthread.dylib (???) <42166A2C-89A9-3C38-A215-F028544CEA23> /usr/lib/system/libsystem_pthread.dylib
       0x1b2283000 -        0x1b228b000 libsystem_platform.dylib (???) <D7ABA99F-BA00-36E9-945D-48ACF57FC568> /usr/lib/system/libsystem_platform.dylib
       0x1b22b8000 -        0x1b27ff000 com.apple.CoreFoundation (6.9 - 1863) <994DB908-11A1-3E43-B7DF-25C09D51368A> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
       0x1b3c4d000 -        0x1b4371000 com.apple.audio.CoreAudio (5.0 - 5.0) <4A0BB421-67C9-3849-A01E-A67D27FC1604> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
       0x1b4e60000 -        0x1b5d18000 com.apple.AppKit (6.9 - 2113.50.132) <A773DD23-B1C8-3C9B-9175-9A71D210ACE0> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
       0x1bacc0000 -        0x1bace7000 com.apple.audio.caulk (1.0) <AF5B85D3-350B-3B8F-9D21-5D4B431DBCD9> /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk

External Modification Summary:
 Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0 
 Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0 
 Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0 

VM Region Summary:
ReadOnly portion of Libraries: Total=857.1M resident=0K(0%) swapped_out_or_unallocated=857.1M(100%)
Writable regions: Total=1.8G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.8G(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Accelerate framework               384K        3 
Activity Tracing                   256K        1 
CG backing stores                 5568K        4 
CG image                            96K        4 
ColorSync                          512K       25 
CoreAnimation                      144K        8 
CoreGraphics                        16K        1 
CoreUI image data                 1104K        7 
Foundation                          16K        1 
Kernel Alloc Once                   32K        1 
MALLOC                           511.4M       77 
MALLOC guard page                  192K       11 
MALLOC_LARGE (reserved)           35.0M        1         reserved VM address space (unallocated)
MALLOC_MEDIUM (reserved)         848.0M        9         reserved VM address space (unallocated)
MALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)
STACK GUARD                       56.1M        9 
Stack                             12.2M        9 
VM_ALLOCATE                        3.6G      277 
VM_ALLOCATE (reserved)              32K        1         reserved VM address space (unallocated)
__AUTH                            1936K      189 
__AUTH_CONST                      11.5M      351 
__CTF                               756        1 
__DATA                            33.7M      342 
__DATA_CONST                      12.0M      356 
__DATA_DIRTY                       740K      121 
__FONT_DATA                          4K        1 
__LINKEDIT                       580.0M        7 
__OBJC_CONST                      1638K      160 
__OBJC_RO                         83.0M        1 
__OBJC_RW                         3152K        1 
__TEXT                           277.1M      372 
__UNICODE                          592K        1 
dyld private memory               1024K        1 
mapped file                      730.5M      226 
shared memory                      864K       13 
===========                     =======  ======= 
TOTAL                              7.1G     2593 
TOTAL, minus reserved VM space     5.8G     2593