UnrealEngine 4.18 fails to compile

Seems like UHT (UnrealHeaderTool) crashes on your system for an unknown reason. This does not normally happen, so we need your help to determine the culprit. Could you run the following command:

gdb --args Engine/Binaries/Linux/UnrealHeaderTool CrashReportClient "/opt/GIT/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Shipping/CrashReportClient.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -NoEnginePlugins

After gdb loads, please type “run”. Once you get a crash, please type “bt” and paste the callstack here.

Hi, I successfully built UnrealEngine on one machine but experiencing issues on another machine. At the end of the message is a dump of the messages I got after executing : ./Setup.sh then ./GenerateProjectFiles.sh

The failure comes at the very beginning of the make.

A description of the hardware :

  • OS : Linux Ubuntu 16.04.3 LTS x86_64
  • Graphic card: Nvidia GTX 670 ; driver version : Nvidia drivers x86_64-384.90
  • CPU : Intel(R) Core™2 Duo CPU E8200

For the software, what seems to me relevant (but please ask if more is required to diagnose):

  • mono : 5.4.0.201
  • xbuild : 14.0

I actually update mono/xbuild from the mono project as I thought it might help; but this is unsucessfull.

I also tried to set a higher verbosity in mono/xbuild but this dumps a lot and a lot of information from which I didn’t anything clear indicating where the failure might come from.

Any help would be greatly appreciated :slight_smile:
Thanks.

gpu01:/opt/GIT/UnrealEngine:fix_jer$ make
bash "/opt/GIT/UnrealEngine/Engine/Build/BatchFiles/Linux/Build.sh" CrashReportClient Linux Shipping  
Building CrashReportClient...
Using 'git status' to determine working set for adaptive non-unity build.
Creating makefile for CrashReportClient (no existing makefile)
Performing full C++ include scan (no include cache file)
Using clang version '3.9.1' (string), 3 (major), 9 (minor), 1 (patch)
Building UnrealHeaderTool...
Using 'git status' to determine working set for adaptive non-unity build.
Target is up to date
Total build time: 0,60 seconds (NoActionsToExecute executor: 0,00 seconds)
Parsing headers for CrashReportClient
  Running UnrealHeaderTool CrashReportClient "/opt/GIT/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Shipping/CrashReportClient.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -NoEnginePlugins
Error: UnrealHeaderTool failed for target 'CrashReportClient' (platform: Linux, module info: /opt/GIT/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Shipping/CrashReportClient.uhtmanifest, exit code: CrashOrAssert (3)).
Makefile:252 : la recette pour la cible « CrashReportClient-Linux-Shipping » a échouée
make: *** [CrashReportClient-Linux-Shipping] Erreur 3

The process fails with exit code 03 but the backtrace is empty :

gpu01:/opt/GIT/UnrealEngine:fix_jer$  gdb --args Engine/Binaries/Linux/UnrealHeaderTool CrashReportClient "/opt/GIT/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Shipping/CrashReportCl
ient.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -NoEnginePlugins
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Registered pretty printers for UE4 classes
Reading symbols from Engine/Binaries/Linux/UnrealHeaderTool...done.
(gdb) run
Starting program: /opt/GIT/UnrealEngine/Engine/Binaries/Linux/UnrealHeaderTool CrashReportClient /opt/GIT/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Shipping/CrashReportClient.uhtmanifest -LogCmds=loginit\ warning,\ logexit\ warning,\ logdatabase\ error -Unattended -WarningsAsErrors -NoEnginePlugins
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Inferior 1 (process 8643) exited with code 03]
(gdb) bt
No stack.
(gdb)

The program exits with code 03, but the backtrace is empty :

gpu01:/opt/GIT/UnrealEngine:fix_jer$  gdb --args Engine/Binaries/Linux/UnrealHeaderTool CrashReportClient "/opt/GIT/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Shipping/CrashReportClient.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -NoEnginePlugins
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Registered pretty printers for UE4 classes
Reading symbols from Engine/Binaries/Linux/UnrealHeaderTool...done.
(gdb) run
Starting program: /opt/GIT/UnrealEngine/Engine/Binaries/Linux/UnrealHeaderTool CrashReportClient /opt/GIT/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Shipping/CrashReportClient.uhtmanifest -LogCmds=loginit\ warning,\ logexit\ warning,\ logdatabase\ error -Unattended -WarningsAsErrors -NoEnginePlugins
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Inferior 1 (process 6546) exited with code 03]
(gdb) bt
No stack.
(gdb)

I gave a try with :

gpu01:/opt/GIT/UnrealEngine:fix_jer$ chmod a+rw -R .

but it still failed the same way.

Also, please check that the permissions for the user you’re running under are sufficient to write under /opt/GIT/UnrealEngine. Particularly, Intermediate, Saved folders need to be writeable.

Well, alas we need to drill even deeper here. Upon loading UHT in gdb, set “break FEngineLoop::PreInit” and see if you can find which condition makes it eturn a non-zero return code.

Also, removing -logcmds argument from the UHT invocation may help (it will unsuppress some more logs). Try that first and see if you’re getting a bit more info.

UHT should return 0 on the successful run. It doesn’t crash but most likely it fails to init. UBT will not proceed if UHT has not been successful.

By the way, simply calling the UHT does not seems to trigger any issue :

gpu01:/opt/GIT/UnrealEngine:fix_jer$ ./Engine/Binaries/Linux/UnrealHeaderTool CrashReportClient “/opt/GIT/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Shipping/CrashReportClient.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -NoEnginePlugins
gpu01:/opt/GIT/UnrealEngine:fix_jer$

Is there an issue in catching the exit code ?

Ok , i break at FEngineLoop::PreInit and then “next” until it failed. It skips several tests and then enters this one :

// Check for special instruction cpu support if needed
if (FPlatformMisc::NeedsNonoptionalCPUFeaturesCheck())
{
        bool bHasNonoptionalCPUFeatures = FPlatformMisc::HasNonoptionalCPUFeatures();
        // If it's not supported, we'll crash later so better to return an error
        if (!bHasNonoptionalCPUFeatures)
        {
                FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("RequiresNonoptionalCPUFeatures", "Error: This application requires a CPU that supports the specific instruction set(s)"));
                return -1;
        }
}

which I confirm by adding some a “printf” before the FMessageDialog and it gets printed out. So it seems my CPU does not have the NonoptionalCPUFeatures.

Yeah, I should have noticed that earlier from your CPU info. You can disable that check by changing

#define PLATFORM_ENABLE_POPCNT_INTRINSIC  0

in LinuxPlatform.h.

seems like the issue is solved, now, it is compiling. Time for me to sleep letting the compiler doing its job.

Thanks so much !

digging into the HasNonoptionalCPUFeatures(), inserting

printf(“Result is %u %u %u %u\n”, Info[0], Info[1], Info[2], Info[3]);

after the __cpuid call , it returns :
67190 16910336 582653 3219913727

And bHasNonOptionalFeature is effectively set to false;

I’m not sure of what I’m going to say, but looking at cpuid.h, the 1 << 23 bit tested seems to be the

/* %ecx */ 
#define bit_POPCNT  (1 << 23)

and I’m not sure what to say now.

This was fixed in 4.18 branch (will be included in 4.18.1 release) - you can either clone 4.18 branch instead of release or cherry pick this commit.