Unreal Header Tool Crash when using GENERATED_BODY() instead of GENERATED_UINTERFACE_BODY() in 4.7

When using GENERATED_BODY() instead of GENERATED_UINTERFACE_BODY() in a declaration of a UInterface, the Unreal Header Tool crashes in 4.7. This compiled successfully under 4.6.

Hey BrainDx-

Are still seeing the same crash in 4.7.2? If so how are you creating your UInterface? Could you post the callstack and log files from the crash as well?

Cheers

Yes, this still occurs in 4.7.2. I’m creating the interface as follows:

UINTERFACE()
class USomeInterface : public UInterface
{
public:
	GENERATED_BODY()
};

class ISomeInterface
{
	GENERATED_IINTERFACE_BODY()

public:
	public void SomeFunction() {}
};

I believe the issue is that for some reason ClassRange is NULL in the following crash callstack:

>	UnrealHeaderTool.exe!FNativeClassHeaderGenerator::ExportInterfaceClassDeclaration(FClass * Class) Line 1861	C++
 	UnrealHeaderTool.exe!FNativeClassHeaderGenerator::ExportClassHeaderInner(FClass * Class, bool bValidNonTemporaryClass) Line 2075	C++
 	UnrealHeaderTool.exe!FNativeClassHeaderGenerator::ExportClassHeaderWrapper(FClass * Class, bool bIsExportClass) Line 2220	C++
 	UnrealHeaderTool.exe!FNativeClassHeaderGenerator::ExportClassHeaderRecursive(FClasses & AllClasses, FClass * Class, TArray<FClass *,FDefaultAllocator> & DependencyChain, TSet<UClass const *,DefaultKeyFuncs<UClass const *,0>,FDefaultSetAllocator> & VisitedSet, bool bCheckDependenciesOnly) Line 2461	C++
 	UnrealHeaderTool.exe!FNativeClassHeaderGenerator::ExportClassHeader(FClasses & AllClasses, FClass * Class) Line 1912	C++
 	UnrealHeaderTool.exe!FNativeClassHeaderGenerator::FNativeClassHeaderGenerator(UPackage * InPackage, FClasses & AllClasses, bool InAllowSaveExportedHeaders) Line 4444	C++
 	UnrealHeaderTool.exe!FHeaderParser::ExportNativeHeaders(UPackage * CurrentPackage, FClasses & AllClasses, bool bAllowSaveExportedHeaders) Line 6699	C++
 	UnrealHeaderTool.exe!FHeaderParser::ParseAllHeadersInside(FClasses & ModuleClasses, FFeedbackContext * Warn, UPackage * CurrentPackage, const FManifestModule & Module, TArray<IScriptGeneratorPluginInterface *,FDefaultAllocator> & ScriptPlugins) Line 6847	C++
 	UnrealHeaderTool.exe!UnrealHeaderTool_Main(const FString & ModuleInfoFilename) Line 5194	C++
 	UnrealHeaderTool.exe!wmain(int ArgC, wchar_t * * ArgV) Line 80	C++
 	UnrealHeaderTool.exe!__tmainCRTStartup() Line 623	C

I ran into this issue too. I created a pull request that fixes the issue so UHT will generate an error message rather than crashing.

Hi BrainDX,

I just wanted to give you an update on this issue. There is an existing ticket in place to investigate this crash (UE-11256). The pull request that Lee Berger had submitted has been brought in, so I am expecting the ticket to be closed soon.