Segfault building on current Ubuntu 15.10 dev branch

Just tried building UE4Editor on my test box, which is currently running the dev branch of Ubuntu 15.10. I know that building a large dev project on a dev platform is… unfortunate, but I thought I’d pass on this bug report in case it is useful.

The test box is an AMD A10-7800 Radeon R7, and has 16GB of RAM.

I first tried to build 4.8.3, which came up with the hlslcc invalid header problem, documented elsewhere. I then tried 4.9.0-preview-3 and finally the master branch of the repo. Both of these builds produced a segfault in the same place. The backtrace is below.

If I haven’t resolved this issue by the end of next week, I’m going to flatten this box and rebuild it with Ubuntu 15.04 (for another project), but if anyone has any ideas about what the problem is, I’d be grateful!

0 __memset_sse2 () at …/sysdeps/x86_64/multiarch/…/memset.S:80
1 0x00007ffff702f811 in FGenericPlatformMemory::Memset (Dest=0x7fffac17af90, Char=221 ‘\335’, Count=140736080621456) at /home/richard/ue/4.9.0/Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformMemory.h:261
2 FMemory::Memset (Dest=0x7fffac17af90, Char=221 ‘\335’, Count=140736080621456) at /home/richard/ue/4.9.0/Engine/Source/Runtime/Core/Public/HAL/UnrealMemory.h:38
3 FMallocJemalloc::Free (this=, Ptr=0x7fffac17af90) at /home/richard/ue/4.9.0/Engine/Source/Runtime/Core/Private/HAL/MallocJemalloc.cpp:115
4 0x00007ffff707dfa4 in FMemory::Free (Original=0x7fffac17af90) at /home/richard/ue/4.9.0/Engine/Source/Runtime/Core/Private/HAL/UnrealMemory.cpp:114
5 0x00007fffaab99e16 in operator delete (Ptr=0x7fffac17af90) at /home/richard/ue/4.9.0/Engine/Source/Developer/ShaderFormatOpenGL/Private/ShaderFormatOpenGL.cpp:223
6 0x00007fffaabd11ab in SCBuffer::AddMember(glsl_type const*, ir_variable*) () from /home/richard/ue/4.9.0/Engine/Binaries/Linux/libUE4Editor-ShaderFormatOpenGL.so
7 0x00007fffaabcc1af in ast_cbuffer_declaration::hir(exec_list*, _mesa_glsl_parse_state*) () from /home/richard/ue/4.9.0/Engine/Binaries/Linux/libUE4Editor-ShaderFormatOpenGL.so
8 0x00007fffaabc29e1 in _mesa_ast_to_hir(exec_list*, _mesa_glsl_parse_state*) () from /home/richard/ue/4.9.0/Engine/Binaries/Linux/libUE4Editor-ShaderFormatOpenGL.so
9 0x00007fffaabc1d7f in FHlslCrossCompilerContext::RunFrontend(char const**) () from /home/richard/ue/4.9.0/Engine/Binaries/Linux/libUE4Editor-ShaderFormatOpenGL.so
10 0x00007fffaabc2235 in FHlslCrossCompilerContext::Run(char const*, char const*, FCodeBackend*, char**, char**) () from /home/richard/ue/4.9.0/Engine/Binaries/Linux/libUE4Editor-ShaderFormatOpenGL.so
11 0x00007fffaab93033 in CompileShader_Windows_OGL (Input=…, Output=…, WorkingDirectory=…, Version=GLSL_150) at /home/richard/ue/4.9.0/Engine/Source/Developer/ShaderFormatOpenGL/Private/OpenGLShaderCompiler.cpp:1335
12 0x00007ffff47ed85b in FShaderCompileThreadRunnable::CompileDirectlyThroughDll (this=0x7fffb9ce4dd0) at /home/richard/ue/4.9.0/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:716
13 0x00007ffff47ed9f1 in FShaderCompileThreadRunnable::CompilingLoop (this=0x7fffb9ce4dd0) at /home/richard/ue/4.9.0/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:769
14 0x00007ffff47e6939 in FShaderCompileThreadRunnableBase::Run (this=0x7fffb9ce4dd0) at /home/richard/ue/4.9.0/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp:385
15 0x00007ffff7033e74 in FRunnableThreadPThread::Run (this=0x7fffbc9d7380) at /home/richard/ue/4.9.0/Engine/Source/Runtime/Core/Private/HAL/PThreadRunnableThread.cpp:26
16 0x00007ffff7075950 in FRunnableThreadPThread::_ThreadProc (pThis=0x7fffbc9d7380) at /home/richard/ue/4.9.0/Engine/Source/Runtime/Core/Private/GenericPlatform/…/HAL/PThreadRunnableThread.h:167
17 0x00007ffff7bc26aa in start_thread (arg=0x7fffb1bff700) at pthread_create.c:333
18 0x00007fffec0c6eed in clone () at …/sysdeps/unix/sysv/linux/x86_64/clone.S:109

Hey archaro-

I’m seeing a number of lines that lead me to believe there may be a memory issue. I would make sure that there is enough space on the drive you’re trying to install to. Seeing that you’re using the master branch this could be the cause or it could be bad build.

Cheers

Hi ,

I’ve tried master and 4.9.0-preview-3 and had the same problem. I’ll pull master again tonight and do another build from scratch.

There is currently about 3TB free on the HDD. I’ve just watched the memory usage while starting UE4Engine, and I never had less than 10GB free/cache. Swap is 16GB and not used at all.

I was wondering if it is something to do with newer OpenGL libs in 15.10. It will be interesting to see if the problem occurs on 15.04, but it will be a week or two before I get around to trying that.

Hmm. Curiouser and curiouser. I re-cloned the repo (master), ran Setup.sh and GenerateProjectFiles.sh, then make UE4Editor UE4Game UnrealPak CrashReportClient ShaderCompileWorker UnrealLightmass.

cd Engine/Binaries/Linux && ./UE4Editor

This time, I get what appears to be several hundred messages like this (same as the problem mentioned elsewhere in 4.8.0):
[2015.08.20-22.40.16:272][ 0]LogOpenGLShaderCompiler:Error: Bad hlslcc header found
[2015.08.20-22.40.16:272][ 0]LogOpenGLShaderCompiler:Error: Bad hlslcc header found! Missing ‘#’!

I then get this:
Signal 11 caught.
EngineCrashHandler: Signal=11
[2015.08.20-22.40.27:462][ 0]LogLinux: === Critical error: ===
Unhandled Exception: SIGSEGV: invalid attempt to access memory at address 0x00000003

[2015.08.20-22.40.27:462][ 0]LogLinux: Assertion failed: Assertion failed: [File:/home/richard/ue/4.9.0/Engine/Source/Runtime/ShaderCore/Private/ShaderParameters.cpp] [Line: 58]
Failure to bind non-optional shader resource parameter InTexture! The parameter is either not present in the shader, or the shader compiler optimized it out.

Try rebuilding libhlslcc.a locally (there are makefiles) and then relinking the editor.

Also, there’s a way to run CrossCompileTool to repro a particular shader compilation problem, please see comments in this thread: ShaderCompileWorker expects different HLSL header format - Programming & Scripting - Epic Developer Community Forums

Thanks for the suggestions. Unfortunately I’ve had to rebuild this box for another project. I’ll have another go at building UE in a few weeks.