Clang: error: unable to execute command: Segmentation fault

Hi,
I’m trying to build Unreal Engine 4.8 on Debian 8, but I keep running into the following error:

clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see invocation)

Here is the rest of the output from this morning (Sep 6 2015):

@debian:~/UnrealEngine$ make
bash "/home//UnrealEngine"/Engine/Build/BatchFiles/Linux/Build.sh CrashReportClient Linux Development  
Building CrashReportClient...
Using clang version '3.5.0' (string), 3 (major), 5 (minor), 0 (patch)
Building UnrealHeaderTool...
Using clang version '3.5.0' (string), 3 (major), 5 (minor), 0 (patch)
Performing 21 actions (5 in parallel)
[4/21] Compile Module.CoreUObject.1_of_4.cpp
[5/21] Compile Module.CoreUObject.3_of_4.cpp
[1/21] Compile CorePrivatePCH.h
[2/21] Compile Module..cpp
[3/21] Compile Module.Projects.cpp
[6/21] Compile Module.Core.2_of_6.cpp
[7/21] Compile Module.Core.1_of_6.cpp
[8/21] Compile Module.Core.3_of_6.cpp
[9/21] Compile Module.Core.4_of_6.cpp
[10/21] Compile Module.Core.6_of_6.cpp
[11/21] Compile Module.Core.5_of_6.cpp
[12/21] Compile Module.CoreUObject.2_of_4.cpp
[13/21] Compile Module.CoreUObject.4_of_4.cpp
[14/21] Compile Module.UnrealHeaderTool.cpp
[15/21] Compile Module.ScriptGeneratorPlugin.cpp
[16/21] Link libUnrealHeaderTool-Core.so
[17/21] Link libUnrealHeaderTool-.so
[18/21] Link libUnrealHeaderTool-Projects.so
[19/21] Link libUnrealHeaderTool-CoreUObject.so
[20/21] Link UnrealHeaderTool
[21/21] Link libUnrealHeaderTool-ScriptGeneratorPlugin.so
-------- End Detailed Actions Stats -----------------------------------------------------------
Total build time: 71.37 seconds
Parsing headers for CrashReportClient
Using binned.
[2015.09.06-14.09.37:525][  0]LogLinux:Warning: dlopen failed: /home//UnrealEngine/Engine/Binaries/Linux/: cannot read file data: Is a directory
[2015.09.06-14.09.37:526][  0]LogModuleManager:Warning: ModuleManager: Unable to load module '/home//UnrealEngine/Engine/Binaries/Linux/' because the file couldn't be loaded by the OS.
[2015.09.06-14.09.37:526][  0]LogLinux:Warning: dlopen failed: /home//UnrealEngine/Engine/Binaries/Linux/: cannot read file data: Is a directory
[2015.09.06-14.09.37:526][  0]LogModuleManager:Warning: ModuleManager: Unable to load module '/home//UnrealEngine/Engine/Binaries/Linux/' because the file couldn't be loaded by the OS.
[2015.09.06-14.09.37:526][  0]LogLinux:Warning: dlopen failed: /home//UnrealEngine/Engine/Binaries/Linux/: cannot read file data: Is a directory
[2015.09.06-14.09.37:526][  0]LogModuleManager:Warning: ModuleManager: Unable to load module '/home//UnrealEngine/Engine/Binaries/Linux/' because the file couldn't be loaded by the OS.
[2015.09.06-14.09.37:526][  0]LogLinux:Warning: dlopen failed: /home//UnrealEngine/Engine/Binaries/Linux/: cannot read file data: Is a directory
[2015.09.06-14.09.37:526][  0]LogModuleManager:Warning: ModuleManager: Unable to load module '/home//UnrealEngine/Engine/Binaries/Linux/' because the file couldn't be loaded by the OS.
[2015.09.06-14.09.37:526][  0]LogTaskGraph: Started task graph with 3 named threads and 8 total threads.
[2015.09.06-14.09.37:526][  0]LogTextLocalizationManager: The requested culture ('en_US') has no localization data; parent culture's ('en') localization data will be used.
[2015.09.06-14.09.37:552][  0]LogCompile: UHT Command Line: /home//UnrealEngine/Engine/Source/../Binaries/Linux/UnrealHeaderTool CrashReportClient /home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Development/UnrealHeaderTool.manifest "-LogCmds=loginit warning, logexit warning, logdatabase error"
[2015.09.06-14.09.37:552][  0]LogCompile: Loaded manifest: /home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Development/UnrealHeaderTool.manifest
[2015.09.06-14.09.37:552][  0]LogCompile: Manifest.IsGameTarget=False
[2015.09.06-14.09.37:552][  0]LogCompile: Manifest.RootLocalPath=/home//UnrealEngine
[2015.09.06-14.09.37:552][  0]LogCompile: Manifest.RootBuildPath=/home//UnrealEngine/
[2015.09.06-14.09.37:552][  0]LogCompile: Manifest.TargetName=CrashReportClient
[2015.09.06-14.09.37:552][  0]LogCompile: Manifest.Modules=2
[2015.09.06-14.09.37:552][  0]LogCompile:   CoreUObject
[2015.09.06-14.09.37:552][  0]LogCompile:   .BaseDirectory=/home//UnrealEngine/Engine/Source/Runtime/CoreUObject/
[2015.09.06-14.09.37:552][  0]LogCompile:   .IncludeBase=/home//UnrealEngine/Engine/Source/Runtime/CoreUObject/
[2015.09.06-14.09.37:552][  0]LogCompile:   .GeneratedIncludeDirectory=/home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Inc/CoreUObject/
[2015.09.06-14.09.37:552][  0]LogCompile:   .SaveExportedHeaders=True
[2015.09.06-14.09.37:552][  0]LogCompile:   .GeneratedCPPFilenameBase=/home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Inc/CoreUObject/CoreUObject.generated
[2015.09.06-14.09.37:552][  0]LogCompile:   .ModuleType=Runtime
[2015.09.06-14.09.37:552][  0]LogCompile:   InputCore
[2015.09.06-14.09.37:552][  0]LogCompile:   .BaseDirectory=/home//UnrealEngine/Engine/Source/Runtime/InputCore/
[2015.09.06-14.09.37:552][  0]LogCompile:   .IncludeBase=/home//UnrealEngine/Engine/Source/Runtime/InputCore/
[2015.09.06-14.09.37:552][  0]LogCompile:   .GeneratedIncludeDirectory=/home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Inc/InputCore/
[2015.09.06-14.09.37:552][  0]LogCompile:   .SaveExportedHeaders=True
[2015.09.06-14.09.37:552][  0]LogCompile:   .GeneratedCPPFilenameBase=/home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Inc/InputCore/InputCore.generated
[2015.09.06-14.09.37:552][  0]LogCompile:   .ModuleType=Runtime
[2015.09.06-14.09.37:556][  0]LogCompile: Preparsed module /Script/CoreUObject containing 1 files(s) in 0.00 secs.
[2015.09.06-14.09.37:557][  0]LogCompile: Preparsed module /Script/InputCore containing 1 files(s) in 0.00 secs.
[2015.09.06-14.09.37:567][  0]LogCompile: Exporting native class declarations for /Script/CoreUObject
[2015.09.06-14.09.37:574][  0]LogCompile: Autogenerating boilerplate cpp: CoreUObject.generated.cpp
[2015.09.06-14.09.37:581][  0]LogCompile: Exported updated C++ header: /home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Inc/CoreUObject/Object.generated.h
[2015.09.06-14.09.37:582][  0]LogCompile: Exported updated C++ header: /home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Inc/CoreUObject/CoreUObject.generated.dep.h
[2015.09.06-14.09.37:582][  0]LogCompile: Exported updated C++ header: /home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Inc/CoreUObject/CoreUObject.generated.cpp
[2015.09.06-14.09.37:582][  0]LogCompile: Success: Parsed 944 line(s), 57 statement(s) in 0.02 secs.
[2015.09.06-14.09.37:583][  0]LogCompile: Exporting native class declarations for /Script/InputCore
[2015.09.06-14.09.37:586][  0]LogCompile: Autogenerating boilerplate cpp: InputCore.generated.cpp
[2015.09.06-14.09.37:588][  0]LogCompile: Exported updated C++ header: /home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Inc/InputCore/InputCoreTypes.generated.h
[2015.09.06-14.09.37:589][  0]LogCompile: Exported updated C++ header: /home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Inc/InputCore/InputCoreClasses.h
[2015.09.06-14.09.37:589][  0]LogCompile: Exported updated C++ header: /home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Inc/InputCore/InputCore.generated.dep.h
[2015.09.06-14.09.37:589][  0]LogCompile: Exported updated C++ header: /home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Inc/InputCore/InputCore.generated.cpp
[2015.09.06-14.09.37:590][  0]LogCompile: Success: Parsed 468 line(s), 15 statement(s) in 0.01 secs.
[2015.09.06-14.09.37:590][  0]LogCompile: Preparsing 2 modules took 0.005006 seconds
[2015.09.06-14.09.37:590][  0]LogCompile: Parsing took 0.010847 seconds
[2015.09.06-14.09.37:590][  0]LogCompile: Code generation took 0.021294 seconds
[2015.09.06-14.09.37:590][  0]LogCompile: ScriptPlugin overhead was 0.000000 seconds
[2015.09.06-14.09.37:590][  0]LogCompile: Macroize time was 0.000107 seconds
[2015.09.06-14.09.37:590][  0]LogCompile: Tabify time was was 0.002576 seconds
Reflection code generated for CrashReportClient
Performing 24 actions (5 in parallel)
[4/24] Compile Module.CoreUObject.3_of_4.cpp
[3/24] Compile Module.CrashReportClient.cpp
[1/24] Compile CorePrivatePCH.h
[2/24] Compile Module.CoreUObject.1_of_4.cpp
[5/24] Compile Module.CoreUObject.2_of_4.cpp
[6/24] Compile Module.Core.2_of_6.cpp
[7/24] Compile Module.Core.3_of_6.cpp
[8/24] Compile Module.Core.1_of_6.cpp
[9/24] Compile Module.SourceControl.cpp
[10/24] Compile Module.CoreUObject.4_of_4.cpp
[11/24] Compile Module.InputCore.cpp
[12/24] Compile Module.XmlParser.cpp
[13/24] Compile InputCore.generated.cpp
[14/24] Compile Module.Core.4_of_6.cpp
[15/24] Compile CoreUObject.generated.cpp
[16/24] Compile Module.HTTP.cpp
[17/24] Compile Module.AnalyticsET.cpp
[18/24] Compile Module.Projects.cpp
[19/24] Compile Module.Core.6_of_6.cpp
[20/24] Compile Module.CrashDebugHelper.cpp
[21/24] Compile Module.Core.5_of_6.cpp
0  libLLVM-3.5.so.1 0x00007fb75ae64c22 llvm::sys::PrintStackTrace(_IO_FILE*) + 34
1  libLLVM-3.5.so.1 0x00007fb75ae646cc
2  libpthread.so.0  0x00007fb759ae68d0
3  libLLVM-3.5.so.1 0x00007fb75a77f817
4  libLLVM-3.5.so.1 0x00007fb75a77fc65
5  libLLVM-3.5.so.1 0x00007fb75a4e9a17 llvm::FPPassManager::runOnFunction(llvm::Function&) + 471
6  libLLVM-3.5.so.1 0x00007fb75a7c66c3
7  libLLVM-3.5.so.1 0x00007fb75a4ec459 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 697
8  clang            0x000000000084be80 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 2912
9  clang            0x0000000000846e01
10 clang            0x00000000009e1ad5 clang::ParseAST(clang::Sema&, bool, bool) + 741
11 clang            0x000000000084624f clang::CodeGenAction::ExecuteAction() + 31
12 clang            0x00000000006c94b6 clang::FrontendAction::Execute() + 118
13 clang            0x00000000006a71a0 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 256
14 clang            0x0000000000690563 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1827
15 clang            0x000000000068ae88 cc1_main(char const**, char const**, char const*, void*) + 1224
16 clang            0x000000000068a4aa main + 8970
17 libc.so.6        0x00007fb7586beb45 __libc_start_main + 245
18 clang            0x000000000068a526
Stack dump:
0.	Program arguments: /usr/lib/llvm-3.5/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -main-file-name Module.Core.6_of_6.cpp -mrelocation-model static -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -target-feature +mmx -target-feature +sse -target-feature +sse2 -target-linker-version 2.25 -momit-leaf-frame-pointer -gdwarf-3 -dwarf-column-info -coverage-file /home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Development/Core/Module.Core.6_of_6.cpp.o -resource-dir /usr/lib/llvm-3.5/bin/../lib/clang/3.5.0 -include-pch /home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Development/Core/CorePrivatePCH.h.gch -D PLATFORM_EXCEPTIONS_DISABLED=0 -D _LINUX64 -D USE_CHECKS_IN_SHIPPING=1 -D IS_PROGRAM=1 -D UNICODE -D _UNICODE -D __UNREAL__ -D IS_MONOLITHIC=1 -D WITH_ENGINE=0 -D WITH_UNREAL_DEVELOPER_TOOLS=0 -D WITH_COREUOBJECT=1 -D USE_STATS_WITHOUT_ENGINE=0 -D WITH_PLUGIN_SUPPORT=0 -D USE_LOGGING_IN_SHIPPING=1 -D UE_BUILD_MINIMAL=1 -D WITH_EDITOR=0 -D WITH_SERVER_CODE=1 -D UBT_COMPILED_PLATFORM=Linux -D PLATFORM_LINUX=1 -D LINUX=1 -D WITH_DATABASE_SUPPORT=0 -D NDEBUG=1 -D UE_BUILD_DEVELOPMENT=1 -D ORIGINAL_FILE_NAME=CrashReportClient-Linux-Development -D UE_ENABLE_ICU=0 -D WITH_STEAMWORKS=0 -D WITH_DIRECTXMATH=0 -D UE_ENABLE_ICU=0 -D WITH_STEAMWORKS=0 -D WITH_DIRECTXMATH=0 -D CORE_API= -D PLATFORM_SUPPORTS_JEMALLOC=1 -D SDL_WITH_EPIC_EXTENSIONS=1 -D ANALYTICS_API= -I /home//UnrealEngine/Engine/Source -I Developer/DerivedDataCache/Public -I Developer/SynthBenchmark/Public -I Runtime/Core/Private -I Runtime/Core/Private/Misc -I Runtime/Core/Private/Internationalization -I Runtime/Core/Private/Internationalization/Cultures -I Runtime/Core/Public -I Runtime/Core/Public/Internationalization -I Runtime/Core/Public/Async -I Runtime/Core/Public/Containers -I Runtime/Core/Public/Delegates -I Runtime/Core/Public/GenericPlatform -I Runtime/Core/Public/HAL -I Runtime/Core/Public/Logging -I Runtime/Core/Public/Math -I Runtime/Core/Public/Misc -I Runtime/Core/Public/Modules -I Runtime/Core/Public/Modules/Boilerplate -I Runtime/Core/Public/ProfilingDebugging -I Runtime/Core/Public/Serialization -I Runtime/Core/Public/Serialization/Csv -I Runtime/Core/Public/Stats -I Runtime/Core/Public/Templates -I Runtime/Core/Public/UObject -I Runtime/Core/Public/Linux -I Runtime/Core -I ThirdParty/zlib/zlib-1.2.5/Inc -I ThirdParty/zlib -I ThirdParty/jemalloc/include/Linux/x86_64-unknown-linux-gnu -I ThirdParty/jemalloc -I ThirdParty/elftoolchain/include/x86_64-unknown-linux-gnu -I ThirdParty/elftoolchain -I ThirdParty/SDL2/SDL-gui-backend/include -I ThirdParty/SDL2 -I Developer/TargetPlatform/Public -I Developer/TargetPlatform/Public/Common -I Developer/TargetPlatform/Public/Interfaces -I Developer/TargetPlatform -I Developer/DerivedDataCache -I Runtime/InputDevice/Public -I Runtime/InputDevice -I Runtime/Analytics/Analytics/Public -I Runtime/Analytics/Analytics/Public/Interfaces -I Runtime/Analytics/Analytics -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/backward -internal-isystem /usr/include/clang/3.5.0/include/ -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-3.5/bin/../lib/clang/3.5.0/include -internal-externc-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wall -Werror -Wsequence-point -Wno-unused-private-field -Wno-tautological-compare -Wno-undefined-bool-conversion -Wno-unused-variable -Wno-unused-function -Wno-switch -Wno-unknown-pragmas -Wno-invalid-offsetof -Wshadow -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /home//UnrealEngine/Engine/Source -ferror-limit 19 -fmessage-length 0 -mstackrealign -fno-rtti -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o /home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Development/Core/Module.Core.6_of_6.cpp.o -x c++ /home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Development/Core/Module.Core.6_of_6.cpp 
1.	<eof> parser at end of file
2.	Per-module optimization passes
3.	Running pass 'CallGraph Pass Manager' on module '/home//UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Development/Core/Module.Core.6_of_6.cpp'.
4.	Running pass 'Combine redundant instructions' on function '@_ZN5FName22SplitNameWithCheckImplIcEEbPKT_PS1_iRi'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0)
Target: x86_64-pc-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://bugs.debian.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg: 
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/Module-eda301.cpp
clang: note: diagnostic msg: /tmp/Module-eda301.sh
clang: note: diagnostic msg: 
********************
[22/24] Compile Module..cpp
[23/24] Compile Module.Analytics.cpp
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: /home//UnrealEngine/Engine/Binaries/Linux/CrashReportClient-Linux-Development
Total build time: 144.28 seconds
Makefile:253: recipe for target 'CrashReportClient' failed
make: *** [CrashReportClient] Error 5

Also, I ran into this error on a completely different distro (Fedora 22) but on the same machine. Everything is up to date. Here is some information about my system:

Memory: 7.8 GiB
Processor: AMD Phenom II X6 1055T Processor x 6 (x86_64, 2.8GHz)
Graphics: Gallium 0.4 on NVE4 (GeForce GTX 760)
Base system: Debian GNU/Linux 8 (jessie) 64-bit
Disk: 205.3

Additionally, here are Module-eda301.cpp and Module-eda301.sh.

Thanks.

It’s actually clang (LLVM) that crashed, try reinstalling or updating Android SDK as well as LLVM

Created a report at clang 24609 – clang: error: unable to execute command: Segmentation fault (core dumped)

I’m running Arch Linux, the problem is that I got the latest version. You don’t need to install/update the latest clang and llvm!

Even so, Unreal Engine (v.4.10) can only be compiled with clang version 3.5 or 3.6. Meaning, you need to install the older clang version via ‘agetpkg’ instead of pacman or yaourt. Don’t forget to install the version versions of llvm and llvm-lib.

NOTE: Remove the old clang version first incl. lib32-llvm-libs, llvm-libs packages.