Skip to content

Conversation

stuartcarnie
Copy link
Contributor

@stuartcarnie stuartcarnie commented Aug 28, 2025

Validate the MSL version of the baked shader is <= the current version supported by the OS, and return an error so it is recompiled.

Validate the MSL version of the baked shader is <= the current version
supported by the OS, and return an error so it is recompiled.

Closes godotengine#109846
@stuartcarnie stuartcarnie requested a review from a team as a code owner August 28, 2025 19:49
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So simple in the end!

@clayjohn
Copy link
Member

CC @TCROC Can you test this and confirm that it fixes the issue for you?

@TCROC
Copy link
Contributor

TCROC commented Aug 28, 2025

That was a fast turnaround! I'll merge this into my fork and test it now! 🔥

@TCROC
Copy link
Contributor

TCROC commented Aug 28, 2025

I compiled and uploaded to Test Flight. I should know in a couple of days when Apple approves the release so my iOS 17.6.1 users can test it! :)

@TCROC
Copy link
Contributor

TCROC commented Aug 29, 2025

@stuartcarnie @clayjohn Apple approved the release and I just tested. Unfortunately it didn't fix it. It still crashes. One thing to note: debug builds don't crash, its just blank screen. Release builds segfault. Here is a crash report:

Click me
Incident Identifier: B117FC1B-13E4-4175-90CF-11471632D054
Distributor ID:      com.apple.TestFlight
Hardware Model:      iPhone14,7
Process:             blockyballot [3212]
Path:                /private/var/containers/Bundle/Application/2538ADA3-C3CF-4DD8-8431-34BD8D7F724D/blockyballot.app/blockyballot
Identifier:          com.langestudios.blockyballot
Version:             0.1.40 (1)
AppStoreTools:       16F7
AppVariant:          1:iPhone14,7:17.4
Beta:                YES
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.langestudios.blockyballot [1508]

Date/Time:           2025-08-29 13:33:18.4926 -0400
Launch Time:         2025-08-29 13:33:17.9704 -0400
OS Version:          iPhone OS 17.6.1 (21G93)
Release Type:        User
Baseband Version:    2.60.02
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000024
Exception Codes: 0x0000000000000001, 0x0000000000000024
VM Region Info: 0x24 is not in any region.  Bytes before following region: 4306567132
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                   100b10000-1014bc000 [ 9904K] r-x/r-x SM=COW  /var/containers/Bundle/Application/2538ADA3-C3CF-4DD8-8431-34BD8D7F724D/blockyballot.app/blockyballot
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [3212]

Triggered by Thread:  0


Kernel Triage:
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter


Thread 0 name:
Thread 0 Crashed:
0   blockyballot                  	0x0000000102569260 RenderingDeviceDriverMetal::command_bind_push_constants(RenderingDeviceDriver::CommandBufferID, RenderingDeviceDriver::ShaderID, unsigned int, VectorView<unsigned int>) + 40
1   blockyballot                  	0x0000000103dc7638 RenderingDeviceGraph::_run_render_commands(int, RenderingDeviceGraph::RecordedCommandSort const*, unsigned int, RenderingDeviceDriver::CommandBufferID&, RenderingDeviceGraph::CommandBufferPool&, in... + 4856
2   blockyballot                  	0x0000000103dca27c RenderingDeviceGraph::end(bool, bool, RenderingDeviceDriver::CommandBufferID&, RenderingDeviceGraph::CommandBufferPool&) + 2640
3   blockyballot                  	0x0000000103d32584 RenderingDevice::_end_frame() + 360
4   blockyballot                  	0x0000000103d32210 RenderingDevice::swap_buffers(bool) + 92
5   blockyballot                  	0x0000000103ee4b8c RendererCompositorRD::set_boot_image(Ref<Image> const&, Color const&, bool, bool) + 1744
6   blockyballot                  	0x00000001014f6210 Main::setup2(bool) + 15588
7   blockyballot                  	0x000000010225b8b4 -[GDTViewRenderer setupProjectData] + 68
8   blockyballot                  	0x000000010225b804 -[GDTViewRenderer setupView:] + 112
9   blockyballot                  	0x0000000102258e74 -[GDTView drawView] + 256
10  QuartzCore                    	0x000000019835cdc4 CA::Display::DisplayLinkItem::dispatch_(CA::SignPost::Interval<(CA::SignPost::CAEventCode)835322056>&) + 48 (CADisplay.mm:5751)
11  QuartzCore                    	0x000000019835b0e8 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 876 (CADisplay.mm:4994)
12  QuartzCore                    	0x000000019835ac88 CA::Display::DisplayLink::dispatch_deferred_display_links(unsigned int) + 352 (CADisplay.mm:4119)
13  UIKitCore                     	0x0000000198f52660 _UIUpdateSequenceRun + 84 (_UIUpdateSequence.mm:119)
14  UIKitCore                     	0x0000000198f522a4 schedulerStepScheduledMainSection + 172 (_UIUpdateScheduler.m:1058)
15  UIKitCore                     	0x0000000198f53148 runloopSourceCallback + 92 (_UIUpdateScheduler.m:1221)
16  CoreFoundation                	0x0000000196c6f834 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1957)
17  CoreFoundation                	0x0000000196c6f7c8 __CFRunLoopDoSource0 + 176 (CFRunLoop.c:2001)
18  CoreFoundation                	0x0000000196c6d298 __CFRunLoopDoSources0 + 244 (CFRunLoop.c:2038)
19  CoreFoundation                	0x0000000196c6c484 __CFRunLoopRun + 828 (CFRunLoop.c:2955)
20  CoreFoundation                	0x0000000196c6bcd8 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
21  GraphicsServices              	0x00000001db6b91a8 GSEventRunModal + 164 (GSEvent.c:2196)
22  UIKitCore                     	0x00000001992a5ae8 -[UIApplication _run] + 888 (UIApplication.m:3713)
23  UIKitCore                     	0x0000000199359d98 UIApplicationMain + 340 (UIApplication.m:5303)
24  blockyballot                  	0x00000001014bf0d8 main + 120
25  dyld                          	0x00000001ba443154 start + 2356 (dyldMain.cpp:1298)

Thread 1 name:
Thread 1:
0   libsystem_kernel.dylib        	0x00000001df8f16c8 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001df8f4ec8 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001df8f4de0 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001df8f4c20 mach_msg + 24 (mach_msg.c:323)
4   libdispatch.dylib             	0x000000019eb5db18 _dispatch_mach_send_and_wait_for_reply + 544 (mach.c:1980)
5   libdispatch.dylib             	0x000000019eb5deb8 dispatch_mach_send_with_result_and_wait_for_reply + 60 (mach.c:2017)
6   libxpc.dylib                  	0x00000001f373cac8 xpc_connection_send_message_with_reply_sync + 264 (connection.c:3985)
7   Metal                         	0x00000001968eaedc XPCCompilerConnection::checkConnectionActive(bool&) + 184 (MTLCompilerConnection.mm:1435)
8   Metal                         	0x0000000196845300 XPCCompilerConnection::BuildRequestInternal(MTLCompilerRequest*, char const*, NSObject<OS_dispatch_data>*, int, bool, void (unsigned int, void const*, unsigned long, char const*) block_pointer) + 1100 (MTLCompilerConnection.mm:1832)
9   libdispatch.dylib             	0x000000019eb4113c _dispatch_call_block_and_release + 32 (init.c:1530)
10  libdispatch.dylib             	0x000000019eb42dd4 _dispatch_client_callout + 20 (object.m:576)
11  libdispatch.dylib             	0x000000019eb4a400 _dispatch_lane_serial_drain + 748 (queue.c:3900)
12  libdispatch.dylib             	0x000000019eb4af64 _dispatch_lane_invoke + 432 (queue.c:3991)
13  libdispatch.dylib             	0x000000019eb55cb4 _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:6998)
14  libdispatch.dylib             	0x000000019eb55528 _dispatch_workloop_worker_thread + 404 (queue.c:6592)
15  libsystem_pthread.dylib       	0x00000001f36ec934 _pthread_wqthread + 288 (pthread.c:2696)
16  libsystem_pthread.dylib       	0x00000001f36e90cc start_wqthread + 8 (:-1)

Thread 2:
0   libsystem_pthread.dylib       	0x00000001f36e90c4 start_wqthread + 0 (:-1)

Thread 3 name:
Thread 3:
0   libsystem_kernel.dylib        	0x00000001df8f16c8 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001df8f4ec8 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001df8f4de0 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001df8f4c20 mach_msg + 24 (mach_msg.c:323)
4   libdispatch.dylib             	0x000000019eb5db18 _dispatch_mach_send_and_wait_for_reply + 544 (mach.c:1980)
5   libdispatch.dylib             	0x000000019eb5deb8 dispatch_mach_send_with_result_and_wait_for_reply + 60 (mach.c:2017)
6   libxpc.dylib                  	0x00000001f373cac8 xpc_connection_send_message_with_reply_sync + 264 (connection.c:3985)
7   Metal                         	0x00000001968eaedc XPCCompilerConnection::checkConnectionActive(bool&) + 184 (MTLCompilerConnection.mm:1435)
8   Metal                         	0x0000000196845300 XPCCompilerConnection::BuildRequestInternal(MTLCompilerRequest*, char const*, NSObject<OS_dispatch_data>*, int, bool, void (unsigned int, void const*, unsigned long, char const*) block_pointer) + 1100 (MTLCompilerConnection.mm:1832)
9   libdispatch.dylib             	0x000000019eb4113c _dispatch_call_block_and_release + 32 (init.c:1530)
10  libdispatch.dylib             	0x000000019eb42dd4 _dispatch_client_callout + 20 (object.m:576)
11  libdispatch.dylib             	0x000000019eb4a400 _dispatch_lane_serial_drain + 748 (queue.c:3900)
12  libdispatch.dylib             	0x000000019eb4af64 _dispatch_lane_invoke + 432 (queue.c:3991)
13  libdispatch.dylib             	0x000000019eb55cb4 _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:6998)
14  libdispatch.dylib             	0x000000019eb55528 _dispatch_workloop_worker_thread + 404 (queue.c:6592)
15  libsystem_pthread.dylib       	0x00000001f36ec934 _pthread_wqthread + 288 (pthread.c:2696)
16  libsystem_pthread.dylib       	0x00000001f36e90cc start_wqthread + 8 (:-1)

Thread 4:
0   libsystem_pthread.dylib       	0x00000001f36e90c4 start_wqthread + 0 (:-1)

Thread 5:
0   libsystem_pthread.dylib       	0x00000001f36e90c4 start_wqthread + 0 (:-1)

Thread 6 name:
Thread 6:
0   libsystem_kernel.dylib        	0x00000001df8f16c8 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001df8f4ec8 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001df8f4de0 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001df8f4c20 mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x0000000196c6cf5c __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2624)
5   CoreFoundation                	0x0000000196c6c600 __CFRunLoopRun + 1208 (CFRunLoop.c:3007)
6   CoreFoundation                	0x0000000196c6bcd8 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
7   Foundation                    	0x0000000195b8cb5c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373)
8   Foundation                    	0x0000000195b8c9ac -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 (NSRunLoop.m:420)
9   UIKitCore                     	0x00000001992b981c -[UIEventFetcher threadMain] + 420 (UIEventFetcher.m:1207)
10  Foundation                    	0x0000000195ba3428 __NSThread__start__ + 732 (NSThread.m:991)
11  libsystem_pthread.dylib       	0x00000001f36ee06c _pthread_start + 136 (pthread.c:931)
12  libsystem_pthread.dylib       	0x00000001f36e90d8 thread_start + 8 (:-1)

Thread 7:
0   libsystem_pthread.dylib       	0x00000001f36e90c4 start_wqthread + 0 (:-1)

Thread 8:
0   libsystem_kernel.dylib        	0x00000001df8f708c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001f36eb6e4 _pthread_cond_wait + 1228 (pthread_cond.c:862)
2   libc++.1.dylib                	0x00000001a7059504 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (condition_variable.cpp:45)
3   blockyballot                  	0x00000001044d6894 _IP_ResolverPrivate::_thread_function(void*) + 164
4   blockyballot                  	0x0000000102249b8c Thread::thread_callback(void*) + 220
5   libsystem_pthread.dylib       	0x00000001f36ee06c _pthread_start + 136 (pthread.c:931)
6   libsystem_pthread.dylib       	0x00000001f36e90d8 thread_start + 8 (:-1)

Thread 9 name:
Thread 9:
0   libsystem_kernel.dylib        	0x00000001df8f708c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001f36eb6e4 _pthread_cond_wait + 1228 (pthread_cond.c:862)
2   libc++.1.dylib                	0x00000001a7059504 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (condition_variable.cpp:45)
3   blockyballot                  	0x0000000104a5b778 WorkerThreadPool::_thread_function(void*) + 532
4   blockyballot                  	0x0000000102249b8c Thread::thread_callback(void*) + 220
5   libsystem_pthread.dylib       	0x00000001f36ee06c _pthread_start + 136 (pthread.c:931)
6   libsystem_pthread.dylib       	0x00000001f36e90d8 thread_start + 8 (:-1)

Thread 10 name:
Thread 10:
0   libsystem_kernel.dylib        	0x00000001df8f708c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001f36eb6e4 _pthread_cond_wait + 1228 (pthread_cond.c:862)
2   libc++.1.dylib                	0x00000001a7059504 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (condition_variable.cpp:45)
3   blockyballot                  	0x0000000104a5b778 WorkerThreadPool::_thread_function(void*) + 532
4   blockyballot                  	0x0000000102249b8c Thread::thread_callback(void*) + 220
5   libsystem_pthread.dylib       	0x00000001f36ee06c _pthread_start + 136 (pthread.c:931)
6   libsystem_pthread.dylib       	0x00000001f36e90d8 thread_start + 8 (:-1)

Thread 11 name:
Thread 11:
0   libsystem_kernel.dylib        	0x00000001df8f708c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001f36eb6e4 _pthread_cond_wait + 1228 (pthread_cond.c:862)
2   libc++.1.dylib                	0x00000001a7059504 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (condition_variable.cpp:45)
3   blockyballot                  	0x0000000104a5b778 WorkerThreadPool::_thread_function(void*) + 532
4   blockyballot                  	0x0000000102249b8c Thread::thread_callback(void*) + 220
5   libsystem_pthread.dylib       	0x00000001f36ee06c _pthread_start + 136 (pthread.c:931)
6   libsystem_pthread.dylib       	0x00000001f36e90d8 thread_start + 8 (:-1)

Thread 12 name:
Thread 12:
0   libsystem_kernel.dylib        	0x00000001df8f708c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001f36eb6e4 _pthread_cond_wait + 1228 (pthread_cond.c:862)
2   libc++.1.dylib                	0x00000001a7059504 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (condition_variable.cpp:45)
3   blockyballot                  	0x0000000104a5b778 WorkerThreadPool::_thread_function(void*) + 532
4   blockyballot                  	0x0000000102249b8c Thread::thread_callback(void*) + 220
5   libsystem_pthread.dylib       	0x00000001f36ee06c _pthread_start + 136 (pthread.c:931)
6   libsystem_pthread.dylib       	0x00000001f36e90d8 thread_start + 8 (:-1)

Thread 13 name:
Thread 13:
0   libsystem_kernel.dylib        	0x00000001df8f708c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001f36eb6e4 _pthread_cond_wait + 1228 (pthread_cond.c:862)
2   libc++.1.dylib                	0x00000001a7059504 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (condition_variable.cpp:45)
3   blockyballot                  	0x0000000104a5b778 WorkerThreadPool::_thread_function(void*) + 532
4   blockyballot                  	0x0000000102249b8c Thread::thread_callback(void*) + 220
5   libsystem_pthread.dylib       	0x00000001f36ee06c _pthread_start + 136 (pthread.c:931)
6   libsystem_pthread.dylib       	0x00000001f36e90d8 thread_start + 8 (:-1)

Thread 14 name:
Thread 14:
0   libsystem_kernel.dylib        	0x00000001df8f708c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001f36eb6e4 _pthread_cond_wait + 1228 (pthread_cond.c:862)
2   libc++.1.dylib                	0x00000001a7059504 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (condition_variable.cpp:45)
3   blockyballot                  	0x0000000104a5b778 WorkerThreadPool::_thread_function(void*) + 532
4   blockyballot                  	0x0000000102249b8c Thread::thread_callback(void*) + 220
5   libsystem_pthread.dylib       	0x00000001f36ee06c _pthread_start + 136 (pthread.c:931)
6   libsystem_pthread.dylib       	0x00000001f36e90d8 thread_start + 8 (:-1)

Thread 15 name:
Thread 15:
0   libsystem_kernel.dylib        	0x00000001df8f16c8 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001df8f4ec8 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001df8f4de0 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001df8f4c20 mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x0000000196c6cf5c __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2624)
5   CoreFoundation                	0x0000000196c6c600 __CFRunLoopRun + 1208 (CFRunLoop.c:3007)
6   CoreFoundation                	0x0000000196c6bcd8 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
7   CoreFoundation                	0x0000000196cd9f04 CFRunLoopRun + 64 (CFRunLoop.c:3446)
8   CoreMotion                    	0x00000001a3980e3c CLMotionCore::runMotionThread(void*) + 1292 (CLMotionCore.mm:376)
9   libsystem_pthread.dylib       	0x00000001f36ee06c _pthread_start + 136 (pthread.c:931)
10  libsystem_pthread.dylib       	0x00000001f36e90d8 thread_start + 8 (:-1)

Thread 16 name:
Thread 16:
0   libsystem_kernel.dylib        	0x00000001df8f1644 semaphore_wait_trap + 8 (:-1)
1   caulk                         	0x0000000208a87724 caulk::semaphore::timed_wait(double) + 212 (semaphore.cpp:98)
2   caulk                         	0x0000000208a875e4 caulk::concurrent::details::worker_thread::run() + 36 (messenger.cpp:234)
3   caulk                         	0x0000000208a8752c 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 (thread.h:189)
4   libsystem_pthread.dylib       	0x00000001f36ee06c _pthread_start + 136 (pthread.c:931)
5   libsystem_pthread.dylib       	0x00000001f36e90d8 thread_start + 8 (:-1)

Thread 17 name:
Thread 17:
0   libsystem_kernel.dylib        	0x00000001df8f1644 semaphore_wait_trap + 8 (:-1)
1   caulk                         	0x0000000208a87724 caulk::semaphore::timed_wait(double) + 212 (semaphore.cpp:98)
2   caulk                         	0x0000000208a875e4 caulk::concurrent::details::worker_thread::run() + 36 (messenger.cpp:234)
3   caulk                         	0x0000000208a8752c 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 (thread.h:189)
4   libsystem_pthread.dylib       	0x00000001f36ee06c _pthread_start + 136 (pthread.c:931)
5   libsystem_pthread.dylib       	0x00000001f36e90d8 thread_start + 8 (:-1)

Thread 18 name:
Thread 18:
0   libsystem_kernel.dylib        	0x00000001df8f16c8 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001df8f4ec8 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001df8f4de0 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001df8f4c20 mach_msg + 24 (mach_msg.c:323)
4   libEmbeddedSystemAUs.dylib    	0x00000002122b28b8 void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, AURemoteIO::IOThread::IOThread(AURemoteIO&, caulk::thread::attributes const&, caulk::mach::os_workgroup_managed const&)::'lambda... + 556 (thread.h:189)
5   libsystem_pthread.dylib       	0x00000001f36ee06c _pthread_start + 136 (pthread.c:931)
6   libsystem_pthread.dylib       	0x00000001f36e90d8 thread_start + 8 (:-1)


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x000000010d206590   x1: 0x000000016f2edd20   x2: 0x000000016f2edd18   x3: 0x0000000000000000
    x4: 0x000000010d66c238   x5: 0x0000000100000014   x6: 0x000000030197aa00   x7: 0x0000000000000000
    x8: 0x0000000000000000   x9: 0x0000000000000001  x10: 0x00000000000000b7  x11: 0x0000000104f0b72a
   x12: 0x000000030197aa00  x13: 0x00000000001ff800  x14: 0x00000000000007fb  x15: 0x00000000b942b8a9
   x16: 0x00000000000000a8  x17: 0x00000000b962b0aa  x18: 0x0000000000000000  x19: 0x00000001061445f0
   x20: 0x00000000000000b8  x21: 0x000000010d62a0d8  x22: 0x000000010d66c1e0  x23: 0x000000010d66c228
   x24: 0x0000000000000000  x25: 0x0000000000000048  x26: 0x000000010e07ead0  x27: 0x0000000000000001
   x28: 0x0000000000000000   fp: 0x000000016f2edc50   lr: 0x0000000103dc7638
    sp: 0x000000016f2edc40   pc: 0x0000000102569260 cpsr: 0x60001000
   esr: 0x92000006 (Data Abort) byte read Translation fault


Binary Images:
        0x100b10000 -         0x1055affff blockyballot arm64  <5aedce136ee53010893c0352806c55e9> /private/var/containers/Bundle/Application/2538ADA3-C3CF-4DD8-8431-34BD8D7F724D/blockyballot.app/blockyballot
        0x105f14000 -         0x105f1ffff libobjc-trampolines.dylib arm64e  <be553713db163c12aaa48fd6211e48ce> /private/preboot/Cryptexes/OS/usr/lib/libobjc-trampolines.dylib
        0x106468000 -         0x109b53fff BlockyBallOT arm64  <d283f32f4ca639caaac483a263be4e35> /private/var/containers/Bundle/Application/2538ADA3-C3CF-4DD8-8431-34BD8D7F724D/blockyballot.app/Frameworks/BlockyBallOT.framework/BlockyBallOT
        0x195ac5000 -         0x19663afff Foundation arm64e  <d27a6ec5943c3b0e8d158840fd2914f0> /System/Library/Frameworks/Foundation.framework/Foundation
        0x1967f8000 -         0x196a0cfff Metal arm64e  <f8cf586733e33e80aaf96f0c8b68730f> /System/Library/Frameworks/Metal.framework/Metal
        0x196c19000 -         0x197146fff CoreFoundation arm64e  <76a3b1983c09323e83590d4978e156f5> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
        0x19828b000 -         0x198619fff QuartzCore arm64e  <aedc1a5617313315a87ec6610024a405> /System/Library/Frameworks/QuartzCore.framework/QuartzCore
        0x198e9b000 -         0x19a9bcfff UIKitCore arm64e  <9da0d27355063712b73de0149d74c13c> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
        0x19eb3f000 -         0x19eb85fff libdispatch.dylib arm64e  <5f66cdb608a936158c6a4e3b47005495> /usr/lib/system/libdispatch.dylib
        0x19eb86000 -         0x19ec03ff3 libsystem_c.dylib arm64e  <7135c2c8ba5836368b46a9e6226ead45> /usr/lib/system/libsystem_c.dylib
        0x1a3971000 -         0x1a3e3ffff CoreMotion arm64e  <5d6e7429116638b3807bdfad246f9132> /System/Library/Frameworks/CoreMotion.framework/CoreMotion
        0x1a704c000 -         0x1a70d5fff libc++.1.dylib arm64e  <febfb476c9003e0d8b93f22b586104ac> /usr/lib/libc++.1.dylib
        0x1ba406000 -         0x1ba493937 dyld arm64e  <52039c944da13638bd52020a0b5fa399> /usr/lib/dyld
        0x1db6b8000 -         0x1db6c0fff GraphicsServices arm64e  <3ebbd576e7d83f69bcb5b9810ddcc90e> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
        0x1df8f0000 -         0x1df929fef libsystem_kernel.dylib arm64e  <21ee5290d1193c31b948431865a67738> /usr/lib/system/libsystem_kernel.dylib
        0x1f36e8000 -         0x1f36f4ff3 libsystem_pthread.dylib arm64e  <e4a9d6dbf93b3c88bdd185671ec22e2b> /usr/lib/system/libsystem_pthread.dylib
        0x1f372c000 -         0x1f3774fff libxpc.dylib arm64e  <cd0f76a8713a3fdb877e386b089bc2d1> /usr/lib/system/libxpc.dylib
        0x208a7f000 -         0x208aa8fff caulk arm64e  <e5c09db9103f38c798201fb237c06434> /System/Library/PrivateFrameworks/caulk.framework/caulk
        0x212283000 -         0x212393ff7 libEmbeddedSystemAUs.dylib arm64e  <c9ab992184f835fca25573acb5e2fbd5> /System/Library/Frameworks/AudioToolbox.framework/libEmbeddedSystemAUs.dylib

EOF

I'm going to roll out a release with shader_baker/enabled=false to see if that resolves the crash and confirm this is still the issue or if something else is going on as well.

@clayjohn
Copy link
Member

@TCROC can you test on a physical device again? I wonder if the old shader cache got used or something like that. It would be helpful to see if there is still an error reported

@TCROC
Copy link
Contributor

TCROC commented Aug 29, 2025

@TCROC can you test on a physical device again? I wonder if the old shader cache got used or something like that. It would be helpful to see if there is still an error reported

The crash above was from a physical device. From a clean install. Multiple attempted startups. Still waiting on apple to approve the build with shader baker disabled. Then will be able to test both on a physical device.

@stuartcarnie
Copy link
Contributor Author

stuartcarnie commented Aug 29, 2025

That call stack was in your original crash report, and surprised me, as this is happening when the app first opens. This is the first set of draw commands issued by Godot, to display the splash screen. This might be a red herring. The function RenderingDeviceDriverMetal::command_bind_push_constants is only two lines:

MDCommandBuffer *cb = (MDCommandBuffer *)(p_cmd_buffer.id);
cb->encode_push_constant_data(p_shader, p_data);

The crash is a NULL pointer access at offset 0x24 (36). Examining the registers:

x0: 0x000000010d206590   x1: 0x000000016f2edd20   x2: 0x000000016f2edd18   x3: 0x0000000000000000
    x4: 0x000000010d66c238

That align with the arguments of the function:

void RenderingDeviceDriverMetal::command_bind_push_constants(CommandBufferID p_cmd_buffer, ShaderID p_shader, uint32_t p_dst_first_index, VectorView<uint32_t> p_data)
symbol register value
x0 this 0x000000010d206590
x1 p_cmd_buffer 0x000000016f2edd20
x2 p_shader 0x000000016f2edd18
x3 p_dst_first_index 0x0000000000000000
x4 p_data 0x000000010d66c238
sp stack pointer 0x000000016f2edc40

Note

p_cmd_buffer and p_shader refer to the stack, so they must dereference the value on the stack to obtain the underlying pointer to a heap-allocated object.

If I look at the first few lines of encode_push_constant_data, given it is likely the function was inlined, we see:

void MDCommandBuffer::encode_push_constant_data(RDD::ShaderID p_shader, VectorView<uint32_t> p_data) {
	switch (type) {
		case MDCommandBufferStateType::Render: {
			MDRenderShader *shader = (MDRenderShader *)(p_shader.id);
			if (shader->push_constants.vert.binding == -1 && shader->push_constants.frag.binding == -1) {

I'm certain the type of MDCommandBuffer command is MDCommandBufferStateType::Render, as this is blitting the splash screen, therefore the first pointer access in this function is:

if (shader->push_constants.vert.binding == -1 

The offset of the push_constants field is, not coincidentally, 0x24. So we appear to be looking at a null pointer access of p_shader. We know this call stack is drawing the boot image, which means the blit.glsl shader is being used, and this error suggests it did not compile. The Metal driver returned ShaderID(0) and likely logged an error.

Important

Obtaining logs is going to necessary in understanding what is going on.

@stuartcarnie
Copy link
Contributor Author

Also note that because Metal returned ShaderID(0), the rendering device should attempt to recompile the blit.glsl shader from source. It is unclear why would that fail. It looks like blit.glsl has changed recently, but there doesn't appear to be anything significant in those changes.

@TCROC
Copy link
Contributor

TCROC commented Aug 29, 2025

Great insights! I'm learning a lot from this debugging as well! What logs would you like me to capture? Anything I can do when plugging the device into a Mac / Xcode that might be useful? Or maybe uploading a build configured with verbose mode?

@stuartcarnie
Copy link
Contributor Author

@TCROC if you can get verbose logs of the app starting up, that would be great.

@TCROC
Copy link
Contributor

TCROC commented Aug 29, 2025

Perfect! I'll push a new build with verbose logs tonight.

@Repiteo
Copy link
Contributor

Repiteo commented Sep 1, 2025

@TCROC Any update on those logs?

@stuartcarnie Should this be merged separately, or would we prefer to wait and address the core issue in the same PR?

@TCROC
Copy link
Contributor

TCROC commented Sep 1, 2025

@TCROC Any update on those logs?

@stuartcarnie Should this be merged separately, or would we prefer to wait and address the core issue in the same PR?

Still waiting on Apple approval. This last weekend and today was a US holiday so probably won't be approved until tomorrow. Normally they approve within the day, but this is likely the reason for the delay.

@stuartcarnie
Copy link
Contributor Author

@Repiteo yes, this could be merged regardless, as it still addresses a potential issue with versioning

@Repiteo Repiteo merged commit 280503b into godotengine:master Sep 2, 2025
39 of 40 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Sep 2, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants