Description

UDN case : [Link Removed]

 

We are seeing a crash in UAnimInstance::DisplayDebug() at the following line:

FString MontageEntry = FString::Printf(TEXT("%i) %s CurrSec: %s NextSec: %s W:%.2f DW:%.2f"), MontageIndex, *MontageInstance->Montage->GetName(), *MontageInstance->GetCurrentSection().ToString(), *MontageInstance->GetNextSection().ToString(), MontageInstance->GetWeight(), MontageInstance->GetDesiredWeight());

 

The crash occurs because MontageInstance->Montage is nullptr.

 

This appears to happen when a particular character finishes playing an animation montage. The sequence of events appears to be, in Frame N:

  • (PrePhysics) In UAnimInstance::ClearMontageInstanceReferences(), the montage instance is removed from the ActiveMontagesMap.
  • (PostPhysics) FAnimMontageInstance::Terminate() sets the Montage property from the montage instance to nullptr.
  • At the end of Frame N, the crash in UAnimInstance::DisplayDebug() happens because the montage instance is still in the MontageInstances array, but its Montage property is nullptr.

I believe this issue is related to physics animation blending due to the involvement of FParallelBlendPhysicsCompletionTask in the above call stack, plus the fact that if I remove the component that enables that feature on the character then the crash no longer occurs. Unfortunately I have not been able to reproduce this in a clean project.

Steps to Reproduce

I have not been able to reproduce, I have fixed the crash by looking at the crash itself and looking at the code

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-169526 in the post.

0
Login to Vote

Fixed
ComponentUE - Anim - Runtime
Affects Versions5.0
Target Fix5.2
Fix Commit23598625
Main Commit23598625
CreatedNov 8, 2022
ResolvedJan 6, 2023
UpdatedFeb 4, 2023