Crashes - Metal: MTLReportFailure.cold.1, MTLReportFailure + 468

We have updated our project from Unity 2017.4.32f1 to Unity 2019.4.24f1 and now we are experiencing a load of crashes on users’ devices and can’t figure out what is going on. Auto graphics API is off and we manually have set: Metal, OpenGL ES 3.0, OpenGL ES 2.0. That was the only change.

Crashes are marked as Metal: MTLReportFailure.cold.1 +52 and MTLReportFailure.cold.1 +56 and they are happening on every device model as we saw by browsing crash log details.

MTLReportFailure + 448
MTLReportFailure + 468
MTLReportFailure + 476

bool MTLGetEnvCase(char const*, MTLErrorModeType&, std::initializer_list<std::__1::pair<char const*, MTLErrorModeType> > const&) (.cold.1) + 50

bool MTLGetEnvCase(char const*, MTLErrorModeType&, std::initializer_list<std::__1::pair<char const*, MTLErrorModeType> > const&) (.cold.1) + 54

-[_MTLCommandEncoder dealloc]:131: failed assertion `Command encoder released without endEncoding’

Command encoder released without endEncoding

Crash log example: pastebin or

Similar issue tracker: Unity Issue Tracker - Crash on MTLReportFailure.cold.2 + 43 when running Build with Graphics Jobs enabled

bump

bump

bump

bump

bump

bump

Same for us with Unity 2019.4.28. We are suspecting Textmesh Pro dynamic fonts.

Another issue tracker: Unity Issue Tracker - [iOS] Crash on MTLReportFailure.cold.1 due to a missing endEncoding call on exiting the application

Another forum thread: Crashes - Metal: MTLReportFailure + 448 MTLReportFailure + 476

It is fixed for us with 2019.4.30

Didn’t have it in 2020.3.18f1 but it started appearing in 2020.3.26f1 - possibly a regression?
On MacOS

Yep, happening to me too with 2020.3.26f1. Regression.

This crash its constantly appearing in my app (2020.3.23, iOS 15.1)

0   libsystem_kernel.dylib                   0x1bab75964 __pthread_kill + 8
1   libsystem_pthread.dylib                  0x1f3a9c378 pthread_kill + 268
2   libsystem_c.dylib                        0x18f743f50 abort + 164
3   libsystem_c.dylib                        0x18f79a914 __assert_rtn + 212
4   Metal                                    0x19eccfd58 MTLReportFailure.cold.1 + 56
5   Metal                                    0x19ecbb6e0 MTLReportFailure + 476
6   Metal                                    0x19ec265e0 -[MTLComputePipelineDescriptorInternal setComputeFunction:] + 224
7   Metal                                    0x19ec25764 -[_MTLDevice newComputePipelineStateWithFunction:error:] + 64
8   ARKitCore                                0x1b823b9d8 -[ARDualGuidedFilter initWithDevice:useSmoothing:] + 672
9   ARKitCore                                0x1b8236ffc -[ARMatteGenerator _commonInitWithDevice:matteResolution:useSmoothing:] + 316
10  ARKitCore                                0x1b8236ea0 -[ARMatteGenerator initWithDevice:matteResolution:] + 108
11  UnityFramework                           0x1194ebd70 (anonymous namespace)::ARKitXROcclusionProvider::SetupPostProcessing() + 248
12  UnityFramework                           0x11bfeeed0

Should be gone with latest 2020.3.x

Hello, It is in 2020.3.30f and also in 20.3.34f1.
However for me it works fine on almost all iOS devices except of iPhone 6s with iOS14.

same problem.