4.12 - CameraRig_Crane meshes crash packaged builds

After cooking a Development build for the first time in 4.12, I receive the following fatal error when attempting run the game:

Fatal error:
[… LinkerLoad.cpp][Line:3355]
Static Mesh
/Engine/EditorMeshes/Camera/SM_CraneRig_Base.SM_CraneRig_Base: Serial size mismatch: Got 72553, Expected 72569

When placed in the world inside an Editor build, there are no issues. This only occurs in a cooked/packaged build. Has anyone else run into this and discovered a solution?

I’m also getting this with static mesh assets of our own after upgrading to 4.12, getting the same 16 offset as well. Are you using any middleware?

Hey guys,

I just tried reproducing the issue in a new blank project by adding a Camera Rig Crane to the scene and packaging for Windows 64 bit, but did not get the crash to occur.

Could you provide me with a repro so I can get this crash to occur in a clean blank project using a minimal test case?

Are you receiving a Crash Reporter window after the cooked/packaged build crashes? If so, please provide me with the logs from the crash so I can take a look at the callstack and other relevant information as well.

Cheers,

Andrew Hurley

We are using Simplygon, Wwise, Bink, and Substance.

The only repro I can offer is that I upgraded the engine to 4.12.3, built Development config, cooked/packaged content, and tried to run the packaged build. The crash window displays immediately upon running the .exe. I’ve attached the log and a copy of the callstack.

link text

I think I tracked this down to a Simpygon change, I assumed it was an error in our integration merge but if other people are running into it too it might be a bigger issue.

The culprit on our end was the Simplygon changes inside UStaticMesh::Serialize, StaticMesh.cpp around line 2588.

//@third party BEGIN SIMPLYGON
if (Ar.UE4Ver() >= VER_UE4_STATIC_MESH_GUID_SUPPORT)
{
	Ar << Id;
}
//@third party END SIMPLYGON

This is happening inside “WITH_EDITORONLY_DATA” ifdef’s and as a result this GUID gets serialized inside the static mesh while cooking.

When the packaged client is ran and is loading the static mesh it skips the WITH_EDITORONLY_DATA ifdef meaning that “Id” is never unserialized and resulting sizes don’t match.

I took the shotgun approach to fixing this and moved all the Simplygon Id changes outside of the editor ifdef’s and it stopped crashing (I also regenerated STATICMESH_DERIVEDDATA_VER so that everything was rebuilt though it might not be needed).

A better solution has been provided below by TheDrunkenBunny, excluding the Simplygon Id from UStaticMesh::Serialize when Ar.IsCooking() is true fixes the serialization issue

I’m going to try a similar approach, wrapping it with #if WITH_EDITOR.

How did you regenerate STATICMESH_DERIVEDDATA_VER?

It’s a standard GUID uppercase with no hyphens, it looks like Free Online GUID Generator can generate some.

Strange, I didn’t get around to cleaning up the fix but that’s what I was going to try.

It would be nice to find a way that fixes this without having to have the 16 byte Simplygon GUID be saved & loaded with static meshes but better than it not working I guess.

Wrapping in #WITH_EDITOR didn’t work. Still get the same crash after a clean rebuild/cook/package.

Looks like your approach of moving the Id serialization out of EDITOR* blocks entirely is the right call.

Was there any other code you moved outside the WITH_EDITORDATAONLY blocks other than the FGuid Id; declaration, the lines where the Id is set, and the serialization?

Nope, my changes were updating STATICMESH_DERIVEDDATA_VER and then moving UStaticMesh::PostDuplicate, the Id serialization and the GUID generation beneath FixupLegacySettings outside of the editor ifdefs.

After making those changes and rebuilding the editor, the next cook didn’t have the Id serialized and the meshes were no longer 16 bytes off.

Thx for finding the culprit. In return here is a simple fix:

//@third party BEGIN SIMPLYGON
if (Ar.UE4Ver() >= VER_UE4_STATIC_MESH_GUID_SUPPORT && !Ar.IsCooking())
{
	Ar << Id;
}
//@third party END SIMPLYGON

Just add check for cooking - !Ar.IsCooking()