libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
9.78k stars 1.82k forks source link

Resizing or moving to different screen on M1 sporadically crashes when main and draw are different threads #5203

Closed def- closed 2 years ago

def- commented 2 years ago

This is on macOS with an M1 ARM64 CPU. Crash originally reported in https://github.com/ddnet/ddnet/issues/4435

To reproduce run DDNet client, which uses SDL2. Resize or move the window to a different screen to trigger a crash sporadically.

Crash log (click to expand) ``` ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Process: DDNet [13312] Path: /Users/USER/*/DDNet Identifier: DDNet Version: ??? Code Type: ARM-64 (Native) Parent Process: zsh [12485] Responsible: iTerm2 [748] User ID: 501 Date/Time: 2022-01-08 11:51:43.5711 +0100 OS Version: macOS 12.1 (21C52) Report Version: 12 Anonymous UUID: 3AB7E5C0-6273-0D0C-4A67-105D60AF53FE Time Awake Since Boot: 8100 seconds System Integrity Protection: enabled Crashed Thread: 7 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Application Specific Information: dyld4 config: DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib -[AGXG13XFamilyCommandBuffer renderCommandEncoderWithDescriptor:]:380: failed assertion `A command encoder is already encoding to this command buffer' Thread 0:: Dispatch queue: com.apple.main-thread 0 DDNet 0x1021fcb40 IGraphics::ScreenWidth() const + 40 (graphics.h:205) 1 DDNet 0x10227c358 CTextRender::AppendTextContainer(CTextCursor*, int, char const*, int) + 728 (text.cpp:1078) 2 DDNet 0x10227c358 CTextRender::AppendTextContainer(CTextCursor*, int, char const*, int) + 728 (text.cpp:1078) 3 DDNet 0x10227bf1c CTextRender::CreateTextContainer(CTextCursor*, char const*, int) + 636 (text.cpp:978) 4 DDNet 0x10227bbdc CTextRender::TextEx(CTextCursor*, char const*, int) + 76 (text.cpp:909) 5 DDNet 0x10227f4d0 CTextRender::TextWidth(void*, float, char const*, int, float, float*, float*) + 188 (text.cpp:854) 6 DDNet 0x1023b2e30 CUI::DoTextLabel(float, float, float, float, char const*, float, int, float, int, bool, CTextCursor*) + 168 (ui.cpp:457) 7 DDNet 0x1023b30b4 CUI::DoLabel(CUIRect const*, char const*, float, int, float, int, CTextCursor*) + 132 (ui.cpp:509) 8 DDNet 0x10230598c CMenus::DoButton_GridHeader(void const*, char const*, int, CUIRect const*) + 344 (menus.cpp:321) 9 DDNet 0x102315300 CMenus::RenderServerbrowserServerList(CUIRect) + 2080 (menus_browser.cpp:153) 10 DDNet 0x10231bda0 CMenus::RenderServerbrowser(CUIRect) + 268 (menus_browser.cpp:1394) 11 DDNet 0x10230b4c8 CMenus::Render() + 1960 (menus.cpp:1408) 12 DDNet 0x1023101c8 CMenus::OnRender() + 1116 (menus.cpp:2534) 13 DDNet 0x102378038 CGameClient::OnRender() + 424 (gameclient.cpp:586) 14 DDNet 0x1021fd044 CClient::Render() + 252 (client.cpp:1171) 15 DDNet 0x102205c78 CClient::Run() + 3908 (client.cpp:3361) 16 DDNet 0x10220b70c TWMain + 2276 (client.cpp:4496) 17 DDNet 0x10229ef8c main + 256 (client.m:22) 18 dyld 0x102d790f4 start + 520 Thread 1: 0 libsystem_kernel.dylib 0x18b2c9f4c sem_wait + 8 1 DDNet 0x10219ccd4 sphore_wait + 44 (system.cpp:959) 2 DDNet 0x10219bcc8 aio_thread(void*) + 184 (system.cpp:522) 3 DDNet 0x10219ca40 thread_run(void*) + 84 (system.cpp:763) 4 libsystem_pthread.dylib 0x18b2d9240 _pthread_start + 148 5 libsystem_pthread.dylib 0x18b2d4024 thread_start + 8 Thread 2: 0 libsystem_kernel.dylib 0x18b2c9f4c sem_wait + 8 1 DDNet 0x10219ccd4 sphore_wait + 44 (system.cpp:959) 2 DDNet 0x102177e48 CJobPool::WorkerThread(void*) + 80 (jobs.cpp:64) 3 DDNet 0x10219ca40 thread_run(void*) + 84 (system.cpp:763) 4 libsystem_pthread.dylib 0x18b2d9240 _pthread_start + 148 5 libsystem_pthread.dylib 0x18b2d4024 thread_start + 8 Thread 3: 0 libsystem_kernel.dylib 0x18b2c9f4c sem_wait + 8 1 DDNet 0x10219ccd4 sphore_wait + 44 (system.cpp:959) 2 DDNet 0x102177e48 CJobPool::WorkerThread(void*) + 80 (jobs.cpp:64) 3 DDNet 0x10219ca40 thread_run(void*) + 84 (system.cpp:763) 4 libsystem_pthread.dylib 0x18b2d9240 _pthread_start + 148 5 libsystem_pthread.dylib 0x18b2d4024 thread_start + 8 Thread 4: 0 libsystem_pthread.dylib 0x18b2d4010 start_wqthread + 0 Thread 5: 0 libsystem_pthread.dylib 0x18b2d4010 start_wqthread + 0 Thread 6: 0 libsystem_pthread.dylib 0x18b2d4010 start_wqthread + 0 Thread 7 Crashed: 0 libsystem_kernel.dylib 0x18b2a59b8 __pthread_kill + 8 1 libsystem_pthread.dylib 0x18b2d8eb0 pthread_kill + 288 2 libsystem_c.dylib 0x18b216314 abort + 164 3 libsystem_c.dylib 0x18b2156d4 __assert_rtn + 212 4 Metal 0x193c29d50 MTLReportFailure.cold.1 + 56 5 Metal 0x193c13d04 MTLReportFailure + 476 6 AGXMetalG13X 0x1d0afcd34 0x1d0908000 + 2051380 7 AppleMetalOpenGLRenderer 0x10bc78098 GLDContextRec::beginRenderPass() + 136 8 AppleMetalOpenGLRenderer 0x10bc8f6c0 gldRenderVertexArray(GLDContextRec*, unsigned int, unsigned int, int, int, unsigned int, void const*, int, void const*) + 492 9 GLEngine 0x1ec997338 glDrawElements_GL3Exec + 296 10 DDNet 0x1021d82a8 CCommandProcessorFragment_OpenGL3_3::Cmd_RenderQuadLayer(CCommandBuffer::SCommand_RenderQuadLayer const*) + 828 (backend_opengl3.cpp:1281) 11 DDNet 0x1021c1178 CCommandProcessorFragment_OpenGL::RunCommand(CCommandBuffer::SCommand const*) + 984 (backend_opengl.cpp:1086) 12 DDNet 0x1021ec2e4 CCommandProcessor_SDL_OpenGL::RunBuffer(CCommandBuffer*) + 88 (backend_sdl.cpp:221) 13 DDNet 0x1021eb384 CGraphicsBackend_Threaded::ThreadFunc() + 144 (backend_sdl.cpp:72) 14 DDNet 0x1021f6138 CGraphicsBackend_Threaded::StartProcessor(CGraphicsBackend_Threaded::ICommandProcessor*)::$_0::operator()() const + 44 (backend_sdl.cpp:97) 15 DDNet 0x1021f6034 decltype(std::__1::forward(fp)()) std::__1::__invoke(CGraphicsBackend_Threaded::StartProcessor(CGraphicsBackend_Threaded::ICommandProcessor*)::$_0&&) + 44 (type_traits:3694) 16 DDNet 0x1021f5f2c void std::__1::__thread_execute >, CGraphicsBackend_Threaded::StartProcessor(CGraphicsBackend_Threaded::ICommandProcessor*)::$_0>(std::__1::tuple >, CGraphicsBackend_Threaded::StartProcessor(CGraphicsBackend_Threaded::ICommandProcessor*)::$_0>&, std::__1::__tuple_indices<>) + 48 (thread:286) 17 DDNet 0x1021f4fb4 void* std::__1::__thread_proxy >, CGraphicsBackend_Threaded::StartProcessor(CGraphicsBackend_Threaded::ICommandProcessor*)::$_0> >(void*) + 100 (thread:297) 18 libsystem_pthread.dylib 0x18b2d9240 _pthread_start + 148 19 libsystem_pthread.dylib 0x18b2d4024 thread_start + 8 Thread 8: 0 libsystem_pthread.dylib 0x18b2d4010 start_wqthread + 0 Thread 9: 0 libsystem_pthread.dylib 0x18b2d4010 start_wqthread + 0 Thread 10:: com.apple.NSEventThread 0 libsystem_kernel.dylib 0x18b29d954 mach_msg_trap + 8 1 libsystem_kernel.dylib 0x18b29dd00 mach_msg + 76 2 CoreFoundation 0x18b3a4ed8 __CFRunLoopServiceMachPort + 372 3 CoreFoundation 0x18b3a3390 __CFRunLoopRun + 1212 4 CoreFoundation 0x18b3a2734 CFRunLoopRunSpecific + 600 5 AppKit 0x18e065c90 _NSEventThread + 196 6 libsystem_pthread.dylib 0x18b2d9240 _pthread_start + 148 7 libsystem_pthread.dylib 0x18b2d4024 thread_start + 8 Thread 7 crashed with ARM Thread State (64-bit): x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000 x4: 0x0000000000000000 x5: 0x0000000000000002 x6: 0x0000000000000000 x7: 0x000000000000003e x8: 0xcaf4b961e4aabf14 x9: 0xcaf4b9608aa5cf14 x10: 0xcccccccccccccccd x11: 0x000000000000000a x12: 0x0000000000000000 x13: 0x0000000000000033 x14: 0x0000020000011000 x15: 0x00000001e43894a0 x16: 0x0000000000000148 x17: 0x00000001e5ab7530 x18: 0x0000000000000000 x19: 0x0000000000000006 x20: 0x000000016e0f7000 x21: 0x0000000000009113 x22: 0x0000000118cc0000 x23: 0x00000001e167a000 x24: 0x0000000000000010 x25: 0x00000001e1858000 x26: 0x0000000193c44374 x27: 0x0000000000000000 x28: 0x0000000000000000 fp: 0x000000016e0f4890 lr: 0x000000018b2d8eb0 sp: 0x000000016e0f4870 pc: 0x000000018b2a59b8 cpsr: 0x40001000 far: 0x0000000118cc0000 esr: 0x56000080 Address size fault Binary Images: 0x1020d8000 - 0x1024fbfff DDNet (*) <7c815a3a-8d36-392a-a9ab-0077083e1df6> /Users/USER/*/DDNet 0x102d74000 - 0x102dd3fff dyld (*) <7e92b284-4b90-3b68-b31a-3ddc4c0e8d40> /usr/lib/dyld 0x18b29c000 - 0x18b2d1fff libsystem_kernel.dylib (*) /usr/lib/system/libsystem_kernel.dylib 0x18b2d2000 - 0x18b2defff libsystem_pthread.dylib (*) /usr/lib/system/libsystem_pthread.dylib 0x18b19d000 - 0x18b21dfff libsystem_c.dylib (*) <00fc01c7-36bc-3193-86a3-5c03046b45fb> /usr/lib/system/libsystem_c.dylib 0x193b4d000 - 0x193c86fff com.apple.Metal (258.17) <970fae8e-1769-3816-badf-2b75ec9a9385> /System/Library/Frameworks/Metal.framework/Versions/A/Metal 0x1d0908000 - 0x1d0e1bfff com.apple.AGXMetalG13X (187.59) <3b4747b4-b4e8-3569-8290-12e7f58b6766> /System/Library/Extensions/AGXMetalG13X.bundle/Contents/MacOS/AGXMetalG13X 0x10bc4c000 - 0x10bcb7fff com.apple.AppleMetalOpenGLRenderer (1.0) /System/Library/Extensions/AppleMetalOpenGLRenderer.bundle/Contents/MacOS/AppleMetalOpenGLRenderer 0x1ec8e8000 - 0x1eca56fff GLEngine (*) <6b2f957f-f994-3ef6-8c40-c62b6cf25bb2> /System/Library/Frameworks/OpenGL.framework/Versions/A/Resources/GLEngine.bundle/GLEngine 0x18b320000 - 0x18b863fff com.apple.CoreFoundation (6.9) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x18deb7000 - 0x18ed6afff com.apple.AppKit (6.9) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 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: 3 thread_create: 0 thread_set_state: 90 VM Region Summary: ReadOnly portion of Libraries: Total=896.1M resident=0K(0%) swapped_out_or_unallocated=896.1M(100%) Writable regions: Total=1.7G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.7G(100%) VIRTUAL REGION REGION TYPE SIZE COUNT (non-coalesced) =========== ======= ======= Accelerate framework 512K 4 Activity Tracing 256K 1 CG backing stores 4992K 8 CG image 144K 6 ColorSync 528K 25 CoreAnimation 192K 12 CoreGraphics 32K 2 CoreUI image data 1248K 11 Foundation 48K 2 Image IO 16K 1 Kernel Alloc Once 32K 1 MALLOC 477.8M 78 MALLOC guard page 192K 9 MALLOC_MEDIUM (reserved) 808.0M 8 reserved VM address space (unallocated) MALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated) OpenGL GLSL 256K 3 SQLite page cache 64K 1 STACK GUARD 56.2M 11 Stack 13.3M 11 VM_ALLOCATE 1.0G 362 __AUTH 2067K 219 __AUTH_CONST 13.2M 382 __DATA 10.9M 375 __DATA_CONST 13.7M 389 __DATA_DIRTY 1113K 141 __FONT_DATA 4K 1 __GLSLBUILTINS 5176K 1 __LINKEDIT 580.5M 9 __OBJC_CONST 2313K 186 __OBJC_RO 82.0M 1 __OBJC_RW 3104K 1 __TEXT 315.6M 405 __UNICODE 588K 1 dyld private memory 1024K 1 mapped file 154.9M 23 shared memory 896K 15 =========== ======= ======= TOTAL 3.9G 2707 TOTAL, minus reserved VM space 2.7G 2707 ----------- Full Report ----------- {"app_name":"DDNet","timestamp":"2022-01-08 11:51:46.00 +0100","app_version":"","slice_uuid":"7c815a3a-8d36-392a-a9ab-0077083e1df6","build_version":"","platform":1,"share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 12.1 (21C52)","incident_id":"7B96AE1B-5ECA-469B-A652-40A503CC6337","name":"DDNet"} { "uptime" : 8100, "procLaunch" : "2022-01-08 11:51:38.8046 +0100", "procRole" : "Foreground", "version" : 2, "userID" : 501, "deployVersion" : 210, "modelCode" : "MacBookPro18,1", "procStartAbsTime" : 196109025884, "coalitionID" : 590, "osVersion" : { "train" : "macOS 12.1", "build" : "21C52", "releaseType" : "User" }, "captureTime" : "2022-01-08 11:51:43.5711 +0100", "incident" : "7B96AE1B-5ECA-469B-A652-40A503CC6337", "bug_type" : "309", "pid" : 13312, "procExitAbsTime" : 196222495679, "translated" : false, "cpuType" : "ARM-64", "procName" : "DDNet", "procPath" : "\/Users\/USER\/*\/DDNet", "parentProc" : "zsh", "parentPid" : 12485, "coalitionName" : "com.googlecode.iterm2", "crashReporterKey" : "3AB7E5C0-6273-0D0C-4A67-105D60AF53FE", "responsiblePid" : 748, "responsibleProc" : "iTerm2", "sip" : "enabled", "isCorpse" : 1, "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"}, "asi" : {"libsystem_c.dylib":["-[AGXG13XFamilyCommandBuffer renderCommandEncoderWithDescriptor:]:380: failed assertion `A command encoder is already encoding to this command buffer'"],"dyld":["dyld4 config: DYLD_INSERT_LIBRARIES=\/Applications\/Xcode.app\/Contents\/Developer\/usr\/lib\/libMainThreadChecker.dylib"]}, "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":90,"task_for_pid":3},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0}, "faultingThread" : 7, "threads" : [{"id":114847,"queue":"com.apple.main-thread","frames":[{"imageOffset":1198912,"sourceLine":205,"sourceFile":"graphics.h","symbol":"IGraphics::ScreenWidth() const","imageIndex":0,"symbolLocation":40},{"imageOffset":1721176,"sourceLine":1078,"sourceFile":"text.cpp","symbol":"CTextRender::AppendTextContainer(CTextCursor*, int, char const*, int)","imageIndex":0,"symbolLocation":728},{"imageOffset":1721176,"sourceLine":1078,"sourceFile":"text.cpp","symbol":"CTextRender::AppendTextContainer(CTextCursor*, int, char const*, int)","imageIndex":0,"symbolLocation":728},{"imageOffset":1720092,"sourceLine":978,"sourceFile":"text.cpp","symbol":"CTextRender::CreateTextContainer(CTextCursor*, char const*, int)","imageIndex":0,"symbolLocation":636},{"imageOffset":1719260,"sourceLine":909,"sourceFile":"text.cpp","symbol":"CTextRender::TextEx(CTextCursor*, char const*, int)","imageIndex":0,"symbolLocation":76},{"imageOffset":1733840,"sourceLine":854,"sourceFile":"text.cpp","symbol":"CTextRender::TextWidth(void*, float, char const*, int, float, float*, float*)","imageIndex":0,"symbolLocation":188},{"imageOffset":2993712,"sourceLine":457,"sourceFile":"ui.cpp","symbol":"CUI::DoTextLabel(float, float, float, float, char const*, float, int, float, int, bool, CTextCursor*)","imageIndex":0,"symbolLocation":168},{"imageOffset":2994356,"sourceLine":509,"sourceFile":"ui.cpp","symbol":"CUI::DoLabel(CUIRect const*, char const*, float, int, float, int, CTextCursor*)","imageIndex":0,"symbolLocation":132},{"imageOffset":2283916,"sourceLine":321,"sourceFile":"menus.cpp","symbol":"CMenus::DoButton_GridHeader(void const*, char const*, int, CUIRect const*)","imageIndex":0,"symbolLocation":344},{"imageOffset":2347776,"sourceLine":153,"sourceFile":"menus_browser.cpp","symbol":"CMenus::RenderServerbrowserServerList(CUIRect)","imageIndex":0,"symbolLocation":2080},{"imageOffset":2375072,"sourceLine":1394,"sourceFile":"menus_browser.cpp","symbol":"CMenus::RenderServerbrowser(CUIRect)","imageIndex":0,"symbolLocation":268},{"imageOffset":2307272,"sourceLine":1408,"sourceFile":"menus.cpp","symbol":"CMenus::Render()","imageIndex":0,"symbolLocation":1960},{"imageOffset":2326984,"sourceLine":2534,"sourceFile":"menus.cpp","symbol":"CMenus::OnRender()","imageIndex":0,"symbolLocation":1116},{"imageOffset":2752568,"sourceLine":586,"sourceFile":"gameclient.cpp","symbol":"CGameClient::OnRender()","imageIndex":0,"symbolLocation":424},{"imageOffset":1200196,"sourceLine":1171,"sourceFile":"client.cpp","symbol":"CClient::Render()","imageIndex":0,"symbolLocation":252},{"imageOffset":1236088,"sourceLine":3361,"sourceFile":"client.cpp","symbol":"CClient::Run()","imageIndex":0,"symbolLocation":3908},{"imageOffset":1259276,"sourceLine":4496,"sourceFile":"client.cpp","symbol":"TWMain","imageIndex":0,"symbolLocation":2276},{"imageOffset":1863564,"sourceLine":22,"sourceFile":"client.m","symbol":"main","imageIndex":0,"symbolLocation":256},{"imageOffset":20724,"symbol":"start","symbolLocation":520,"imageIndex":1}]},{"id":114849,"frames":[{"imageOffset":188236,"symbol":"sem_wait","symbolLocation":8,"imageIndex":2},{"imageOffset":806100,"sourceLine":959,"sourceFile":"system.cpp","symbol":"sphore_wait","imageIndex":0,"symbolLocation":44},{"imageOffset":801992,"sourceLine":522,"sourceFile":"system.cpp","symbol":"aio_thread(void*)","imageIndex":0,"symbolLocation":184},{"imageOffset":805440,"sourceLine":763,"sourceFile":"system.cpp","symbol":"thread_run(void*)","imageIndex":0,"symbolLocation":84},{"imageOffset":29248,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":3},{"imageOffset":8228,"symbol":"thread_start","symbolLocation":8,"imageIndex":3}]},{"id":114850,"frames":[{"imageOffset":188236,"symbol":"sem_wait","symbolLocation":8,"imageIndex":2},{"imageOffset":806100,"sourceLine":959,"sourceFile":"system.cpp","symbol":"sphore_wait","imageIndex":0,"symbolLocation":44},{"imageOffset":654920,"sourceLine":64,"sourceFile":"jobs.cpp","symbol":"CJobPool::WorkerThread(void*)","imageIndex":0,"symbolLocation":80},{"imageOffset":805440,"sourceLine":763,"sourceFile":"system.cpp","symbol":"thread_run(void*)","imageIndex":0,"symbolLocation":84},{"imageOffset":29248,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":3},{"imageOffset":8228,"symbol":"thread_start","symbolLocation":8,"imageIndex":3}]},{"id":114851,"frames":[{"imageOffset":188236,"symbol":"sem_wait","symbolLocation":8,"imageIndex":2},{"imageOffset":806100,"sourceLine":959,"sourceFile":"system.cpp","symbol":"sphore_wait","imageIndex":0,"symbolLocation":44},{"imageOffset":654920,"sourceLine":64,"sourceFile":"jobs.cpp","symbol":"CJobPool::WorkerThread(void*)","imageIndex":0,"symbolLocation":80},{"imageOffset":805440,"sourceLine":763,"sourceFile":"system.cpp","symbol":"thread_run(void*)","imageIndex":0,"symbolLocation":84},{"imageOffset":29248,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":3},{"imageOffset":8228,"symbol":"thread_start","symbolLocation":8,"imageIndex":3}]},{"id":114852,"frames":[{"imageOffset":8208,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":3}]},{"id":114853,"frames":[{"imageOffset":8208,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":3}]},{"id":114856,"frames":[{"imageOffset":8208,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":3}]},{"triggered":true,"id":114859,"threadState":{"x":[{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":2},{"value":0},{"value":62},{"value":14624517720078204692},{"value":14624517714272964372},{"value":14757395258967641293},{"value":10},{"value":0},{"value":51},{"value":2199023325184},{"value":8123880608,"symbolLocation":0,"symbol":"OBJC_CLASS_$___NSCFString"},{"value":328},{"value":8148186416},{"value":0},{"value":6},{"value":6141472768},{"value":37139},{"value":4710989824},{"value":8076632064,"symbolLocation":0,"symbol":"AutoreleasePoolPage::badPop(void*)::complained"},{"value":16},{"value":8078589952},{"value":6774080372,"symbolLocation":8019,"symbol":"_MTLRequestHashToString(MTLUINT256_t)::hexChars"},{"value":0},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":6629985968},"cpsr":{"value":1073745920},"fp":{"value":6141462672},"sp":{"value":6141462640},"esr":{"value":1442840704,"description":" Address size fault"},"pc":{"value":6629775800,"matchesCrashFrame":1},"far":{"value":4710989824}},"frames":[{"imageOffset":39352,"symbol":"__pthread_kill","symbolLocation":8,"imageIndex":2},{"imageOffset":28336,"symbol":"pthread_kill","symbolLocation":288,"imageIndex":3},{"imageOffset":496404,"symbol":"abort","symbolLocation":164,"imageIndex":4},{"imageOffset":493268,"symbol":"__assert_rtn","symbolLocation":212,"imageIndex":4},{"imageOffset":904528,"symbol":"MTLReportFailure.cold.1","symbolLocation":56,"imageIndex":5},{"imageOffset":814340,"symbol":"MTLReportFailure","symbolLocation":476,"imageIndex":5},{"imageOffset":2051380,"imageIndex":6},{"imageOffset":180376,"symbol":"GLDContextRec::beginRenderPass()","symbolLocation":136,"imageIndex":7},{"imageOffset":276160,"symbol":"gldRenderVertexArray(GLDContextRec*, unsigned int, unsigned int, int, int, unsigned int, void const*, int, void const*)","symbolLocation":492,"imageIndex":7},{"imageOffset":717624,"symbol":"glDrawElements_GL3Exec","symbolLocation":296,"imageIndex":8},{"imageOffset":1049256,"sourceLine":1281,"sourceFile":"backend_opengl3.cpp","symbol":"CCommandProcessorFragment_OpenGL3_3::Cmd_RenderQuadLayer(CCommandBuffer::SCommand_RenderQuadLayer const*)","imageIndex":0,"symbolLocation":828},{"imageOffset":954744,"sourceLine":1086,"sourceFile":"backend_opengl.cpp","symbol":"CCommandProcessorFragment_OpenGL::RunCommand(CCommandBuffer::SCommand const*)","imageIndex":0,"symbolLocation":984},{"imageOffset":1131236,"sourceLine":221,"sourceFile":"backend_sdl.cpp","symbol":"CCommandProcessor_SDL_OpenGL::RunBuffer(CCommandBuffer*)","imageIndex":0,"symbolLocation":88},{"imageOffset":1127300,"sourceLine":72,"sourceFile":"backend_sdl.cpp","symbol":"CGraphicsBackend_Threaded::ThreadFunc()","imageIndex":0,"symbolLocation":144},{"imageOffset":1171768,"sourceLine":97,"sourceFile":"backend_sdl.cpp","symbol":"CGraphicsBackend_Threaded::StartProcessor(CGraphicsBackend_Threaded::ICommandProcessor*)::$_0::operator()() const","imageIndex":0,"symbolLocation":44},{"imageOffset":1171508,"sourceLine":3694,"sourceFile":"type_traits","symbol":"decltype(std::__1::forward(fp)()) std::__1::__invoke(CGraphicsBackend_Threaded::StartProcessor(CGraphicsBackend_Threaded::ICommandProcessor*)::$_0&&)","imageIndex":0,"symbolLocation":44},{"imageOffset":1171244,"sourceLine":286,"sourceFile":"thread","symbol":"void std::__1::__thread_execute >, CGraphicsBackend_Threaded::StartProcessor(CGraphicsBackend_Threaded::ICommandProcessor*)::$_0>(std::__1::tuple >, CGraphicsBackend_Threaded::StartProcessor(CGraphicsBackend_Threaded::ICommandProcessor*)::$_0>&, std::__1::__tuple_indices<>)","imageIndex":0,"symbolLocation":48},{"imageOffset":1167284,"sourceLine":297,"sourceFile":"thread","symbol":"void* std::__1::__thread_proxy >, CGraphicsBackend_Threaded::StartProcessor(CGraphicsBackend_Threaded::ICommandProcessor*)::$_0> >(void*)","imageIndex":0,"symbolLocation":100},{"imageOffset":29248,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":3},{"imageOffset":8228,"symbol":"thread_start","symbolLocation":8,"imageIndex":3}]},{"id":114860,"frames":[{"imageOffset":8208,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":3}]},{"id":114861,"frames":[{"imageOffset":8208,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":3}]},{"id":114907,"name":"com.apple.NSEventThread","frames":[{"imageOffset":6484,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":2},{"imageOffset":7424,"symbol":"mach_msg","symbolLocation":76,"imageIndex":2},{"imageOffset":544472,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":372,"imageIndex":9},{"imageOffset":537488,"symbol":"__CFRunLoopRun","symbolLocation":1212,"imageIndex":9},{"imageOffset":534324,"symbol":"CFRunLoopRunSpecific","symbolLocation":600,"imageIndex":9},{"imageOffset":1764496,"symbol":"_NSEventThread","symbolLocation":196,"imageIndex":10},{"imageOffset":29248,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":3},{"imageOffset":8228,"symbol":"thread_start","symbolLocation":8,"imageIndex":3}]}], "usedImages" : [ { "source" : "P", "arch" : "arm64", "base" : 4329406464, "size" : 4341760, "uuid" : "7c815a3a-8d36-392a-a9ab-0077083e1df6", "path" : "\/Users\/USER\/*\/DDNet", "name" : "DDNet" }, { "source" : "P", "arch" : "arm64e", "base" : 4342628352, "size" : 393216, "uuid" : "7e92b284-4b90-3b68-b31a-3ddc4c0e8d40", "path" : "\/usr\/lib\/dyld", "name" : "dyld" }, { "source" : "P", "arch" : "arm64e", "base" : 6629736448, "size" : 221184, "uuid" : "c8b3081a-5081-3a99-bbe3-01413de444c6", "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib", "name" : "libsystem_kernel.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 6629957632, "size" : 53248, "uuid" : "ed328b18-eeef-3b15-8858-798b19b0c2cd", "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib", "name" : "libsystem_pthread.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 6628691968, "size" : 528384, "uuid" : "00fc01c7-36bc-3193-86a3-5c03046b45fb", "path" : "\/usr\/lib\/system\/libsystem_c.dylib", "name" : "libsystem_c.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 6773067776, "CFBundleShortVersionString" : "258.17", "CFBundleIdentifier" : "com.apple.Metal", "size" : 1286144, "uuid" : "970fae8e-1769-3816-badf-2b75ec9a9385", "path" : "\/System\/Library\/Frameworks\/Metal.framework\/Versions\/A\/Metal", "name" : "Metal", "CFBundleVersion" : "258.17" }, { "source" : "P", "arch" : "arm64e", "base" : 7794098176, "CFBundleShortVersionString" : "187.59", "CFBundleIdentifier" : "com.apple.AGXMetalG13X", "size" : 5324800, "uuid" : "3b4747b4-b4e8-3569-8290-12e7f58b6766", "path" : "\/System\/Library\/Extensions\/AGXMetalG13X.bundle\/Contents\/MacOS\/AGXMetalG13X", "name" : "AGXMetalG13X", "CFBundleVersion" : "187.59" }, { "source" : "P", "arch" : "arm64e", "base" : 4492410880, "CFBundleShortVersionString" : "1.0", "CFBundleIdentifier" : "com.apple.AppleMetalOpenGLRenderer", "size" : 442368, "uuid" : "a9176e8d-954c-3c5d-a36b-f65a83db3b87", "path" : "\/System\/Library\/Extensions\/AppleMetalOpenGLRenderer.bundle\/Contents\/MacOS\/AppleMetalOpenGLRenderer", "name" : "AppleMetalOpenGLRenderer", "CFBundleVersion" : "1" }, { "source" : "P", "arch" : "arm64e", "base" : 8263729152, "size" : 1503232, "uuid" : "6b2f957f-f994-3ef6-8c40-c62b6cf25bb2", "path" : "\/System\/Library\/Frameworks\/OpenGL.framework\/Versions\/A\/Resources\/GLEngine.bundle\/GLEngine", "name" : "GLEngine" }, { "source" : "P", "arch" : "arm64e", "base" : 6630277120, "CFBundleShortVersionString" : "6.9", "CFBundleIdentifier" : "com.apple.CoreFoundation", "size" : 5521408, "uuid" : "f5ea9592-4ef9-3d35-b23d-5c21283acc52", "path" : "\/System\/Library\/Frameworks\/CoreFoundation.framework\/Versions\/A\/CoreFoundation", "name" : "CoreFoundation", "CFBundleVersion" : "1856.105" }, { "source" : "P", "arch" : "arm64e", "base" : 6675984384, "CFBundleShortVersionString" : "6.9", "CFBundleIdentifier" : "com.apple.AppKit", "size" : 15417344, "uuid" : "a8bbc643-113d-310f-96b6-77a973bf2dba", "path" : "\/System\/Library\/Frameworks\/AppKit.framework\/Versions\/C\/AppKit", "name" : "AppKit", "CFBundleVersion" : "2113.20.111" } ], "sharedCache" : { "base" : 6626787328, "size" : 3089596416, "uuid" : "66c33c62-48a9-31e5-b8b5-7a71c9760d07" }, "vmSummary" : "ReadOnly portion of Libraries: Total=896.1M resident=0K(0%) swapped_out_or_unallocated=896.1M(100%)\nWritable regions: Total=1.7G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.7G(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nAccelerate framework 512K 4 \nActivity Tracing 256K 1 \nCG backing stores 4992K 8 \nCG image 144K 6 \nColorSync 528K 25 \nCoreAnimation 192K 12 \nCoreGraphics 32K 2 \nCoreUI image data 1248K 11 \nFoundation 48K 2 \nImage IO 16K 1 \nKernel Alloc Once 32K 1 \nMALLOC 477.8M 78 \nMALLOC guard page 192K 9 \nMALLOC_MEDIUM (reserved) 808.0M 8 reserved VM address space (unallocated)\nMALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated)\nOpenGL GLSL 256K 3 \nSQLite page cache 64K 1 \nSTACK GUARD 56.2M 11 \nStack 13.3M 11 \nVM_ALLOCATE 1.0G 362 \n__AUTH 2067K 219 \n__AUTH_CONST 13.2M 382 \n__DATA 10.9M 375 \n__DATA_CONST 13.7M 389 \n__DATA_DIRTY 1113K 141 \n__FONT_DATA 4K 1 \n__GLSLBUILTINS 5176K 1 \n__LINKEDIT 580.5M 9 \n__OBJC_CONST 2313K 186 \n__OBJC_RO 82.0M 1 \n__OBJC_RW 3104K 1 \n__TEXT 315.6M 405 \n__UNICODE 588K 1 \ndyld private memory 1024K 1 \nmapped file 154.9M 23 \nshared memory 896K 15 \n=========== ======= ======= \nTOTAL 3.9G 2707 \nTOTAL, minus reserved VM space 2.7G 2707 \n", "legacyInfo" : { "threadTriggered" : { } }, "trialInfo" : { "rollouts" : [ { "rolloutId" : "607844aa04477260f58a8077", "factorPackIds" : { "SIRI_MORPHUN_ASSETS" : "6103050cbfe6dc472e1c982a" }, "deploymentId" : 240000066 }, { "rolloutId" : "602ad4dac86151000cf27e46", "factorPackIds" : { "SIRI_DICTATION_ASSETS" : "61a80a438feb033580c2778b" }, "deploymentId" : 240000290 }, { "rolloutId" : "60da5e84ab0ca017dace9abf", "factorPackIds" : { }, "deploymentId" : 240000008 }, { "rolloutId" : "5ffde50ce2aacd000d47a95f", "factorPackIds" : { }, "deploymentId" : 240000090 }, { "rolloutId" : "601d9415f79519000ccd4b69", "factorPackIds" : { "SIRI_TEXT_TO_SPEECH" : "61c11dcd2cb6041dc630dc63" }, "deploymentId" : 240000357 }, { "rolloutId" : "5fc94383418129005b4e9ae0", "factorPackIds" : { }, "deploymentId" : 240000196 } ], "experiments" : [ ] } } Model: MacBookPro18,1, BootROM 7429.61.2, proc 10:8:2 processors, 16 GB, SMC Graphics: Apple M1 Pro, Apple M1 Pro, Built-In Display: Color LCD, 3456 x 2234 Retina, Main, MirrorOff, Online Display: LG ULTRAGEAR, 2560 x 1440 (QHD/WQHD - Wide Quad High Definition), MirrorOff, Online Memory Module: LPDDR5 AirPort: Wi-Fi, wl0: Oct 25 2021 22:17:59 version 20.10.853.26.8.7.107 FWID 01-417a4935 Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports Network Service: Lenovo USB-C to LAN, Ethernet, en8 Network Service: Wi-Fi, AirPort, en0 USB Device: USB31Bus USB Device: Lenovo USB-C to LAN USB Device: USB31Bus USB Device: USB31Bus Thunderbolt Bus: MacBook Pro, Apple Inc. Thunderbolt Bus: MacBook Pro, Apple Inc. Thunderbolt Bus: MacBook Pro, Apple Inc. ```

Failed assertion is:

dyld4 config: DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib
-[AGXG13XFamilyCommandBuffer renderCommandEncoderWithDescriptor:]:380: failed assertion `A command encoder is already encoding to this command buffer'

Might be related to https://github.com/libsdl-org/SDL/pull/4242 which happend previously, but this crash still happens with SDL 2.0.18.

Similar issues seem to exist on GLFW, see https://github.com/glfw/glfw/issues/1997

frenzibyte commented 2 years ago

I haven't checked this in detail yet, but in case someone with more experience is able to figure this out quicker than I can, reverting the mentioned PR (https://github.com/libsdl-org/SDL/pull/4242) resolves the issue completely on my end.

frenzibyte commented 2 years ago

After going through the mentioned PR for a bit, the backing issue (https://github.com/libsdl-org/SDL/issues/3680) doesn't look like a case that would affect our project. It would be quite helpful for now defining a flag/hint to switch between dispatch_sync and dispatch_async for context update, to avoid this issue at our side.

icculus commented 2 years ago

Is this issue resolved now that the hint patch is merged? (disregarding for a moment my after-the-fact idea in #5708 of changing the hint's behavior a little.)

frenzibyte commented 2 years ago

Testing on my end with an M1 machine on an SDL game with multi-threaded model, I can confirm this is fully resolved now!

slouken commented 2 years ago

Great, thanks!

def- commented 2 years ago

By very aggressively moving the window and resizing it between two screens, using Rectangle, I am still getting a crash. Not sure if this is a new issue since it happens in SDL_PollEvent now:

Crash log (click to expand) ``` ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Process: DDNet [84814] Path: /Users/USER/*/DDNet Identifier: DDNet Version: ??? Code Type: ARM-64 (Native) Parent Process: zsh [83450] Responsible: iTerm2 [896] User ID: 501 Date/Time: 2022-08-10 18:04:01.1374 +0200 OS Version: macOS 12.5 (21G72) Report Version: 12 Anonymous UUID: 3AB7E5C0-6273-0D0C-4A67-105D60AF53FE Time Awake Since Boot: 24000 seconds System Integrity Protection: enabled Crashed Thread: 9 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000a250d7799390 -> 0x00002250d7799390 (possible pointer authentication failure) Exception Codes: 0x0000000000000001, 0x0000a250d7799390 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [84814] VM Region Info: 0x2250d7799390 is not in any region. Bytes after previous region: 37249571459985 Bytes before following region: 67822508469360 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL commpage (reserved) 1000000000-7000000000 [384.0G] ---/--- SM=NUL ...(unallocated) ---> GAP OF 0x5f9000000000 BYTES MALLOC_NANO 600000000000-600008000000 [128.0M] rw-/rwx SM=PRV Thread 0:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x181618834 __ulock_wait + 8 1 libsystem_platform.dylib 0x181669108 _os_unfair_lock_lock_slow + 204 2 AppleMetalOpenGLRenderer 0x10d70e894 gldAttachDrawable + 384 3 GLEngine 0x1e2fe9b98 gliAttachDrawableWithOptions + 252 4 OpenGL 0x1e2dcf7e4 0x1e2dcb000 + 18404 5 OpenGL 0x1e2dd0624 CGLSetVirtualScreen + 128 6 AppKit 0x18490ec58 NSOpenGLContextUpdateOffScreenViewSurface + 612 7 AppKit 0x1845d0250 -[NSOpenGLContext update] + 376 8 SDL2 0x10132ac14 __34-[SDLOpenGLContext explicitUpdate]_block_invoke + 64 9 libdispatch.dylib 0x18148e5f0 _dispatch_call_block_and_release + 32 10 libdispatch.dylib 0x1814901b4 _dispatch_client_callout + 20 11 libdispatch.dylib 0x18149e6cc _dispatch_main_queue_drain + 928 12 libdispatch.dylib 0x18149e31c _dispatch_main_queue_callback_4CF + 44 13 CoreFoundation 0x181762a2c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 14 CoreFoundation 0x18171fcb8 __CFRunLoopRun + 2532 15 CoreFoundation 0x18171eb34 CFRunLoopRunSpecific + 600 16 HIToolbox 0x18a35e338 RunCurrentEventLoopInMode + 292 17 HIToolbox 0x18a35dfc4 ReceiveNextEventCommon + 324 18 HIToolbox 0x18a35de68 _BlockUntilNextEventMatchingListInModeWithFilter + 72 19 AppKit 0x18428651c _DPSNextEvent + 860 20 AppKit 0x184284e14 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1328 21 SDL2 0x101325568 Cocoa_PumpEventsUntilDate + 84 22 SDL2 0x101325740 Cocoa_PumpEvents + 72 23 SDL2 0x10122d8ec SDL_PumpEventsInternal + 68 24 SDL2 0x10122d9fc SDL_WaitEventTimeout_REAL + 88 25 SDL2 0x10122d998 SDL_PollEvent_REAL + 28 26 SDL2 0x10121319c SDL_PollEvent + 36 27 DDNet 0x10096f158 CInput::Update() + 272 (input.cpp:553) 28 DDNet 0x100951c50 CClient::Run() + 2380 (client.cpp:3255) 29 DDNet 0x1009589f8 TWMain + 3292 (client.cpp:4762) 30 dyld 0x100f6508c start + 520 Thread 1: 0 libsystem_kernel.dylib 0x181645594 sem_wait + 8 1 DDNet 0x10091f978 sphore_wait + 8 (system.cpp:909) [inlined] 2 DDNet 0x10091f978 aio_thread(void*) + 216 (system.cpp:482) 3 DDNet 0x100920598 thread_run(void*) + 48 (system.cpp:722) 4 libsystem_pthread.dylib 0x18165426c _pthread_start + 148 5 libsystem_pthread.dylib 0x18164f08c thread_start + 8 Thread 2: 0 libsystem_kernel.dylib 0x181645594 sem_wait + 8 1 DDNet 0x100906798 CJobPool::WorkerThread(void*) + 112 (jobs.cpp:58) 2 DDNet 0x100920598 thread_run(void*) + 48 (system.cpp:722) 3 libsystem_pthread.dylib 0x18165426c _pthread_start + 148 4 libsystem_pthread.dylib 0x18164f08c thread_start + 8 Thread 3: 0 libsystem_kernel.dylib 0x181645594 sem_wait + 8 1 DDNet 0x100906798 CJobPool::WorkerThread(void*) + 112 (jobs.cpp:58) 2 DDNet 0x100920598 thread_run(void*) + 48 (system.cpp:722) 3 libsystem_pthread.dylib 0x18165426c _pthread_start + 148 4 libsystem_pthread.dylib 0x18164f08c thread_start + 8 Thread 4: 0 libsystem_kernel.dylib 0x181645594 sem_wait + 8 1 DDNet 0x10091f978 sphore_wait + 8 (system.cpp:909) [inlined] 2 DDNet 0x10091f978 aio_thread(void*) + 216 (system.cpp:482) 3 DDNet 0x100920598 thread_run(void*) + 48 (system.cpp:722) 4 libsystem_pthread.dylib 0x18165426c _pthread_start + 148 5 libsystem_pthread.dylib 0x18164f08c thread_start + 8 Thread 5:: Dispatch queue: com.apple.SkyLight.UpdateManager.SerialSema 0 libsystem_kernel.dylib 0x1816168ec semaphore_wait_trap + 8 1 SkyLight 0x18686fe3c invocation function for block in (anonymous namespace)::InterprocessSerialSemaphore::asyncWait(void (int) block_pointer) + 40 2 libdispatch.dylib 0x18148e5f0 _dispatch_call_block_and_release + 32 3 libdispatch.dylib 0x1814901b4 _dispatch_client_callout + 20 4 libdispatch.dylib 0x1814978a8 _dispatch_lane_serial_drain + 668 5 libdispatch.dylib 0x181498404 _dispatch_lane_invoke + 392 6 libdispatch.dylib 0x1814a2c98 _dispatch_workloop_worker_thread + 648 7 libsystem_pthread.dylib 0x181650360 _pthread_wqthread + 288 8 libsystem_pthread.dylib 0x18164f080 start_wqthread + 8 Thread 6: 0 libsystem_pthread.dylib 0x18164f078 start_wqthread + 0 Thread 7:: Dispatch queue: NSCGSDisableUpdates 0 libsystem_kernel.dylib 0x181616904 semaphore_timedwait_trap + 8 1 libdispatch.dylib 0x1814907cc _dispatch_sema4_timedwait + 64 2 libdispatch.dylib 0x181490dc0 _dispatch_semaphore_wait_slow + 76 3 SkyLight 0x18686fc6c CGSUpdateManager::enable_updates_common() + 948 4 SkyLight 0x1868707bc SLSReenableUpdateTokenWithSeed + 124 5 libdispatch.dylib 0x18148e5f0 _dispatch_call_block_and_release + 32 6 libdispatch.dylib 0x1814901b4 _dispatch_client_callout + 20 7 libdispatch.dylib 0x1814978a8 _dispatch_lane_serial_drain + 668 8 libdispatch.dylib 0x181498404 _dispatch_lane_invoke + 392 9 libdispatch.dylib 0x1814a2c98 _dispatch_workloop_worker_thread + 648 10 libsystem_pthread.dylib 0x181650360 _pthread_wqthread + 288 11 libsystem_pthread.dylib 0x18164f080 start_wqthread + 8 Thread 8:: OGL Profiler 0 libsystem_kernel.dylib 0x1816168b0 mach_msg_trap + 8 1 libsystem_kernel.dylib 0x181616d20 mach_msg + 76 2 OpenGL 0x1e2dcd88c glcDebugListener + 408 3 libsystem_pthread.dylib 0x18165426c _pthread_start + 148 4 libsystem_pthread.dylib 0x18164f08c thread_start + 8 Thread 9 Crashed: 0 libobjc.A.dylib 0x1814da5a0 objc_msgSend + 32 1 AppleMetalOpenGLRenderer 0x10d6f5dc4 GLDTextureRec::getTextureResource(unsigned int, bool) + 384 2 AppleMetalOpenGLRenderer 0x10d700070 GLDContextRec::addRenderPassResources() + 64 3 AppleMetalOpenGLRenderer 0x10d700360 GLDContextRec::beginRenderPass() + 612 4 AppleMetalOpenGLRenderer 0x10d717884 gldRenderVertexArray(GLDContextRec*, unsigned int, unsigned int, int, int, unsigned int, void const*, int, void const*) + 500 5 GLEngine 0x1e3085978 glDrawElements_GL3Exec + 296 6 DDNet 0x10093f1a0 CCommandProcessorFragment_OpenGL3_3::Cmd_RenderQuadLayer(CCommandBuffer::SCommand_RenderQuadLayer const*) + 512 (backend_opengl3.cpp:1242) 7 DDNet 0x100936598 CCommandProcessorFragment_OpenGL::RunCommand(CCommandBuffer::SCommand const*) + 472 8 DDNet 0x1009434e4 CCommandProcessor_SDL_GL::RunBuffer(CCommandBuffer*) + 152 (backend_sdl.cpp:232) 9 DDNet 0x100942ae0 CGraphicsBackend_Threaded::ThreadFunc(void*) + 252 (backend_sdl.cpp:61) 10 DDNet 0x100920598 thread_run(void*) + 48 (system.cpp:722) 11 libsystem_pthread.dylib 0x18165426c _pthread_start + 148 12 libsystem_pthread.dylib 0x18164f08c thread_start + 8 Thread 10:: AMCP Logging Spool 0 libsystem_kernel.dylib 0x1816168ec semaphore_wait_trap + 8 1 caulk 0x18a0c9a2c caulk::mach::semaphore::wait_or_error() + 28 2 caulk 0x18a0ad7ac caulk::concurrent::details::worker_thread::run() + 56 3 caulk 0x18a0ad3cc void* caulk::thread_proxy > >(void*) + 96 4 libsystem_pthread.dylib 0x18165426c _pthread_start + 148 5 libsystem_pthread.dylib 0x18164f08c thread_start + 8 Thread 11: 0 libsystem_pthread.dylib 0x18164f078 start_wqthread + 0 Thread 12: 0 libsystem_pthread.dylib 0x18164f078 start_wqthread + 0 Thread 13:: AudioQueue thread 0 libsystem_kernel.dylib 0x1816168b0 mach_msg_trap + 8 1 libsystem_kernel.dylib 0x181616d20 mach_msg + 76 2 CoreFoundation 0x1817212c0 __CFRunLoopServiceMachPort + 372 3 CoreFoundation 0x18171f770 __CFRunLoopRun + 1180 4 CoreFoundation 0x18171eb34 CFRunLoopRunSpecific + 600 5 SDL2 0x10134d4b8 audioqueue_thread + 248 6 SDL2 0x1012a3a1c SDL_RunThread + 88 7 SDL2 0x10133a948 RunThread + 24 8 libsystem_pthread.dylib 0x18165426c _pthread_start + 148 9 libsystem_pthread.dylib 0x18164f08c thread_start + 8 Thread 14: 0 libsystem_kernel.dylib 0x1816168ec semaphore_wait_trap + 8 1 caulk 0x18a0c9a2c caulk::mach::semaphore::wait_or_error() + 28 2 caulk 0x18a0ad7ac caulk::concurrent::details::worker_thread::run() + 56 3 caulk 0x18a0ad3cc void* caulk::thread_proxy > >(void*) + 96 4 libsystem_pthread.dylib 0x18165426c _pthread_start + 148 5 libsystem_pthread.dylib 0x18164f08c thread_start + 8 Thread 15:: AQConverterThread 0 libsystem_kernel.dylib 0x18161a270 __psynch_cvwait + 8 1 libsystem_pthread.dylib 0x18165483c _pthread_cond_wait + 1236 2 libAudioToolboxUtility.dylib 0x18dcca430 CADeprecated::CAGuard::Wait() + 60 3 AudioToolbox 0x18edd944c AQConverterManager::AQConverterThread::ConverterThreadEntry(void*) + 720 4 libAudioToolboxUtility.dylib 0x18dcac2fc CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*) + 92 5 libsystem_pthread.dylib 0x18165426c _pthread_start + 148 6 libsystem_pthread.dylib 0x18164f08c thread_start + 8 Thread 16:: com.apple.audio.IOThread.client 0 libsystem_kernel.dylib 0x1816168b0 mach_msg_trap + 8 1 libsystem_kernel.dylib 0x181616d20 mach_msg + 76 2 CoreAudio 0x1833666a0 HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int) + 104 3 CoreAudio 0x1831f3bb0 HALC_ProxyIOContext::IOWorkLoop() + 3336 4 CoreAudio 0x1831f28b0 invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) + 100 5 CoreAudio 0x1833beab0 HALB_IOThread::Entry(void*) + 88 6 libsystem_pthread.dylib 0x18165426c _pthread_start + 148 7 libsystem_pthread.dylib 0x18164f08c thread_start + 8 Thread 17:: com.apple.NSEventThread 0 libsystem_kernel.dylib 0x1816168b0 mach_msg_trap + 8 1 libsystem_kernel.dylib 0x181616d20 mach_msg + 76 2 CoreFoundation 0x1817212c0 __CFRunLoopServiceMachPort + 372 3 CoreFoundation 0x18171f770 __CFRunLoopRun + 1180 4 CoreFoundation 0x18171eb34 CFRunLoopRunSpecific + 600 5 AppKit 0x1843f3100 _NSEventThread + 196 6 libsystem_pthread.dylib 0x18165426c _pthread_start + 148 7 libsystem_pthread.dylib 0x18164f08c thread_start + 8 Thread 18: 0 libsystem_pthread.dylib 0x18164f078 start_wqthread + 0 Thread 9 crashed with ARM Thread State (64-bit): x0: 0x0000600003ea9380 x1: 0x00000001cb9b18d6 x2: 0x0000000000000102 x3: 0x0000000000000000 x4: 0x0000000000000000 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000000 x8: 0x0000000134638fa8 x9: 0x0000000000000103 x10: 0x6ae1600003ea9380 x11: 0x0000000000000002 x12: 0x0000000000000001 x13: 0x0000a250d7799380 x14: 0x00006000039bdf00 x15: 0x0000a250d7799380 x16: 0x0000a250d7799380 x17: 0x000000010d740300 x18: 0x0000000000000000 x19: 0x0000000000000000 x20: 0x000060000300d200 x21: 0x0000000134638d80 x22: 0x0000000000000000 x23: 0x0000000134638dbc x24: 0x0000000138052a68 x25: 0x0000000145161400 x26: 0x0000000000000000 x27: 0x000000016fa1d660 x28: 0x0000000000000000 fp: 0x000000016fa1cb50 lr: 0x000000010d6f5dc4 sp: 0x000000016fa1cb10 pc: 0x00000001814da5a0 cpsr: 0x20001000 far: 0x0000a250d7799390 esr: 0x92000004 (Data Abort) byte read Translation fault Binary Images: 0x181615000 - 0x18164cfff libsystem_kernel.dylib (*) <67f22904-88ed-3847-bbf0-5c4c599fd79e> /usr/lib/system/libsystem_kernel.dylib 0x181667000 - 0x18166efff libsystem_platform.dylib (*) <6f19bd1b-352c-3ff0-b9c0-03ceafebfe22> /usr/lib/system/libsystem_platform.dylib 0x10d6d0000 - 0x10d73ffff com.apple.AppleMetalOpenGLRenderer (1.0) <4417dc10-8858-309e-b508-1ad2acd31756> /System/Library/Extensions/AppleMetalOpenGLRenderer.bundle/Contents/MacOS/AppleMetalOpenGLRenderer 0x1e2fd6000 - 0x1e3144fff GLEngine (*) /System/Library/Frameworks/OpenGL.framework/Versions/A/Resources/GLEngine.bundle/GLEngine 0x1e2dcb000 - 0x1e2ddbfff com.apple.opengl (19.5.1) /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL 0x184245000 - 0x1850fdfff com.apple.AppKit (6.9) <07bc3607-552a-3eb9-a941-4911c589dbc5> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x1011fc000 - 0x101387fff org.libsdl.SDL2 (2.0.20) /Users/USER/*/SDL2.framework/Versions/A/SDL2 0x18148c000 - 0x1814d2fff libdispatch.dylib (*) <035d23d9-4cb5-3759-9059-1f7878f89fee> /usr/lib/system/libdispatch.dylib 0x18169c000 - 0x181be2fff com.apple.CoreFoundation (6.9) <1643f3d9-7049-37e4-b844-c0c0a42bde3b> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x18a32c000 - 0x18a65ffff com.apple.HIToolbox (2.1.1) <7112f6f2-a77e-39db-83c8-f627b8a49df8> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox 0x1008c8000 - 0x100aaffff DDNet (*) <754f7ef0-a4db-3db5-ad89-ab7ad6765967> /Users/USER/*/DDNet 0x100f60000 - 0x100fbffff dyld (*) <75627683-a780-32ad-ae34-cf86dd23a26b> /usr/lib/dyld 0x18164d000 - 0x181659fff libsystem_pthread.dylib (*) /usr/lib/system/libsystem_pthread.dylib 0x186806000 - 0x186be1fff com.apple.SkyLight (1.600.0) <73d946b4-c187-3095-bc77-59ad2d0da9bc> /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight 0x1814d3000 - 0x181510fff libobjc.A.dylib (*) <3d936842-5903-31ad-b1ae-1de4f4b448a6> /usr/lib/libobjc.A.dylib 0x18a0ab000 - 0x18a0d1fff com.apple.audio.caulk (1.0) <99842553-96fc-378e-b39a-67294face1e3> /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk 0x18dc9f000 - 0x18dcd0fff libAudioToolboxUtility.dylib (*) <1cc3fc06-0d65-3bab-81aa-69ab88439382> /usr/lib/libAudioToolboxUtility.dylib 0x18eda6000 - 0x18eee6fff com.apple.audio.toolbox.AudioToolbox (1.14) <300db1b1-6dd9-3494-b314-36e68b4f7553> /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox 0x183032000 - 0x183755fff com.apple.audio.CoreAudio (5.0) /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio 0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ??? 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=942.4M resident=0K(0%) swapped_out_or_unallocated=942.4M(100%) Writable regions: Total=1.7G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.7G(100%) VIRTUAL REGION REGION TYPE SIZE COUNT (non-coalesced) =========== ======= ======= Accelerate framework 768K 6 Activity Tracing 256K 1 CG backing stores 5376K 8 CG image 128K 6 ColorSync 576K 25 CoreAnimation 144K 9 CoreGraphics 32K 2 CoreUI image data 1056K 9 Foundation 48K 2 Image IO 16K 1 Kernel Alloc Once 32K 1 MALLOC 515.2M 86 MALLOC guard page 192K 10 MALLOC_MEDIUM (reserved) 824.0M 8 reserved VM address space (unallocated) MALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated) OpenGL GLSL 256K 3 SQLite page cache 64K 1 STACK GUARD 56.3M 19 Stack 17.5M 19 VM_ALLOCATE 4080K 213 __AUTH 2090K 221 __AUTH_CONST 13.3M 389 __CTF 756 1 __DATA 20.7M 437 __DATA_CONST 16.0M 456 __DATA_DIRTY 1117K 141 __FONT_DATA 4K 1 __GLSLBUILTINS 5176K 1 __LINKEDIT 586.2M 69 __OBJC_CONST 2357K 191 __OBJC_RO 83.0M 1 __OBJC_RW 3168K 1 __TEXT 356.2M 472 __UNICODE 592K 1 dyld private memory 1024K 1 mapped file 157.8M 23 shared memory 864K 16 =========== ======= ======= TOTAL 3.0G 2852 TOTAL, minus reserved VM space 1.8G 2852 ----------- Full Report ----------- {"app_name":"DDNet","timestamp":"2022-08-10 18:04:05.00 +0200","app_version":"","slice_uuid":"754f7ef0-a4db-3db5-ad89-ab7ad6765967","build_version":"","platform":1,"share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 12.5 (21G72)","incident_id":"F12361EF-EF05-43CE-967E-944872B9EE96","name":"DDNet"} { "uptime" : 24000, "procLaunch" : "2022-08-10 18:03:01.8398 +0200", "procRole" : "Foreground", "version" : 2, "userID" : 501, "deployVersion" : 210, "modelCode" : "MacBookPro18,1", "procStartAbsTime" : 582157131875, "coalitionID" : 582, "osVersion" : { "train" : "macOS 12.5", "build" : "21G72", "releaseType" : "User" }, "captureTime" : "2022-08-10 18:04:01.1374 +0200", "incident" : "F12361EF-EF05-43CE-967E-944872B9EE96", "bug_type" : "309", "pid" : 84814, "procExitAbsTime" : 583579735775, "translated" : false, "cpuType" : "ARM-64", "procName" : "DDNet", "procPath" : "\/Users\/USER\/*\/DDNet", "parentProc" : "zsh", "parentPid" : 83450, "coalitionName" : "com.googlecode.iterm2", "crashReporterKey" : "3AB7E5C0-6273-0D0C-4A67-105D60AF53FE", "responsiblePid" : 896, "responsibleProc" : "iTerm2", "sip" : "enabled", "vmRegionInfo" : "0x2250d7799390 is not in any region. Bytes after previous region: 37249571459985 Bytes before following region: 67822508469360\n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n commpage (reserved) 1000000000-7000000000 [384.0G] ---\/--- SM=NUL ...(unallocated)\n---> GAP OF 0x5f9000000000 BYTES\n MALLOC_NANO 600000000000-600008000000 [128.0M] rw-\/rwx SM=PRV ", "isCorpse" : 1, "exception" : {"codes":"0x0000000000000001, 0x0000a250d7799390","rawCodes":[1,178468096152464],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x0000a250d7799390 -> 0x00002250d7799390 (possible pointer authentication failure)"}, "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":84814}, "vmregioninfo" : "0x2250d7799390 is not in any region. Bytes after previous region: 37249571459985 Bytes before following region: 67822508469360\n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n commpage (reserved) 1000000000-7000000000 [384.0G] ---\/--- SM=NUL ...(unallocated)\n---> GAP OF 0x5f9000000000 BYTES\n MALLOC_NANO 600000000000-600008000000 [128.0M] rw-\/rwx SM=PRV ", "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0}, "faultingThread" : 9, "threads" : [{"id":1279219,"queue":"com.apple.main-thread","frames":[{"imageOffset":14388,"symbol":"__ulock_wait","symbolLocation":8,"imageIndex":0},{"imageOffset":8456,"symbol":"_os_unfair_lock_lock_slow","symbolLocation":204,"imageIndex":1},{"imageOffset":256148,"symbol":"gldAttachDrawable","symbolLocation":384,"imageIndex":2},{"imageOffset":80792,"symbol":"gliAttachDrawableWithOptions","symbolLocation":252,"imageIndex":3},{"imageOffset":18404,"imageIndex":4},{"imageOffset":22052,"symbol":"CGLSetVirtualScreen","symbolLocation":128,"imageIndex":4},{"imageOffset":7117912,"symbol":"NSOpenGLContextUpdateOffScreenViewSurface","symbolLocation":612,"imageIndex":5},{"imageOffset":3715664,"symbol":"-[NSOpenGLContext update]","symbolLocation":376,"imageIndex":5},{"imageOffset":1240084,"symbol":"__34-[SDLOpenGLContext explicitUpdate]_block_invoke","symbolLocation":64,"imageIndex":6},{"imageOffset":9712,"symbol":"_dispatch_call_block_and_release","symbolLocation":32,"imageIndex":7},{"imageOffset":16820,"symbol":"_dispatch_client_callout","symbolLocation":20,"imageIndex":7},{"imageOffset":75468,"symbol":"_dispatch_main_queue_drain","symbolLocation":928,"imageIndex":7},{"imageOffset":74524,"symbol":"_dispatch_main_queue_callback_4CF","symbolLocation":44,"imageIndex":7},{"imageOffset":813612,"symbol":"__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__","symbolLocation":16,"imageIndex":8},{"imageOffset":539832,"symbol":"__CFRunLoopRun","symbolLocation":2532,"imageIndex":8},{"imageOffset":535348,"symbol":"CFRunLoopRunSpecific","symbolLocation":600,"imageIndex":8},{"imageOffset":205624,"symbol":"RunCurrentEventLoopInMode","symbolLocation":292,"imageIndex":9},{"imageOffset":204740,"symbol":"ReceiveNextEventCommon","symbolLocation":324,"imageIndex":9},{"imageOffset":204392,"symbol":"_BlockUntilNextEventMatchingListInModeWithFilter","symbolLocation":72,"imageIndex":9},{"imageOffset":267548,"symbol":"_DPSNextEvent","symbolLocation":860,"imageIndex":5},{"imageOffset":261652,"symbol":"-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]","symbolLocation":1328,"imageIndex":5},{"imageOffset":1217896,"symbol":"Cocoa_PumpEventsUntilDate","symbolLocation":84,"imageIndex":6},{"imageOffset":1218368,"symbol":"Cocoa_PumpEvents","symbolLocation":72,"imageIndex":6},{"imageOffset":202988,"symbol":"SDL_PumpEventsInternal","symbolLocation":68,"imageIndex":6},{"imageOffset":203260,"symbol":"SDL_WaitEventTimeout_REAL","symbolLocation":88,"imageIndex":6},{"imageOffset":203160,"symbol":"SDL_PollEvent_REAL","symbolLocation":28,"imageIndex":6},{"imageOffset":94620,"symbol":"SDL_PollEvent","symbolLocation":36,"imageIndex":6},{"imageOffset":684376,"sourceLine":553,"sourceFile":"input.cpp","symbol":"CInput::Update()","imageIndex":10,"symbolLocation":272},{"imageOffset":564304,"sourceLine":3255,"sourceFile":"client.cpp","symbol":"CClient::Run()","imageIndex":10,"symbolLocation":2380},{"imageOffset":592376,"sourceLine":4762,"sourceFile":"client.cpp","symbol":"TWMain","imageIndex":10,"symbolLocation":3292},{"imageOffset":20620,"symbol":"start","symbolLocation":520,"imageIndex":11}]},{"id":1279222,"frames":[{"imageOffset":198036,"symbol":"sem_wait","symbolLocation":8,"imageIndex":0},{"symbol":"sphore_wait","inline":true,"imageIndex":10,"imageOffset":358776,"symbolLocation":8,"sourceLine":909,"sourceFile":"system.cpp"},{"imageOffset":358776,"sourceLine":482,"sourceFile":"system.cpp","symbol":"aio_thread(void*)","imageIndex":10,"symbolLocation":216},{"imageOffset":361880,"sourceLine":722,"sourceFile":"system.cpp","symbol":"thread_run(void*)","imageIndex":10,"symbolLocation":48},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":12},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":12}]},{"id":1279223,"frames":[{"imageOffset":198036,"symbol":"sem_wait","symbolLocation":8,"imageIndex":0},{"imageOffset":255896,"sourceLine":58,"sourceFile":"jobs.cpp","symbol":"CJobPool::WorkerThread(void*)","imageIndex":10,"symbolLocation":112},{"imageOffset":361880,"sourceLine":722,"sourceFile":"system.cpp","symbol":"thread_run(void*)","imageIndex":10,"symbolLocation":48},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":12},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":12}]},{"id":1279224,"frames":[{"imageOffset":198036,"symbol":"sem_wait","symbolLocation":8,"imageIndex":0},{"imageOffset":255896,"sourceLine":58,"sourceFile":"jobs.cpp","symbol":"CJobPool::WorkerThread(void*)","imageIndex":10,"symbolLocation":112},{"imageOffset":361880,"sourceLine":722,"sourceFile":"system.cpp","symbol":"thread_run(void*)","imageIndex":10,"symbolLocation":48},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":12},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":12}]},{"id":1279225,"frames":[{"imageOffset":198036,"symbol":"sem_wait","symbolLocation":8,"imageIndex":0},{"symbol":"sphore_wait","inline":true,"imageIndex":10,"imageOffset":358776,"symbolLocation":8,"sourceLine":909,"sourceFile":"system.cpp"},{"imageOffset":358776,"sourceLine":482,"sourceFile":"system.cpp","symbol":"aio_thread(void*)","imageIndex":10,"symbolLocation":216},{"imageOffset":361880,"sourceLine":722,"sourceFile":"system.cpp","symbol":"thread_run(void*)","imageIndex":10,"symbolLocation":48},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":12},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":12}]},{"id":1279226,"queue":"com.apple.SkyLight.UpdateManager.SerialSema","frames":[{"imageOffset":6380,"symbol":"semaphore_wait_trap","symbolLocation":8,"imageIndex":0},{"imageOffset":433724,"symbol":"invocation function for block in (anonymous namespace)::InterprocessSerialSemaphore::asyncWait(void (int) block_pointer)","symbolLocation":40,"imageIndex":13},{"imageOffset":9712,"symbol":"_dispatch_call_block_and_release","symbolLocation":32,"imageIndex":7},{"imageOffset":16820,"symbol":"_dispatch_client_callout","symbolLocation":20,"imageIndex":7},{"imageOffset":47272,"symbol":"_dispatch_lane_serial_drain","symbolLocation":668,"imageIndex":7},{"imageOffset":50180,"symbol":"_dispatch_lane_invoke","symbolLocation":392,"imageIndex":7},{"imageOffset":93336,"symbol":"_dispatch_workloop_worker_thread","symbolLocation":648,"imageIndex":7},{"imageOffset":13152,"symbol":"_pthread_wqthread","symbolLocation":288,"imageIndex":12},{"imageOffset":8320,"symbol":"start_wqthread","symbolLocation":8,"imageIndex":12}]},{"id":1279227,"frames":[{"imageOffset":8312,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":12}]},{"id":1279236,"queue":"NSCGSDisableUpdates","frames":[{"imageOffset":6404,"symbol":"semaphore_timedwait_trap","symbolLocation":8,"imageIndex":0},{"imageOffset":18380,"symbol":"_dispatch_sema4_timedwait","symbolLocation":64,"imageIndex":7},{"imageOffset":19904,"symbol":"_dispatch_semaphore_wait_slow","symbolLocation":76,"imageIndex":7},{"imageOffset":433260,"symbol":"CGSUpdateManager::enable_updates_common()","symbolLocation":948,"imageIndex":13},{"imageOffset":436156,"symbol":"SLSReenableUpdateTokenWithSeed","symbolLocation":124,"imageIndex":13},{"imageOffset":9712,"symbol":"_dispatch_call_block_and_release","symbolLocation":32,"imageIndex":7},{"imageOffset":16820,"symbol":"_dispatch_client_callout","symbolLocation":20,"imageIndex":7},{"imageOffset":47272,"symbol":"_dispatch_lane_serial_drain","symbolLocation":668,"imageIndex":7},{"imageOffset":50180,"symbol":"_dispatch_lane_invoke","symbolLocation":392,"imageIndex":7},{"imageOffset":93336,"symbol":"_dispatch_workloop_worker_thread","symbolLocation":648,"imageIndex":7},{"imageOffset":13152,"symbol":"_pthread_wqthread","symbolLocation":288,"imageIndex":12},{"imageOffset":8320,"symbol":"start_wqthread","symbolLocation":8,"imageIndex":12}]},{"id":1279242,"name":"OGL Profiler","frames":[{"imageOffset":6320,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":0},{"imageOffset":7456,"symbol":"mach_msg","symbolLocation":76,"imageIndex":0},{"imageOffset":10380,"symbol":"glcDebugListener","symbolLocation":408,"imageIndex":4},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":12},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":12}]},{"triggered":true,"id":1279243,"threadState":{"x":[{"value":105553181971328},{"value":7710906582,"objc-selector":"sampleCount"},{"value":258},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":5173907368},{"value":259},{"value":7701542390962230144},{"value":2},{"value":1},{"value":178468096152448},{"value":105553176813312},{"value":178468096152448},{"value":178468096152448},{"value":4520674048},{"value":0},{"value":0},{"value":105553166651904},{"value":5173906816},{"value":0},{"value":5173906876},{"value":5234829928},{"value":5454042112},{"value":0},{"value":6167844448},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":4520369604},"cpsr":{"value":536875008},"fp":{"value":6167841616},"sp":{"value":6167841552},"esr":{"value":2449473540,"description":"(Data Abort) byte read Translation fault"},"pc":{"value":6464316832,"matchesCrashFrame":1},"far":{"value":178468096152464}},"frames":[{"imageOffset":30112,"symbol":"objc_msgSend","symbolLocation":32,"imageIndex":14},{"imageOffset":155076,"symbol":"GLDTextureRec::getTextureResource(unsigned int, bool)","symbolLocation":384,"imageIndex":2},{"imageOffset":196720,"symbol":"GLDContextRec::addRenderPassResources()","symbolLocation":64,"imageIndex":2},{"imageOffset":197472,"symbol":"GLDContextRec::beginRenderPass()","symbolLocation":612,"imageIndex":2},{"imageOffset":292996,"symbol":"gldRenderVertexArray(GLDContextRec*, unsigned int, unsigned int, int, int, unsigned int, void const*, int, void const*)","symbolLocation":500,"imageIndex":2},{"imageOffset":719224,"symbol":"glDrawElements_GL3Exec","symbolLocation":296,"imageIndex":3},{"imageOffset":487840,"sourceLine":1242,"sourceFile":"backend_opengl3.cpp","symbol":"CCommandProcessorFragment_OpenGL3_3::Cmd_RenderQuadLayer(CCommandBuffer::SCommand_RenderQuadLayer const*)","imageIndex":10,"symbolLocation":512},{"imageOffset":451992,"sourceFile":"backend_opengl.cpp","symbol":"CCommandProcessorFragment_OpenGL::RunCommand(CCommandBuffer::SCommand const*)","symbolLocation":472,"imageIndex":10},{"imageOffset":505060,"sourceLine":232,"sourceFile":"backend_sdl.cpp","symbol":"CCommandProcessor_SDL_GL::RunBuffer(CCommandBuffer*)","imageIndex":10,"symbolLocation":152},{"imageOffset":502496,"sourceLine":61,"sourceFile":"backend_sdl.cpp","symbol":"CGraphicsBackend_Threaded::ThreadFunc(void*)","imageIndex":10,"symbolLocation":252},{"imageOffset":361880,"sourceLine":722,"sourceFile":"system.cpp","symbol":"thread_run(void*)","imageIndex":10,"symbolLocation":48},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":12},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":12}]},{"id":1279244,"name":"AMCP Logging Spool","frames":[{"imageOffset":6380,"symbol":"semaphore_wait_trap","symbolLocation":8,"imageIndex":0},{"imageOffset":125484,"symbol":"caulk::mach::semaphore::wait_or_error()","symbolLocation":28,"imageIndex":15},{"imageOffset":10156,"symbol":"caulk::concurrent::details::worker_thread::run()","symbolLocation":56,"imageIndex":15},{"imageOffset":9164,"symbol":"void* caulk::thread_proxy > >(void*)","symbolLocation":96,"imageIndex":15},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":12},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":12}]},{"id":1279250,"frames":[{"imageOffset":8312,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":12}]},{"id":1279257,"frames":[{"imageOffset":8312,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":12}]},{"id":1279260,"name":"AudioQueue thread","frames":[{"imageOffset":6320,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":0},{"imageOffset":7456,"symbol":"mach_msg","symbolLocation":76,"imageIndex":0},{"imageOffset":545472,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":372,"imageIndex":8},{"imageOffset":538480,"symbol":"__CFRunLoopRun","symbolLocation":1180,"imageIndex":8},{"imageOffset":535348,"symbol":"CFRunLoopRunSpecific","symbolLocation":600,"imageIndex":8},{"imageOffset":1381560,"symbol":"audioqueue_thread","symbolLocation":248,"imageIndex":6},{"imageOffset":686620,"symbol":"SDL_RunThread","symbolLocation":88,"imageIndex":6},{"imageOffset":1304904,"symbol":"RunThread","symbolLocation":24,"imageIndex":6},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":12},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":12}]},{"id":1279261,"frames":[{"imageOffset":6380,"symbol":"semaphore_wait_trap","symbolLocation":8,"imageIndex":0},{"imageOffset":125484,"symbol":"caulk::mach::semaphore::wait_or_error()","symbolLocation":28,"imageIndex":15},{"imageOffset":10156,"symbol":"caulk::concurrent::details::worker_thread::run()","symbolLocation":56,"imageIndex":15},{"imageOffset":9164,"symbol":"void* caulk::thread_proxy > >(void*)","symbolLocation":96,"imageIndex":15},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":12},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":12}]},{"id":1279262,"name":"AQConverterThread","frames":[{"imageOffset":21104,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":0},{"imageOffset":30780,"symbol":"_pthread_cond_wait","symbolLocation":1236,"imageIndex":12},{"imageOffset":177200,"symbol":"CADeprecated::CAGuard::Wait()","symbolLocation":60,"imageIndex":16},{"imageOffset":209996,"symbol":"AQConverterManager::AQConverterThread::ConverterThreadEntry(void*)","symbolLocation":720,"imageIndex":17},{"imageOffset":54012,"symbol":"CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*)","symbolLocation":92,"imageIndex":16},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":12},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":12}]},{"id":1279263,"name":"com.apple.audio.IOThread.client","frames":[{"imageOffset":6320,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":0},{"imageOffset":7456,"symbol":"mach_msg","symbolLocation":76,"imageIndex":0},{"imageOffset":3360416,"symbol":"HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int)","symbolLocation":104,"imageIndex":18},{"imageOffset":1842096,"symbol":"HALC_ProxyIOContext::IOWorkLoop()","symbolLocation":3336,"imageIndex":18},{"imageOffset":1837232,"symbol":"invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int)","symbolLocation":100,"imageIndex":18},{"imageOffset":3721904,"symbol":"HALB_IOThread::Entry(void*)","symbolLocation":88,"imageIndex":18},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":12},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":12}]},{"id":1279299,"name":"com.apple.NSEventThread","frames":[{"imageOffset":6320,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":0},{"imageOffset":7456,"symbol":"mach_msg","symbolLocation":76,"imageIndex":0},{"imageOffset":545472,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":372,"imageIndex":8},{"imageOffset":538480,"symbol":"__CFRunLoopRun","symbolLocation":1180,"imageIndex":8},{"imageOffset":535348,"symbol":"CFRunLoopRunSpecific","symbolLocation":600,"imageIndex":8},{"imageOffset":1761536,"symbol":"_NSEventThread","symbolLocation":196,"imageIndex":5},{"imageOffset":29292,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":12},{"imageOffset":8332,"symbol":"thread_start","symbolLocation":8,"imageIndex":12}]},{"id":1279809,"frames":[{"imageOffset":8312,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":12}]}], "usedImages" : [ { "source" : "P", "arch" : "arm64e", "base" : 6465605632, "size" : 229376, "uuid" : "67f22904-88ed-3847-bbf0-5c4c599fd79e", "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib", "name" : "libsystem_kernel.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 6465941504, "size" : 32768, "uuid" : "6f19bd1b-352c-3ff0-b9c0-03ceafebfe22", "path" : "\/usr\/lib\/system\/libsystem_platform.dylib", "name" : "libsystem_platform.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 4520214528, "CFBundleShortVersionString" : "1.0", "CFBundleIdentifier" : "com.apple.AppleMetalOpenGLRenderer", "size" : 458752, "uuid" : "4417dc10-8858-309e-b508-1ad2acd31756", "path" : "\/System\/Library\/Extensions\/AppleMetalOpenGLRenderer.bundle\/Contents\/MacOS\/AppleMetalOpenGLRenderer", "name" : "AppleMetalOpenGLRenderer", "CFBundleVersion" : "1" }, { "source" : "P", "arch" : "arm64e", "base" : 8103223296, "size" : 1503232, "uuid" : "cfa278b9-f6d3-33a1-883b-93f2bafd6a1e", "path" : "\/System\/Library\/Frameworks\/OpenGL.framework\/Versions\/A\/Resources\/GLEngine.bundle\/GLEngine", "name" : "GLEngine" }, { "source" : "P", "arch" : "arm64e", "base" : 8101081088, "CFBundleShortVersionString" : "19.5.1", "CFBundleIdentifier" : "com.apple.opengl", "size" : 69632, "uuid" : "f538e7dd-90fa-3ea1-ae05-3db879ca7c6a", "path" : "\/System\/Library\/Frameworks\/OpenGL.framework\/Versions\/A\/OpenGL", "name" : "OpenGL", "CFBundleVersion" : "19.5.1" }, { "source" : "P", "arch" : "arm64e", "base" : 6511939584, "CFBundleShortVersionString" : "6.9", "CFBundleIdentifier" : "com.apple.AppKit", "size" : 15437824, "uuid" : "07bc3607-552a-3eb9-a941-4911c589dbc5", "path" : "\/System\/Library\/Frameworks\/AppKit.framework\/Versions\/C\/AppKit", "name" : "AppKit", "CFBundleVersion" : "2113.60.148" }, { "source" : "P", "arch" : "arm64", "base" : 4313825280, "CFBundleShortVersionString" : "2.0.20", "CFBundleIdentifier" : "org.libsdl.SDL2", "size" : 1622016, "uuid" : "b0620fec-fa29-3917-a715-dc97a9bffab7", "path" : "\/Users\/USER\/*\/SDL2.framework\/Versions\/A\/SDL2", "name" : "SDL2", "CFBundleVersion" : "2.0.20" }, { "source" : "P", "arch" : "arm64e", "base" : 6463995904, "size" : 290816, "uuid" : "035d23d9-4cb5-3759-9059-1f7878f89fee", "path" : "\/usr\/lib\/system\/libdispatch.dylib", "name" : "libdispatch.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 6466158592, "CFBundleShortVersionString" : "6.9", "CFBundleIdentifier" : "com.apple.CoreFoundation", "size" : 5533696, "uuid" : "1643f3d9-7049-37e4-b844-c0c0a42bde3b", "path" : "\/System\/Library\/Frameworks\/CoreFoundation.framework\/Versions\/A\/CoreFoundation", "name" : "CoreFoundation", "CFBundleVersion" : "1866" }, { "source" : "P", "arch" : "arm64e", "base" : 6613549056, "CFBundleShortVersionString" : "2.1.1", "CFBundleIdentifier" : "com.apple.HIToolbox", "size" : 3358720, "uuid" : "7112f6f2-a77e-39db-83c8-f627b8a49df8", "path" : "\/System\/Library\/Frameworks\/Carbon.framework\/Versions\/A\/Frameworks\/HIToolbox.framework\/Versions\/A\/HIToolbox", "name" : "HIToolbox" }, { "source" : "P", "arch" : "arm64", "base" : 4304175104, "size" : 1998848, "uuid" : "754f7ef0-a4db-3db5-ad89-ab7ad6765967", "path" : "\/Users\/USER\/*\/DDNet", "name" : "DDNet" }, { "source" : "P", "arch" : "arm64e", "base" : 4311089152, "size" : 393216, "uuid" : "75627683-a780-32ad-ae34-cf86dd23a26b", "path" : "\/usr\/lib\/dyld", "name" : "dyld" }, { "source" : "P", "arch" : "arm64e", "base" : 6465835008, "size" : 53248, "uuid" : "f32ff902-ba43-30b0-ad43-a2a8a9ff69fe", "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib", "name" : "libsystem_pthread.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 6551527424, "CFBundleShortVersionString" : "1.600.0", "CFBundleIdentifier" : "com.apple.SkyLight", "size" : 4046848, "uuid" : "73d946b4-c187-3095-bc77-59ad2d0da9bc", "path" : "\/System\/Library\/PrivateFrameworks\/SkyLight.framework\/Versions\/A\/SkyLight", "name" : "SkyLight" }, { "source" : "P", "arch" : "arm64e", "base" : 6464286720, "size" : 253952, "uuid" : "3d936842-5903-31ad-b1ae-1de4f4b448a6", "path" : "\/usr\/lib\/libobjc.A.dylib", "name" : "libobjc.A.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 6610923520, "CFBundleShortVersionString" : "1.0", "CFBundleIdentifier" : "com.apple.audio.caulk", "size" : 159744, "uuid" : "99842553-96fc-378e-b39a-67294face1e3", "path" : "\/System\/Library\/PrivateFrameworks\/caulk.framework\/Versions\/A\/caulk", "name" : "caulk" }, { "source" : "P", "arch" : "arm64e", "base" : 6673788928, "size" : 204800, "uuid" : "1cc3fc06-0d65-3bab-81aa-69ab88439382", "path" : "\/usr\/lib\/libAudioToolboxUtility.dylib", "name" : "libAudioToolboxUtility.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 6691643392, "CFBundleShortVersionString" : "1.14", "CFBundleIdentifier" : "com.apple.audio.toolbox.AudioToolbox", "size" : 1314816, "uuid" : "300db1b1-6dd9-3494-b314-36e68b4f7553", "path" : "\/System\/Library\/Frameworks\/AudioToolbox.framework\/Versions\/A\/AudioToolbox", "name" : "AudioToolbox", "CFBundleVersion" : "1.14" }, { "source" : "P", "arch" : "arm64e", "base" : 6492987392, "CFBundleShortVersionString" : "5.0", "CFBundleIdentifier" : "com.apple.audio.CoreAudio", "size" : 7487488, "uuid" : "b5351932-ebac-3219-aa3a-0d088bcb59dd", "path" : "\/System\/Library\/Frameworks\/CoreAudio.framework\/Versions\/A\/CoreAudio", "name" : "CoreAudio", "CFBundleVersion" : "5.0" }, { "size" : 0, "source" : "A", "base" : 0, "uuid" : "00000000-0000-0000-0000-000000000000" } ], "sharedCache" : { "base" : 6462537728, "size" : 3144695808, "uuid" : "ffede77c-d90b-366b-96f2-665c2f50ee59" }, "vmSummary" : "ReadOnly portion of Libraries: Total=942.4M resident=0K(0%) swapped_out_or_unallocated=942.4M(100%)\nWritable regions: Total=1.7G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.7G(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nAccelerate framework 768K 6 \nActivity Tracing 256K 1 \nCG backing stores 5376K 8 \nCG image 128K 6 \nColorSync 576K 25 \nCoreAnimation 144K 9 \nCoreGraphics 32K 2 \nCoreUI image data 1056K 9 \nFoundation 48K 2 \nImage IO 16K 1 \nKernel Alloc Once 32K 1 \nMALLOC 515.2M 86 \nMALLOC guard page 192K 10 \nMALLOC_MEDIUM (reserved) 824.0M 8 reserved VM address space (unallocated)\nMALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated)\nOpenGL GLSL 256K 3 \nSQLite page cache 64K 1 \nSTACK GUARD 56.3M 19 \nStack 17.5M 19 \nVM_ALLOCATE 4080K 213 \n__AUTH 2090K 221 \n__AUTH_CONST 13.3M 389 \n__CTF 756 1 \n__DATA 20.7M 437 \n__DATA_CONST 16.0M 456 \n__DATA_DIRTY 1117K 141 \n__FONT_DATA 4K 1 \n__GLSLBUILTINS 5176K 1 \n__LINKEDIT 586.2M 69 \n__OBJC_CONST 2357K 191 \n__OBJC_RO 83.0M 1 \n__OBJC_RW 3168K 1 \n__TEXT 356.2M 472 \n__UNICODE 592K 1 \ndyld private memory 1024K 1 \nmapped file 157.8M 23 \nshared memory 864K 16 \n=========== ======= ======= \nTOTAL 3.0G 2852 \nTOTAL, minus reserved VM space 1.8G 2852 \n", "legacyInfo" : { "threadTriggered" : { } }, "trialInfo" : { "rollouts" : [ { "rolloutId" : "60da5e84ab0ca017dace9abf", "factorPackIds" : { }, "deploymentId" : 240000008 }, { "rolloutId" : "60356660bbe37970735c5624", "factorPackIds" : { }, "deploymentId" : 240000027 } ], "experiments" : [ ] } } Model: MacBookPro18,1, BootROM 7459.141.1, proc 10:8:2 processors, 16 GB, SMC Graphics: Apple M1 Pro, Apple M1 Pro, Built-In Display: LG HDR WQHD, 3440 x 1440 (UWQHD - Ultra-Wide Quad HD), Main, MirrorOff, Online Display: Color LCD, 3456 x 2234 Retina, MirrorOff, Online Memory Module: LPDDR5 AirPort: Wi-Fi, wl0: Apr 6 2022 05:55:54 version 20.90.45.0.8.7.118 FWID 01-e7138ff2 Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports Network Service: Wi-Fi, AirPort, en0 USB Device: USB31Bus USB Device: USB3.0 Hub USB Device: USB3.0 Hub USB Device: USB2.0 Hub USB Device: USB2.0 Hub USB Device: Mechanical Keyboard USB Device: USB Receiver USB Device: USB Billboard Device USB Device: AirPod Case USB Device: Jabra EVOLVE LINK MS USB Device: USB31Bus USB Device: USB31Bus USB Device: Lenovo USB-C to LAN Thunderbolt Bus: MacBook Pro, Apple Inc. Thunderbolt Bus: MacBook Pro, Apple Inc. Thunderbolt Bus: MacBook Pro, Apple Inc. ```

This is https://github.com/ddnet/ddnet with this diff to remove our workaround for this issue:

diff --git a/src/engine/client/graphics_threaded.cpp b/src/engine/client/graphics_threaded.cpp
index 060774731..05912db57 100644
--- a/src/engine/client/graphics_threaded.cpp
+++ b/src/engine/client/graphics_threaded.cpp
@@ -2755,11 +2755,6 @@ void CGraphics_Threaded::Swap()

        // kick the command buffer
        KickCommandBuffer();
-       // TODO: Remove when https://github.com/libsdl-org/SDL/issues/5203 is fixed
-#ifdef CONF_PLATFORM_MACOS
-       if(str_find(GetVersionString(), "Metal"))
-               WaitForIdle();
-#endif
 }

 bool CGraphics_Threaded::SetVSync(bool State)
icculus commented 2 years ago

In that crash report, thread 0 (the main thread) is doing the OpenGL context update that was sent through a dispatch queue, while thread 9 (the rendering thread?) is calling into the GL to draw, and this is causing a crash inside the GL.

Which leads me to ask: are you sure you used the right build of SDL? The latest in revision control, that changed the hint to default to synchronous updates? I don't see any threads that appear to be blocked, waiting on that update in the main thread to finish, which would cause this sort of crash.

def- commented 2 years ago

Thanks for checking that, I was indeed using wrong version. Didn't know this was changed recently and not yet released. Current master (9f30d4981e8a48720f49887fdded30da8e0d452b) works fine for me, couldn't get any crash even after aggressively moving and resizing window for minutes.