Serialize causes crash

Looks like that’s related to an enum. Do you have any blueprints or C++ headers with custom enums within them?

yeh for sure, but they all seem to compile properly except when hot reloading or creating a new C++ class from the editor. Any suggestions?

Unfortunately, I’d start chopping out the enums until I got it to compile or create a class. How many enums have you created?

quite a few… the code base is quite large at this point so removing each enum one by one would be rather excruciating considering they are referenced in a variety of C++ and blueprint classes.

Where’s the jump in the debugger when the game crashes? (sorry I don’t know the technical terms, I have no formal C++ training)

Edit: It’s failing in your log at DoubleColonPos != INDEX_NONE, but I’m not sure which enum would be throwing that.

Edit 2:

// Double check we have a fully qualified name.
auto DoubleColonPos = BaseEnumName.Find(TEXT("::"));
check(DoubleColonPos != INDEX_NONE);

Perhaps one of your enums isn’t using a valid name?

Hi ,

It seems as though walk12288 is heading in the right direction here. The assertion that is failing in the callstack that you provided would normally only fail if it is checking an enum that is not an enum class or namespaced (which would typically be the only cases where an enum does not have a ::). Would you be able to see if you any of the enums that you are using are not an enum class or namespaced? That should help us narrow down where the engine is falling over.

thanks for the suggestions! I’ve been looking through the code base and making changes as necessary in an attempt to find the culprit. Will post again if I make any progress…

Okay! I’ve figured it out. Provided below is a step by step reproduction method (I used 4.10.0 to reproduce, though I imagine it will work in previous versions as well):

  1. Create a new “Blank” code project.
  2. Create a new C++ class with type “UserDefinedEnum”
  3. Try to Create another new C++ class from the Editor and you will receive the crash with the same stack trace. Additionally you can try hot-reloading the project by making a code change in order to generate the crash.

It seems that the issue causing the crashing was creating a class of type UUserDefinedEnum, even leaving it completely empty, rather than the nature of any of the enumerations that I was actually using (we have used UENUM() to define all of our code-based enums).

, would you be able to make a ticket for this issue? The strange part is that is doesn’t generate any compile errors on the surface, and we were also able to build/cook/package our project without any errors, seems to be something particular about the hot-reloading/new code class creation compile routine that is generating the crash.

Thanks again for pointing me in the right direction walk12288 and !

Awesome man! Glad you found the issue. I use UENUM() to define all of mine, too. Hopefully they can get this patched up for the people creating UUserDefinedEnum classes.

Hi ,

Thanks for your help in narrowing this one down. I rather doubt I would have ever thought to try adding a custom UserDefinedEnum class when trying to repro this crash. I used the information that you provided to put in a report of this crash to have it investigated further (UE-23446).

I can confirm that this is definitely the cause. I created an enum derived from UUserDefinedEnum and got the crash on every hot reload. I changed the class to derive from UObject and the crashes ceased:)

Can I request a way to delete C++ classes from within the editor (because I don’t want this enum), or is there an existing way to delete C++ classes?

Hi madchopper,

We are still looking into what is causing the crash to occur when adding a class that derives from UserDefinedEnum. However, in order to remove a code class from a project, you would just need to delete the header and source file for the class (after making sure no Blueprints reference the class and closing the Editor), right-click on the .uproject file and generate project files, then open the solution in Visual Studio and build the project.

I would like to add the same situation with UserDefinedStruct. I am currently using 4.15!

Cheers!

Hi ,

The crash with User Defined Struct is actually a different crash. I was able to reproduce it though, and have entered UE-42178 to have it investigated further.