Editor crashes while setting collision in a modular pawn

Hi, I was following this tutorial: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums
and have some issues.

I’m ussing the binary build from the Unreal Launcher, build version 4.0.1 - 2027741.

So this is the code, in GAMECharacter.h:

class AGAMECharacter : public ACharacter
{
GENERATED_UCLASS_BODY()

UPROPERTY(Category = Character, VisibleAnywhere, BlueprintReadOnly)
	TSubobjectPtr<class USkeletalMeshComponent> Body;
	static FName BodyComponentName;

etc…
}

in GAMECharacter.cpp:

FName AGAMECharacter::BodyComponentName(TEXT(“CharacterBody0”));

AGAMECharacter::AGAMECharacter(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{

static FName CollisionProfileName(TEXT("IgnoreOnlyPawn"));

Body = PCIP.CreateOptionalDefaultSubobject<USkeletalMeshComponent>(this, AGAMECharacter::BodyComponentName);
if (Body)
{
	Body->SetCollisionProfileName(CollisionProfileName);
	Body->AlwaysLoadOnClient = true; 
            Body->AlwaysLoadOnServer = true;
            Body->bOwnerNoSee = false; 
            Body->MeshComponentUpdateFlag = EMeshComponentUpdateFlag::AlwaysTickPose;
            Body->bCastDynamicShadow = true;        
            Body->PrimaryComponentTick.TickGroup = TG_PrePhysics;  
            Body->bChartDistanceFactor = true; 
            Body->bGenerateOverlapEvents = false;

            Body->AttachParent = Mesh;  
            Body->SetMasterPoseComponent(Mesh);
}

etc…
}

when removing “Body->SetCollisionProfileName(CollisionProfileName);” all works perfect. Probably I haven’t that profile.

In the forums they told me that still should not crash, and expose it here. So here it is.

This is the error in game logs:

[2014.03.25-22.22.40:041][ 98]PIE: Info Play in editor start time for /Game/Maps/UEDPIE_0_Example_Map 1,103
[2014.03.25-22.22.40:097][ 98]LogWindows:Error: appError called: Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.0\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 518]
Array index out of bounds: 0 from an array of size 0

and this in the engine (full log):
Log file open, 03/25/14 23:22:41
LogModuleManager:Warning: ModuleManager: Module ‘PakFile’ not found - it’s StaticallyLinkedModuleInitializers function is null.
LogModuleManager:Warning: ModuleManager: Module ‘StreamingFile’ not found - it’s StaticallyLinkedModuleInitializers function is null.
LogModuleManager:Warning: ModuleManager: Module ‘NetworkFile’ not found - it’s StaticallyLinkedModuleInitializers function is null.
LogInit: Version: 4.0.1-2027741+++depot+UE4-Releases+4.0
LogInit: Compiled (64-bit): Mar 17 2014 00:43:58
LogInit: Build Configuration: Development
LogInit: Branch Name: ++depot+UE4-Releases+4.0
LogInit: Command line: CrashReportClient.exe -LogFolder=C:/Users/i7/AppData/Local/UnrealEngine/4.0/CrashLogs
LogInit: Base directory: C:/Program Files/Unreal Engine/4.0/Engine/Binaries/Win64/
[2014.03.25-22.22.41:230][ 0]LogTaskGraph: Started task graph with 2 named threads and 4 total threads.
[2014.03.25-22.22.41:250][ 0]LogInit: Computer: I7-PC
[2014.03.25-22.22.41:250][ 0]LogInit: User: i7
[2014.03.25-22.22.41:250][ 0]LogInit: CPU Page size=4096, Cores=4
[2014.03.25-22.22.41:250][ 0]LogInit: High frequency timer resolution =3.312861 MHz
[2014.03.25-22.22.41:250][ 0]LogInit: Memory total: Physical=8.0GB (8GB approx) Pagefile=8184.0GB Virtual=8192.0GB
[2014.03.25-22.22.41:348][ 0]LogInit: WinSock: version 1.1 (2.2), MaxSocks=32767, MaxUdp=65467
[2014.03.25-22.22.41:476][ 0]CrashReportClientLog: Initial state = Unknown UploadState value
[2014.03.25-22.22.41:477][ 0]CrashReportClientLog: Sending HTTP request (pinging server)
[2014.03.25-22.22.41:492][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:492][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:495][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:496][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:926][ 0]CrashReportClientLog: =========================> OnProcessRequestComplete(), State=PingingServer
[2014.03.25-22.22.41:926][ 0]CrashReportClientLog: State change from PingingServer to Ready
[2014.03.25-22.22.41:926][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:926][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:927][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:927][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:927][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.41:927][ 0]LogSlate:Warning: GetFontFace failed to load or process ‘…/…/…/Engine/Content/Slate/Fonts/Roboto-Black.ttf’
[2014.03.25-22.22.47:225][ 0]CrashReportClientLog: State change from Ready to Cancelled
[2014.03.25-22.22.48:246][ 0]LogWindows: FPlatformMisc::RequestExit(0)
[2014.03.25-22.22.48:294][ 0]CrashReportClientLog: Final state = Cancelled
[2014.03.25-22.22.48:294][ 0]LogExit: Exiting.
[2014.03.25-22.22.48:294][ 0]Log file closed, 03/25/14 23:22:48

Thanks !

If you’re building code, you should be able to run in the debugger in visual studio and see the call stack when this happens. It just looks like the index to some array is invalid, so it should be pretty easy to find the source of the error by going up the callstack and inspecting variable values.

You could also post the callstack here and we could look at it.