Write access violation crash in UnversionedPropertySerialization - PlayerController->Struct

We hit a crash loading our game mode upon launch of the game. The game mode flushes the async loading thread from the main thread. When the async thread tries to load our BP_PlayerController, it hits a write access exception and crashes.

This only happened with the flag -iostore to package the project. Using the old pak system, we didn’t encounter this crash.

The write access error happens when it serializes in a struct that is contained in this blueprint. The size of the struct should be 56 bytes but instead, it is 36 bytes. This looks to be the cause of it trying to initialize the iterator FUnversionedHeader::FIterator It(Header, Schema) in SerializeUnversionedProperties.

Instead of calling Serialize on the iterator, it runs LoadZero.

FExportArchive:

ExportSerialOffset Same offset in both

ExportSerialSize 36 instead of 56 bytes

In the build that does not crash, the size of the struct in the ExportArchive::ExportSerialSize is 56 bytes.

Annoyingly, I can’t reproduce this on my machine, even on same changelist. So I am not sure if our build machine had a hiccup that has now resolved itself as today’s builds with -iostore launch just fine.

Any possible mitigations for something like this in the future?

We plan to take hotfix 5.7.2 and are on 5.7.1 at the moment.

[Attachment Removed]

Steps to Reproduce
Package game client target with -iostore. Launch client exe and observe crash.

In our setup, we have a sort of following code inside player controller.

Pseudo code structure. Crashes trying to load in the OuterStruct. Not sure if inner struct is a possible cause or not. Seems normal to me.

USTRUCT(BlueprintType)
struct FInnerStruct
{
    GENERATED_BODY()

    UPROPERTY(EditAnywhere)
    UCurveFloat* SomeCurve = nullptr;

    UPROPERTY(EditAnywhere)
    float SomeFloat = -1;
};

USTRUCT(BlueprintType)
struct FOuterStruct
{
    GENERATED_BODY()

    UPROPERTY(EditAnywhere)
    FInnerStruct InnerStruct;
};

AMyPlayerController
{
    UPROPERTY(EditAnywhere)
    FOuterStruct OuterStruct;
}

[Attachment Removed]

Hello!

What are the options that you are using when cooking? Is the build machine using the iterative or incremental cooking mode? The iterative mode is being deprecated as unreliable so you should not use it.

Martin

[Attachment Removed]

The build machine does not use iterative or incremental cooking. This is the command prompt used.

Engine\Build\BatchFiles\RunUAT.bat BuildCookRun -project=‘./Project/Project.uproject’ -Target=ProjectClient -noP4 -buildmachine -nosign -nocodesign -unattended -nocompileeditor -utf8output -build -cook -stage -compile -pak -iostore -crashreporter -compressed -map=Map1+Map2 -targetplatform=Win64 -clientConfig=Development

Our project is setup like so: Main and within Engine and Project.

[Attachment Removed]

I couldn’t find anything related to that code in our in internal bug DB. Did you manage to reproduce the problem it just went away? Maybe the packaging logs would contain something interesting?

[Attachment Removed]

I was unable to reproduce the crash cooking the same change list. The cook logs for this particular build are not there anymore. The problem looks to have resolved itself the very next cook on the same build machine.

This can be closed unless I am able to reproduce this crash in the future reliably or at least have cooking logs.

Thanks for your time looking into it.

[Attachment Removed]