Crash on Selecting Custom GameMode

I have created a custom game mode in C++ and trying to select it for the world when my editor crashed.

The level is almost entirely the Third Person Template with some (very) small additions (playing with Matinee and a running AI bot) and no custom C++ currently running.

Repro steps:

  1. add new C++ code
  2. GameMode as base class
  3. rebuild and then go to world settings
  4. click the Game Mode drop down

The CustomMode.h code is:

#pragma once

#include "GameFramework/GameMode.h"
#include "CustomMode.generated.h"

/**
 * 
 */
UCLASS()
class MATINEEBUILDERTEST_API ACustomMode : public AGameMode
{
	GENERATED_BODY()
	
};

The CustomMode.cpp code is:

    #include "MatineeBuilderTest.h"
    #include "CustomMode.h"

The error is:
" Unhandled exception at 0x000007FEE2DC3D30 (UE4Editor-Slate.dll) in UE4Editor.exe: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x00000000002238D0). "

The stack trace is:

EDIT: After removing the class, regenerating solution files, rebuilding the solution, running the editor and attempting to select the game mode I have the same issue again… I am about to go try this in a fresh project.

EDIT2: Works fine, however the new project was a C++ base and the old one was a BP base. The BP project also had an issue in that C++ classes would not show up in the content browser… I will be migrating all written code to that before I go too far

Hey -

I followed your steps and created a GameMode class and did not crash when selecting it in the world settings. Seeing as you did not crash either when testing in a new project it is likely that the problem is specific to the single project. If possible could you send me the callstack and log files from the crash as well as the project where the crash is occurring? Since you are planning to migrate the work from the first project into the working project I feel this can be marked as resolved however I would still like to investigate the crash itself if possible. If you run into this crash again feel free to add a comment to reopen this post.

Cheers

Hey -

It has been brought to me that others are likely having the same issue. Could you post the log files from the project that is crashing in order to confirm that the crash you’re getting is the same.

I’m sorry @ , I would but that project is lost in the recesses of source control currently. If I have time I will do so asap but I don’t see that likely as the PM is pushing for some visible results in another area.

All I can offer is that it had to do with the BPness of the project. See Edit 2.