Debugging SkeletalMesh Serialization Errors

Hi, I’m migrating a project up to 4.18 and am getting crashes when the editor tries to serialize skeletal mesh assets that were created using a 4.14 engine with some custom changes.

The crash seems to occur when attempting to serialize the first FSkelMeshSection that is part of the USkeleton asset, when serializing the BoneMap in that section… I get a massive negative integer when it serializes the size of the BoneMap TArray to allocate, which rightly asserts in debug.

What is the best way to diagnose what is going on here? What types of changes should I be on the lookout for that could create serialization errors like this? I don’t see any of our studio’s engine customizations eg adding properties to skeletal mesh sections or things like that which I would suspect could cause this type of bug.

Here’s the stack in case that helps give more context:

UE4Editor-Core-Win64-Debug.dll!FDebug::AssertFailed(const char * Expr, const char * File, int Line, const wchar_t * Format, ...) Line 414
    at [engineroot]\source\runtime\core\private\misc\assertionmacros.cpp(414)
UE4Editor-Engine-Win64-Debug.dll!TArray<unsigned short,FDefaultAllocator>::Empty(int Slack) Line 1533
    at [engineroot]\source\runtime\core\public\containers\array.h(1533)
UE4Editor-Engine-Win64-Debug.dll!operator<<(FArchive & Ar, TArray<unsigned short,FDefaultAllocator> & A) Line 1088
    at [engineroot]\source\runtime\core\public\containers\array.h(1088)
UE4Editor-Engine-Win64-Debug.dll!operator<<(FArchive & Ar, FSkelMeshSection & S) Line 1184
    at [engineroot]\source\runtime\engine\private\skeletalmesh.cpp(1184)
UE4Editor-Engine-Win64-Debug.dll!operator<<(FArchive & Ar, TArray<FSkelMeshSection,FDefaultAllocator> & A) Line 1091
    at [engineroot]\source\runtime\core\public\containers\array.h(1091)
UE4Editor-Engine-Win64-Debug.dll!FStaticLODModel::Serialize(FArchive & Ar, UObject * Owner, int Idx) Line 1396
    at [engineroot]\source\runtime\engine\private\skeletalmesh.cpp(1396)
UE4Editor-Engine-Win64-Debug.dll!TIndirectArray<FStaticLODModel,FDefaultAllocator>::Serialize(FArchive & Ar, UObject * Owner) Line 211
    at [engineroot]\source\runtime\core\public\containers\indirectarray.h(211)
UE4Editor-Engine-Win64-Debug.dll!FSkeletalMeshResource::Serialize(FArchive & Ar, USkeletalMesh * Owner) Line 2259
    at [engineroot]\source\runtime\engine\private\skeletalmesh.cpp(2259)
UE4Editor-Engine-Win64-Debug.dll!USkeletalMesh::Serialize(FArchive & Ar) Line 3059
    at [engineroot]\source\runtime\engine\private\skeletalmesh.cpp(3059)
UE4Editor-CoreUObject-Win64-Debug.dll!FLinkerLoad::Preload(UObject * Object) Line 3300
    at [engineroot]\source\runtime\coreuobject\private\uobject\linkerload.cpp(3300)
UE4Editor-CoreUObject-Win64-Debug.dll!EndLoad() Line 1556
    at [engineroot]\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp(1556)
UE4Editor-CoreUObject-Win64-Debug.dll!LoadPackageInternal::__l52::<lambda>() Line 1249
    at [engineroot]\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp(1249)
UE4Editor-CoreUObject-Win64-Debug.dll!LoadPackageInternal(UPackage * InOuter, const wchar_t * InLongPackageNameOrFilename, unsigned int LoadFlags, FLinkerLoad * ImportLinker) Line 1336
    at [engineroot]\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp(1336)
UE4Editor-CoreUObject-Win64-Debug.dll!LoadPackage(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags) Line 1430
    at [engineroot]\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp(1430)
UE4Editor-UnrealEd-Win64-Debug.dll!UEditorEngine::Map_Load(const wchar_t * Str, FOutputDevice & Ar) Line 2492
    at [engineroot]\source\editor\unrealed\private\editorserver.cpp(2492)

Thanks

Decided to just reimport using the source asset