assert/crash on compiling abt when using linked animgraph

We ran into an issue where an assertion triggers in FBaseCompactPose::SetBoneContainer(…).

On developer machines you can continue (and it appears to work), but on non-developer machines this crashes and blocks production.

Video showing repro steps from (almost) empty project. Almost empty, because of having a basic skeletal mesh for reproducing the issue: https://youtu.be/v1ANbxwFfM0

Steps to Reproduce

Repro steps:

  • Empty 5.5.4 project with a skeletal mesh and a skeleton

  • Create a BP deriving from Actor (BP_CrashRepro)

    • Add a Skeletal Mesh Component using the available skeletal mesh
  • Create an empty Animation blueprint template (ABT_Link)

    • Add an input pose to the anim graph, connected to the output.
  • Create another Animation blueprint template (ABT_Base)

  • Add a linked anim graph node connected to the output.

    • Set its Instance Class property to ABT_Link
    • Connect an Input Pose node to the Linked anim graph.
  • In BP_CrashRepro, set the skeletal mesh component’s anim instance to ABT_Base

  • Crash/breakpoint triggers only when:

    • BP_CrashRepro AND ABT_Base are open,
    • The user compiles BP_CrashRepro first and then ABT_Base (which will now assert/crash).

Using the attached project, you only need to follow the last main bulletpoint for the issue to occur.

Hey there, we did fix this issue for 5.6.

https://github.com/EpicGames/UnrealEngine/commit/0c4cdb3746cda9a791cb59349030f4a529bbb196

A guard is missing for a case where, when we are reinstancing the mesh during compilation, it will be in garbage collection and have incorrect data.