UE Corrupts loaded Data Assets on crash

I have some DataAssets with level descriptions, which are stored in array in Game Instance class.
If my game crash, it corrupts editor asset files. And these assets disappear from content browser.

Hi ,

  • Does this occur in a clean, blank project with no additional content or is it limited to one project?
  • What steps did you take just before the crash occurred?
  • Can you post your crash logs from the crash?
  • Before the crash, did you save the assets that become corrupt?

Hi ,

The crash log is unrelated to DataAssets, it can be any gameplay code crash, like access violation or something like that.
I wonder why UE is even writing something to DataAssets, maybe I am using them wrong way. I thought they are just constant structs of data.
About saving i think yes… or maybe no, Still they are not reverted to any unsaved state, but a corrupted to the state they are not readable at all.

Not sure if I can reproduce it in blank project, but will try this weekend.
For sure I can tell you, that only loaded DataAssets are corrupted - those which have memory references during crash.

Hi ,

Have you had a chance to try this on your end in a clean project? If so, what were the results of that test? Do you have any steps I can take to recreate this on my end?

Actually it is very hard to reproduce. And I am puzzled why this happens, but some time some DataAssets get corrupted for no reason. This can be on Hot Reload, or on project Load, or after crash. Hard to tell. Looks like data asset files are just written incomplete sometime.

Is this a c++ or blueprint project?

с++, with some blueprints.

It looks like only some header part is written to DataAssets, while all data is missing from them.

How do you have your asset set up? Knowing this will help us reproduce this on our end.

If you can cause the crash to occur again, please provide your Machine ID from the Crash Reporter window and ensure to hit send on the report. If we can stop the crash from occurring, this should prevent the asset from becoming corrupted.

As far as the asset being corrupted on Hot Reload or project load, do you have any repro case that we can use to see this on our end?

I have a class UMyAsset subclassed from UDataAsset, and resource of this class is created in Content Browser. Occasionally they became corrupted.

UCLASS(BlueprintType)
class GEAL_API UGealLevelDescription : public UDataAsset
{
GENERATED_BODY()

public:
	UPROPERTY(Category = "Level", EditAnywhere, BlueprintReadOnly)
	FString Name;

	UPROPERTY(Category = "Level", EditAnywhere, BlueprintReadOnly)
	FString Description;

	UPROPERTY(Category = "Level", EditAnywhere, BlueprintReadOnly)
	class UTexture2D* LogoImage;

	UPROPERTY(Category = "Level", EditAnywhere, BlueprintReadOnly)
	TArray<TAssetPtr<UWorld>> Levels;
};

sample of one of such classes.

After performing a few tests, I haven’t seen the data asset being corrupted. If you are able to determine repro steps when you attempt to reproduce it in a clean project, please share those with me.

How often are you seeing these assets become corrupted?

I think that is happens when resource go to that strange Transient state after Hot Reloading, like hereanswers.unrealengine.com/questions/379851/have-no-idea-why-this-ever-happen-after-hotreloadi.html
But for DataAssets it does not show that message and silently corrupts data.

What do you think, epics?

It’s possible, but unfortunately I still have not seen this issue occurring in my tests. Have you been able to determine any repro after additional testing? Are there any methods that you’ve found that seem to corrupt the asset on a more regular basis?

It is hard to reproduce these errors, but i think the test case can be following.

  1. Create some UDataAsset. compile code and create object of it in CB fill it with data and save.
  2. Then open it in CB, and make some edits, but not save.
  3. While data asset is open, chang it’s code in visual and recompile to trigger hot reload.
  4. Try to save data asset and close the project.

maybe it will fail. Transient errors are usually appear to me when ue hot reloads while have open asset windows.

I’ve performed some tests using the steps that you’ve provided, but I have not been able to see the same behavior on my end. I will continue to investigate the issue to see if I can get one of my data assets to become corrupted. In the meantime, please reply with additional information if you come across any. Thank you.

Hello,

I am marking this topic as resolved for tracking purposes, as we have not heard from you in a few days. If this issue persists, feel free to respond to this thread. For any new issues, please create a new Answerhub topic.

Have a great day