Crash with Unity 2022.3.20f1 / 19f1

We’ve upgraded from 18f1 to 20f1, which has given us an IDE and Xcode crash issue. I’ve also tried upgrading from 18f1 to 19f1, but we get the same crash.

The crash occurs when submitting an URP render request. It will complete successfully a number of times before crashing, although what it’s rendering does change.

From the Editor.log:

Shader is using dynamic branch keywords, but the state object is not provided.

What might have changed in Unity 19f1 to cause this?

Editor.log
=================================================================
	Managed Stacktrace:
=================================================================
	  at <unknown> <0xffffffff>
	  at UnityEngine.Rendering.ScriptableRenderContext:Submit_Internal_Injected <0x00007>
	  at UnityEngine.Rendering.ScriptableRenderContext:Submit_Internal <0x00013>
	  at UnityEngine.Rendering.ScriptableRenderContext:Submit <0x0001f>
	  at UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderSingleCamera <0x00793>
	  at UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderCameraStack <0x00aa3>
	  at UnityEngine.Rendering.Universal.UniversalRenderPipeline:Render <0x00257>
	  at UnityEngine.Rendering.Universal.UniversalRenderPipeline:Render <0x00067>
	  at UnityEngine.Rendering.Universal.UniversalRenderPipeline:ProcessRenderRequests <0x0055b>
	  at UnityEngine.Rendering.RenderPipeline:InternalProcessRenderRequests <0x00077>
	  at UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal <0x001d3>
	  at <Module>:runtime_invoke_void_object_intptr_object_AtomicSafetyHandle <0x00093>
	  at <unknown> <0xffffffff>
	  at UnityEngine.Camera:SubmitRenderRequestsInternal <0x00007>
	  at UnityEngine.Camera:SubmitRenderRequest <0x00167>
	  at UnityEngine.Rendering.RenderPipeline:SubmitRenderRequest <0x00033>
	  [Redacted]
	  at UnityEngine.SetupCoroutine:InvokeMoveNext <0x0005b>
	  at <Module>:runtime_invoke_void_object_intptr <0x00077>
	  at <unknown> <0xffffffff>
	  at UnityEditor.EditorGUIUtility:RenderPlayModeViewCamerasInternal_Injected <0x00007>
	  at UnityEditor.EditorGUIUtility:RenderPlayModeViewCamerasInternal <0x00037>
	  at UnityEditor.PlayModeView:RenderView <0x003cf>
	  at UnityEditor.GameView:OnGUI <0x0109f>
	  at UnityEditor.HostView:InvokeOnGUI <0x0014b>
	  at UnityEditor.DockArea:DrawView <0x00057>
	  at UnityEditor.DockArea:OldOnGUI <0x008e7>
	  at UnityEngine.UIElements.IMGUIContainer:DoOnGUI <0x006c7>
	  at UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent <0x0035f>
	  at UnityEngine.UIElements.IMGUIContainer:DoIMGUIRepaint <0x003a3>
	  at UnityEngine.UIElements.UIR.RenderChainCommand:ExecuteNonDrawMesh <0x00627>
	  at UnityEngine.UIElements.UIR.UIRenderDevice:EvaluateChain <0x00f43>
	  at UnityEngine.UIElements.UIR.RenderChain:Render <0x0044f>
	  at UnityEngine.UIElements.UIRRepaintUpdater:Update <0x001ff>
	  at UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase <0x000eb>
	  at UnityEngine.UIElements.Panel:UpdateForRepaint <0x00073>
	  at UnityEngine.UIElements.Panel:Repaint <0x001bf>
	  at UnityEngine.UIElements.UIElementsUtility:DoDispatch <0x0011b>
	  at UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent <0x000c7>
	  at UnityEngine.UIElements.UIEventRegistration:ProcessEvent <0x00093>
	  at <>c:<.cctor>b__1_2 <0x0001f>
	  at UnityEngine.GUIUtility:ProcessEvent <0x00063>
	  at <Module>:runtime_invoke_void_int_intptr_intptr& <0x0007f>
=================================================================
1 Like

Made a repro - #IN-70158 cc @DanMillerU3D

I’m experiencing similar crashes during shader warmups after upgrading from 2022.3.18f1 to 2022.3.20f1

Editor.log:

...
Shader is using dynamic branch keywords, but the state object is not provided.
...

=================================================================
	Managed Stacktrace:
=================================================================
	  at <unknown> <0xffffffff>
	  at UnityEngine.Experimental.Rendering.ShaderWarmup:WarmupShaderFromCollection_Injected <0x00007>
	  at UnityEngine.Experimental.Rendering.ShaderWarmup:WarmupShaderFromCollection <0x0004b>
...
	  at <OnInit>d__139:MoveNext <0x011bb>
	  at UnityEngine.SetupCoroutine:InvokeMoveNext <0x0012b>
	  at <Module>:runtime_invoke_void_object_intptr <0x000d7>
=================================================================
Obtained 49 stack frames.
#0  0x00000104f9dd80 in DynamicBranchState::PrepareState(unsigned long, keywords::LocalKeywordState const&)
#1  0x00000104fa8a24 in ShaderLab::Pass::ApplyPass(unsigned int, ShaderPropertySheet const*, DynamicBranchState*, ShaderPassContext&, keywords::LocalKeywordState const&, Shader const*, int, int, ShaderLab::GrabPasses const*, ShaderLab::SubPrograms*, DeviceRenderStateBlock const*, ShaderLab::Pass const*, ShaderLab::Pass const*)
#2  0x00000104f92230 in DrawVBOChunkWithPass(Shader*, DynamicBranchState*, int, int, ShaderLab::Pass*, ShaderPassContext&, keywords::LocalKeywordState const&, WarmupPassSetup const&, DynamicVBO*)
#3  0x00000104f8f79c in ShaderVariantCollection::WarmupOneShaderImpl(Shader*, DynamicBranchState*, vector_set<ShaderVariantCollection::VariantInfo, std::__1::less<ShaderVariantCollection::VariantInfo>, std::__1::allocator<ShaderVariantCollection::VariantInfo>> const&, WarmupPassSetup const&, DynamicVBO*, void (*)(Shader*, DynamicBranchState*, int, int, ShaderLab::Pass*, keywords::LocalKeywordState const&, WarmupPassSetup const&, DynamicVBO*, void*, ShaderPassContext&), void*, unsigned long, unsigned long)
#4  0x00000104f901f4 in ShaderVariantCollection::WarmupShaderWithSetup(Shader*, WarmupPassSetup const&)
#5  0x00000104d0ca1c in ShaderWarmupScripting::WarmupShaderFromCollection(ShaderVariantCollection*, Shader*, ShaderWarmupScripting::ShaderWarmupSetup const&)
#6  0x0000010460f2d4 in ShaderWarmup_CUSTOM_WarmupShaderFromCollection_Injected(ScriptingBackendNativeObjectPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*, ShaderWarmupSetup__ const&)
#7  0x00000384358944 in  (wrapper managed-to-native) UnityEngine.Experimental.Rendering.ShaderWarmup:WarmupShaderFromCollection_Injected (UnityEngine.ShaderVariantCollection,UnityEngine.Shader,UnityEngine.Experimental.Rendering.ShaderWarmupSetup&) [{0x36a4e40b0} + 0xc4]  (0x384358880 0x3843589d8) [0x2c5ee2a80 - Unity Child Domain]
#8  0x00000384358814 in  UnityEngine.Experimental.Rendering.ShaderWarmup:WarmupShaderFromCollection (UnityEngine.ShaderVariantCollection,UnityEngine.Shader,UnityEngine.Experimental.Rendering.ShaderWarmupSetup) [{0x36a4e3f70} + 0x4c]  (0x3843587c8 0x384358830) [0x2c5ee2a80 - Unity Child Domain]
...
1 Like

Any update on this? It’s blocking us from upgrading

It’s been a week since my bug report (IN-70158), which included a repro. Is there any update yet?

I tried upgrading to 21f1, but still get the same IDE and Xcode crash.

1 Like

Hey there @yezNL! Just following up on this. I see the ticket was resolved as fixed in 2022.3.23, and I just gave it a try in latest (2022.3.25) and I don’t see the crash. Did this news reach you? Are you unblocked?

Please let us know and I’ll mark this thread as solved if you’re unblocked. Thanks!

2 Likes

Thanks for following up! Yes, that did fix the issue, thank you :slight_smile: