Unreal engine 4.27 build crashes (SIGSEGV) on Linux

I was able to build unreal engine 4.27 on my Ubuntu 22.04 without issues but it failed to build weeks ago and the call stack shows Vulkan related function (libUE4Editor-VulkanShaderFormat.so!DoCompileVulkanShader). Building it on Windows is still fine.

Tried a couple of different versions of NVidia drivers (535, 545 and 550) with same results. Other posts mentioned installing correct libnvida-gl-xxx packget fixed their SIGSEGV crashes but the package is already installed on my Ubuntu.

Wonder anyone had similiar issue and a solution to this.

Anyway, here’s the call stack from book log file:

LogCore: === Critical error: ===
Unhandled Exception: SIGSEGV: invalid attempt to read memory at address 0x0000000000000028

LogCore: Fatal error!

0x0000797136822145 libdxcompiler.so!_ZN8spvtools3opt24EliminateDeadMembersPass27MarkMembersAsLiveForExtractEPKNS0_11InstructionE(+0x135)
0x000079713684c09e libdxcompiler.so!UnknownFunction(0x104c09d)
0x000079713684c867 libdxcompiler.so!_ZNK8spvtools3opt10BasicBlock13WhileEachInstERKNSt3__18functionIFbPKNS0_11InstructionEEEEb(+0x106)
0x000079713684b52e libdxcompiler.so!_ZNK8spvtools3opt8Function13WhileEachInstERKNSt3__18functionIFbPKNS0_11InstructionEEEEb(+0x1ed)
0x000079713684b315 libdxcompiler.so!_ZNK8spvtools3opt8Function11ForEachInstERKNSt3__18functionIFvPKNS0_11InstructionEEEEb(+0x24)
0x0000797136821b1b libdxcompiler.so!_ZN8spvtools3opt24EliminateDeadMembersPass15FindLiveMembersEv(+0x15a)
0x00007971368219a9 libdxcompiler.so!_ZN8spvtools3opt24EliminateDeadMembersPass7ProcessEv(+0x38)
0x0000797136760d30 libdxcompiler.so!_ZN8spvtools3opt4Pass3RunEPNS0_9IRContextE(+0x1f)
0x0000797136763db0 libdxcompiler.so!_ZN8spvtools3opt11PassManager3RunEPNS0_9IRContextE(+0xdf)
0x000079713675d5ed libdxcompiler.so!_ZNK8spvtools9Optimizer3RunEPKjmPNSt3__16vectorIjNS3_9allocatorIjEEEEP23spv_optimizer_options_t(+0x17c)
0x00007971364b76df libdxcompiler.so!UnknownFunction(0xcb76de)
0x000079713654b5cc libdxcompiler.so!UnknownFunction(0xd4b5cb)
0x0000797135f1fd28 libdxcompiler.so!UnknownFunction(0x71fd27)
0x00007971359c0274 libdxcompiler.so!UnknownFunction(0x1c0273)
0x00007971359bc13a libdxcompiler.so!UnknownFunction(0x1bc139)
0x00007971359bd05f libdxcompiler.so!UnknownFunction(0x1bd05e)
0x00007971359bd6b8 libdxcompiler.so!UnknownFunction(0x1bd6b7)
0x0000797135472d8e libShaderConductor.so!UnknownFunction(0x72d8d)
0x0000797135470267 libShaderConductor.so!_ZN15ShaderConductor8Compiler7CompileERKNS0_10SourceDescERKNS0_7OptionsEPKNS0_10TargetDescEjPNS0_10ResultDescE(+0x286)
0x000079713546ffda libShaderConductor.so!_ZN15ShaderConductor8Compiler7CompileERKNS0_10SourceDescERKNS0_7OptionsERKNS0_10TargetDescE(+0x19)
0x000079714c728f0e libUE4Editor-ShaderCompilerCommon.so!CrossCompiler::FShaderConductorContext::CompileHlslToSpirv(CrossCompiler::FShaderConductorOptions const&, TArray<unsigned int, TSizedDefaultAllocator<(unsigned char)32> >&) [./unrealengine/Engine/Source/Developer/ShaderCompilerCommon/Private/ShaderCompilerCommon.cpp:3029]
0x0000797134762d24 libUE4Editor-VulkanShaderFormat.so!DoCompileVulkanShader(FShaderCompilerInput const&, FShaderCompilerOutput&, FString const&, EVulkanShaderVersion) [./unrealengine/Engine/Source/Developer/VulkanShaderFormat/Private/VulkanShaderCompiler.cpp:3121]
0x0000797230af3868 libUE4Editor-Engine.so!CompileShaderPipeline(IShaderFormat const*, FName, FShaderPipelineCompileJob*, FString const&) [./unrealengine/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderPipelineCompiler.cpp:30]
0x0000797230a8ab2d libUE4Editor-Engine.so!FShaderCompileUtilities::ExecuteShaderCompileJob(FShaderCommonCompileJob&) [./unrealengine/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:2195]
0x0000797230a8a72a libUE4Editor-Engine.so!FShaderCompileThreadRunnable::CompileDirectlyThroughDll() [./unrealengine/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:2122]
0x0000797230a8b14e libUE4Editor-Engine.so!FShaderCompileThreadRunnable::CompilingLoop() [./unrealengine/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:2344]
0x0000797230a86ce9 libUE4Editor-Engine.so!FShaderCompileThreadRunnableBase::Run() [./unrealengine/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:1751]
0x00007972330831d7 libUE4Editor-Core.so!FRunnableThreadPThread::Run() ./unrealengine/Engine/Source/Runtime/Core/Private/HAL/PThreadRunnableThread.cpp:25]
0x000079723303fa83 libUE4Editor-Core.so!FRunnableThreadPThread::_ThreadProc(void*) [./unrealengine/Engine/Source/Runtime/Core/Private/HAL/PThreadRunnableThread.h:185]
0x0000797229c94ac3 libc.so.6!UnknownFunction(0x94ac2)
0x0000797229d26850 libc.so.6!UnknownFunction(0x12684f)

LogExit: Executing StaticShutdownAfterError

Just tried to build with Ubuntu’s Nouveau display driver and the build still failed :face_exhaling: and the call stack is very similar to the one built with nVidia driver installed, only the very top fuctions in libdxcompiler.so are different.

LogCore: === Critical error: ===
Unhandled Exception: SIGSEGV: invalid attempt to read memory at address 0x00000000000218d2

LogCore: Fatal error!

0x000075184f46933f libdxcompiler.so!_ZNK8spvtools3opt11Instruction20GetSingleWordOperandEj(+0x1f)
0x000075184f43804e libdxcompiler.so!UnknownFunction(0x103804d)
0x000075184f42aebb libdxcompiler.so!_ZNK8spvtools3opt17InstructionFolder23FoldInstructionInternalEPNS0_11InstructionE(+0x13a)
0x000075184f42c965 libdxcompiler.so!_ZNK8spvtools3opt17InstructionFolder15FoldInstructionEPNS0_11InstructionE(+0x14)
0x000075184f3797d6 libdxcompiler.so!UnknownFunction(0xf797d5)
0x000075184f3db93a libdxcompiler.so!UnknownFunction(0xfdb939)
0x000075184f3da643 libdxcompiler.so!_ZN8spvtools3opt3CFG32WhileEachBlockInReversePostOrderEPNS0_10BasicBlockERKNSt3__18functionIFbS3_EEE(+0xa2)
0x000075184f3da561 libdxcompiler.so!_ZN8spvtools3opt3CFG30ForEachBlockInReversePostOrderEPNS0_10BasicBlockERKNSt3__18functionIFvS3_EEE(+0xc0)
0x000075184f377aa7 libdxcompiler.so!_ZN8spvtools3opt18SimplificationPass16SimplifyFunctionEPNS0_8FunctionE(+0x186)
0x000075184f3778eb libdxcompiler.so!_ZN8spvtools3opt18SimplificationPass7ProcessEv(+0x3a)
0x000075184f360d30 libdxcompiler.so!_ZN8spvtools3opt4Pass3RunEPNS0_9IRContextE(+0x1f)
0x000075184f363db0 libdxcompiler.so!_ZN8spvtools3opt11PassManager3RunEPNS0_9IRContextE(+0xdf)
0x000075184f35d5ed libdxcompiler.so!_ZNK8spvtools9Optimizer3RunEPKjmPNSt3__16vectorIjNS3_9allocatorIjEEEEP23spv_optimizer_options_t(+0x17c)
0x000075184f0b76df libdxcompiler.so!UnknownFunction(0xcb76de)
0x000075184f14b5cc libdxcompiler.so!UnknownFunction(0xd4b5cb)
0x000075184eb1fd28 libdxcompiler.so!UnknownFunction(0x71fd27)
0x000075184e5c0274 libdxcompiler.so!UnknownFunction(0x1c0273)
0x000075184e5bc13a libdxcompiler.so!UnknownFunction(0x1bc139)
0x000075184e5bd05f libdxcompiler.so!UnknownFunction(0x1bd05e)
0x000075184e5bd6b8 libdxcompiler.so!UnknownFunction(0x1bd6b7)
0x000075184e072d8e libShaderConductor.so!UnknownFunction(0x72d8d)
0x000075184e070267 libShaderConductor.so!_ZN15ShaderConductor8Compiler7CompileERKNS0_10SourceDescERKNS0_7OptionsEPKNS0_10TargetDescEjPNS0_10ResultDescE(+0x286)
0x000075184e06ffda libShaderConductor.so!_ZN15ShaderConductor8Compiler7CompileERKNS0_10SourceDescERKNS0_7OptionsERKNS0_10TargetDescE(+0x19)
0x0000751864dd2f0e libUE4Editor-ShaderCompilerCommon.so!CrossCompiler::FShaderConductorContext::CompileHlslToSpirv(CrossCompiler::FShaderConductorOptions const&, TArray<unsigned int, TSizedDefaultAllocator<(unsigned char)32> >&) [./unrealengine/Engine/Source/Developer/ShaderCompilerCommon/Private/ShaderCompilerCommon.cpp:3029]
0x000075184d362d24 libUE4Editor-VulkanShaderFormat.so!DoCompileVulkanShader(FShaderCompilerInput const&, FShaderCompilerOutput&, FString const&, EVulkanShaderVersion) [./unrealengine/Engine/Source/Developer/VulkanShaderFormat/Private/VulkanShaderCompiler.cpp:3121]
0x000075194948ac2e libUE4Editor-Engine.so!FShaderCompileUtilities::ExecuteShaderCompileJob(FShaderCommonCompileJob&) [./unrealengine/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:2155]
0x000075194948a72a libUE4Editor-Engine.so!FShaderCompileThreadRunnable::CompileDirectlyThroughDll() [./unrealengine/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:2122]
0x000075194948b14e libUE4Editor-Engine.so!FShaderCompileThreadRunnable::CompilingLoop() [./unrealengine/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:2344]
0x0000751949486ce9 libUE4Editor-Engine.so!FShaderCompileThreadRunnableBase::Run() [./unrealengine/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:1751]
0x000075194ba831d7 libUE4Editor-Core.so!FRunnableThreadPThread::Run() [./unrealengine/Engine/Source/Runtime/Core/Private/HAL/PThreadRunnableThread.cpp:25]
0x000075194ba3fa83 libUE4Editor-Core.so!FRunnableThreadPThread::_ThreadProc(void*) [./unrealengine/Engine/Source/Runtime/Core/Private/HAL/PThreadRunnableThread.h:185]
0x0000751942694ac3 libc.so.6!UnknownFunction(0x94ac2)
0x0000751942726850 libc.so.6!UnknownFunction(0x12684f)

LogExit: Executing StaticShutdownAfterError