Shader Compiler SIGSERV during build

,

We’re trying to build our project on a windows machine in a docker container running a full windows:1809 image with dotnet 4.8 and unity 2020.3.25f1. We build using a custom build method that works fine on our desktop pc’s running the same Unity version, but when we run it in a container it fails.

The build fails with a memory access violation after starting the shader compiler, but the stack trace isn’t particularly helpfull:

Launched and connected shader compiler UnityShaderCompiler.exe after 0.08 seconds
Shader 'Xray/CharacterLit': fallback shader 'Hidden/Universal Render Pipeline/FallbackError' not found
Shader 'Hidden/FXAA Preset 3': fallback shader 'Hidden/FXAA II' not found
Shader 'URP/LitProp': fallback shader 'Hidden/Universal Render Pipeline/FallbackError' not found
Shader 'Hidden/Unlit/Text 1': fallback shader 'Unlit/Text' not found
Shader 'Universal Render Pipeline/Terrain/Lit': fallback shader 'Hidden/Universal Render Pipeline/FallbackError' not found
Shader 'Universal Render Pipeline/Terrain/Lit': dependency 'AddPassShader' shader 'Hidden/Universal Render Pipeline/Terrain/Lit (Add Pass)' not found
Shader 'Universal Render Pipeline/Terrain/Lit': dependency 'BaseMapShader' shader 'Hidden/Universal Render Pipeline/Terrain/Lit (Base Pass)' not found
Shader 'Universal Render Pipeline/Terrain/Lit': dependency 'BaseMapGenShader' shader 'Hidden/Universal Render Pipeline/Terrain/Lit (Basemap Gen)' not found
Shader 'Hidden/Universal Render Pipeline/Terrain/Lit (Add Pass)': fallback shader 'Hidden/Universal Render Pipeline/FallbackError' not found
Shader 'Universal Render Pipeline/Unlit': fallback shader 'Hidden/Universal Render Pipeline/FallbackError' not found
Shader 'Universal Render Pipeline/Particles/Lit': fallback shader 'Universal Render Pipeline/Particles/Simple Lit' not found
Shader 'Hidden/Unlit/Text (TextureClip)': fallback shader 'Unlit/Text' not found
Shader 'Hidden/Unlit/Text 3': fallback shader 'Unlit/Text' not found
Shader 'HBS/Diffuse Switch': fallback shader 'HBS/Transparent/Cutout/VertexLit' not found
Shader 'Hidden/Unlit/Text 2': fallback shader 'Unlit/Text' not found
Shader 'Universal Render Pipeline/Particles/Simple Lit': fallback shader 'Universal Render Pipeline/Particles/Unlit' not found
Received signal SIGSEGV
Stack trace:
0x00007ff68ce8c89a (Unity)
0x00007ff68ce890e4 (Unity)
0x00007ff68ce83205 (Unity)
0x00007ff68ce8801c (Unity)
0x00007ff68d20c7a8 (Unity)
0x00007ff68d513e6f (Unity)
0x00007ff68d4f4f0b (Unity)
0x00007ff68d4f4576 (Unity)
0x00007ff68d4f9833 (Unity)
0x00007ff68d4fa0e4 (Unity)
0x00007ff68d4f9e03 (Unity)
0x00007ff68c7857b2 (Unity)
0x00007ff68de80844 (Unity)
0x00007ff68de807cb (Unity)
0x00007ff68e879e89 (Unity)
0x0000028df1b296a7 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.AssetImporter:GetAtPath (string)
0x0000028df0afda8b (Mono JIT Code) UnityEditor.ModelImporterPostProcessor:OnPostprocessAllAssets (string[],string[],string[],string[])
0x0000028df0afd71e (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_object_object_object_object (object,intptr,intptr,intptr)
0x00007fffd695f1e0 (mono-2.0-bdwgc)
0x00007fffd68e2ac2 (mono-2.0-bdwgc)
0x00007fffd68ebcf2 (mono-2.0-bdwgc)
0x00007fffd68ec489 (mono-2.0-bdwgc)
0x00007fffd68ebc86 (mono-2.0-bdwgc)
0x00007fffd68904a4 (mono-2.0-bdwgc)
0x0000028defa9a4ed (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
0x0000028defa9990b (Mono JIT Code) System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
0x0000028defa9982e (Mono JIT Code) System.Reflection.MethodBase:Invoke (object,object[])
0x0000028df0b1f593 (Mono JIT Code) UnityEditor.AssetPostprocessingInternal:InvokeMethod (System.Reflection.MethodInfo,object[])
0x0000028df0b1f15b (Mono JIT Code) UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets (string[],string[],string[],string[],string[])
0x0000028df0b1f415 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_object_object_object_object_object (object,intptr,intptr,intptr)
0x00007fffd695f1e0 (mono-2.0-bdwgc)
0x00007fffd68e2ac2 ((<unknown>))
0x00007fffd68ebb1f ((<unknown>))
0x00007ff68d48cd34 ((<unknown>))
0x00007ff68d488011 ((<unknown>))
0x00007ff68dc857c3 ((<unknown>))
0x00007ff68e352fd1 ((<unknown>))
0x00007ff68e3afb16 ((<unknown>))
0x00007ff68e3a9338 ((<unknown>))
0x00007ff68e3b4a0b ((<unknown>))
0x00007ff68e3bd606 ((<unknown>))
0x00007ff68e3b59f9 ((<unknown>))
0x00007ff68e349f50 ((<unknown>))
0x00007ff68de627c2 ((<unknown>))
0x00007ff68e2b7252 ((<unknown>))
0x00007ff68f945752 ((<unknown>))
0x00007ffff4337974 ((<unknown>))
0x00007ffff954a2f1 ((<unknown>))

We use URP for our project and we do get some warnings regarding build-in shaders earlier in the log that might be related to the issue:

WARNING: Shader Unsupported: 'Hidden/Universal Render Pipeline/Terrain/Lit (Base Pass)' - All subshaders removed
WARNING: Shader Did you use #pragma only_renderers and omit this platform?
WARNING: Shader If subshaders removal was intentional, you may have forgotten turning Fallback off?
WARNING: Shader Unsupported: 'Hidden/Universal Render Pipeline/Terrain/Lit (Base Pass)' - All subshaders removed
WARNING: Shader Did you use #pragma only_renderers and omit this platform?
WARNING: Shader If subshaders removal was intentional, you may have forgotten turning Fallback off?
Shader 'Hidden/Universal Render Pipeline/Terrain/Lit (Base Pass)': fallback shader 'Hidden/Universal Render Pipeline/FallbackError' not found
WARNING: Shader Unsupported: 'Hidden/Universal Render Pipeline/Terrain/Lit (Base Pass)' - All subshaders removed
WARNING: Shader Did you use #pragma only_renderers and omit this platform?
WARNING: Shader If subshaders removal was intentional, you may have forgotten turning Fallback off?
WARNING: Shader Unsupported: 'Hidden/Universal Render Pipeline/Terrain/Lit (Base Pass)' - All subshaders removed
WARNING: Shader Did you use #pragma only_renderers and omit this platform?
WARNING: Shader If subshaders removal was intentional, you may have forgotten turning Fallback off?

Additional information

  • We run the editor in batchmode using the following flags**:** -batchmode -quit -nographics -logfile [string] -projectPath [string] -customBuildPath [string]-buildVersion [string] -buildTarget [string] -executeMethod [string]

  • The project is over 100GB**.**

  • We use Gitlab CI to run our containers on a shell executor.

*edit Title is supposed to say sigsegv instead of sigserv

We have the exact same problem:

  • Building an IL2CPP Windows executable in a Windows Docker container running Microsoft Artifact Registry on Gitlab CI

  • Using Unity 2020.3.16f1

  • Getting a memory access violation after starting the shader compiler

Start importing Packages/com.unity.ui.builder/Editor/UI/Manipulators/BuilderAnchorer.uxml using Guid(ef6d330070473ea4b98e5d20d4103d02) Importer(-1,00000000000000000000000000000000)  -> (artifact id: '95e0d558ee0c9e5fed7782a199fc8892') in 0.056970 seconds
Shader 'Universal Render Pipeline/Lit': fallback shader 'Hidden/Universal Render Pipeline/FallbackError' not found
[C:\buildslave\unity\build\Modules/LocalizationEditor/LocalizationDatabase.cpp:811]Packages/com.unity.timeline/Editor/Localization/ja.po
Shader 'Universal Render Pipeline/Particles/Lit': fallback shader 'Universal Render Pipeline/Particles/SimpleLit' not found
Launched and connected shader compiler UnityShaderCompiler.exe after 0.06 seconds
Launched and connected shader compiler UnityShaderCompiler.exe after 0.05 seconds
Launched and connected shader compiler UnityShaderCompiler.exe after 0.04 seconds
Launched and connected shader compiler UnityShaderCompiler.exe after 0.04 seconds
Launched and connected shader compiler UnityShaderCompiler.exe after 0.06 seconds
Shader 'Universal Render Pipeline/Nature/SpeedTree7': dependency 'BillboardShader' shader 'Universal Render Pipeline/Nature/SpeedTree7 Billboard' not found
Shader 'Universal Render Pipeline/Terrain/Lit': dependency 'AddPassShader' shader 'Hidden/Universal Render Pipeline/Terrain/Lit (Add Pass)' not found
Shader 'Universal Render Pipeline/Terrain/Lit': dependency 'BaseMapGenShader' shader 'Hidden/Universal Render Pipeline/Terrain/Lit (Basemap Gen)' not found
Shader 'Universal Render Pipeline/Baked Lit': fallback shader 'Universal Render Pipeline/Unlit' not found
Received signal SIGSEGV
Stack trace:
0x00007ff79719970a (Unity)
0x00007ff79718e614 (Unity)
0x00007ff797175c95 (Unity)
0x00007ff79718b07c (Unity)
0x00007ff797d33895 (Unity)
0x00007ff796770f96 (Unity)
0x00007ff7967c35cf (Unity)
0x00007ff79a330acf (Unity)
0x00007ff79a32edc1 (Unity)
0x00007ff79a32ecb6 (Unity)
0x00007ff7981ba63f (Unity)
0x00007ff7981baf92 (Unity)
0x00007ff7981bb11a (Unity)
0x00007ff7981462de (Unity)
0x00007ff798146cf7 (Unity)
0x00007ff79814a243 (Unity)
0x00007ff798ddf976 (Unity)
0x00007ff79a037f05 (Unity)
0x0000020c10d71b87 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.AssetDatabase:LoadAllAssetsAtPath (string)
0x0000020c10de6963 (Mono JIT Code) UnityEditor.ModelImporterPostProcessor:OnPostprocessAllAssets (string[],string[],string[],string[])
0x0000020c10de6510 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_object_object_object_object (object,intptr,intptr,intptr)
0x00007ff863e4e660 (mono-2.0-bdwgc)
0x00007ff863dd2ae2 (mono-2.0-bdwgc)
0x00007ff863ddbd12 (mono-2.0-bdwgc)
0x00007ff863ddc4a9 (mono-2.0-bdwgc)
0x00007ff863ddbca6 (mono-2.0-bdwgc)
0x00007ff863d804c4 (mono-2.0-bdwgc)
0x0000020bebb784cd (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
0x0000020bebb7795b (Mono JIT Code) System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
0x0000020bea1f73ce (Mono JIT Code) System.Reflection.MethodBase:Invoke (object,object[])
0x0000020c10d8ae23 (Mono JIT Code) UnityEditor.AssetPostprocessingInternal:InvokeMethod (System.Reflection.MethodInfo,object[])
0x0000020c10d8aa0b (Mono JIT Code) UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets (string[],string[],string[],string[],string[])
0x0000020c10d8acc5 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_object_object_object_object_object (object,intptr,intptr,intptr)
0x00007ff863e4e660 (mono-2.0-bdwgc)
0x00007ff863dd2ae2 (mono-2.0-bdwgc)
0x00007ff863ddbb3f (mono-2.0-bdwgc)
0x00007ff7980b88f4 (Unity)
0x00007ff7980b1245 (Unity)
0x00007ff798b1b2c3 (Unity)
0x00007ff79984e2f1 (Unity)
0x00007ff7998e6926 (Unity)
0x00007ff7998e003c (Unity)
0x00007ff7998ec88b (Unity)
0x00007ff7998fbf96 (Unity)
0x00007ff7998ed879 (Unity)
0x00007ff7998393de (Unity)
0x00007ff798dbb5e6 (Unity)
0x00007ff7997624f2 (Unity)
0x00007ff79b5b34b6 (Unity)
0x00007ff8808e7974 (KERNEL32) BaseThreadInitThunk
0x00007ff88326a2f1 (ntdll) RtlUserThreadStart
Unexpected exit code 1

Turns out, increasing the RAM of the Docker container fixes the issue.