Hello,
We recently started to have crash during animation update when we set scalability settings to LOW, no issue on epic.
We found that the SkeletalMeshComponent is NULL.
[Image Removed]
When we disable animation budget there is no issue (a.budget.enabled 0).
Wonder if a modif we did in FAnimationBudgetAllocator could be the culprit:
[Image Removed]
As the crash only occured in a very specific situation, I’m not able to give a repro or a sample project.
For the moment, we avoid the crash by adding a branch before it. Maybe it’s ok to do that this way.
[Image Removed]
Any ideas how to fix or investigate ?
Thanks
Cédric
Hi, sorry for the delay following up on this. We were finishing work on the 5.7 release last week so that’s slowed things down.
We’ve had a few reports recently of crashes in UpdateAnimation_WithRoot because the mesh component is null, so it’s possible this is related. Those involved linked anim bps, and/or template anim bps, so it would be good to know if your crash involves either of those?
Regarding the changes to the budget allocator code, it’s not clear how that could affect the crash in the anim instance proxy so it would be good to know if you’ve found that change has fixed the issue for you or not? Also, are you using the auto-calculate significance functionality, or are you calculating it yourself?
> For the moment, we avoid the crash by adding a branch before it. Maybe it’s ok to do that this way.
There shouldn’t be a problem with adding the branch to avoid the crash. The only issue is that the anim instance proxy won’t have valid data to update in that frame since we assume that the owning skeletal mesh component is always valid. So there could be crashes elsewhere, or at least, you won’t end up with a valid pose on that frame.
The real question here is why is FAnimInstanceProxy::InitializeObjects not being called on the frame that you then see the crash in UpdateAnimation_WithRoot (or why is InitializeObjects being called with an invalid skeletal mesh comp ptr). We assume that InitializeObjects is called each frame that we update and evaluate the graph so that the reference to the skeletal mesh comp is set. But maybe there is a code path that we’re missing when the budget allocator is active.
Hello,
We have our own signifiance algorithm based on distance from player viewpoint.
I can share the callstack too. I guess it involve linked anim bps.
Fatal Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000a48
0x00007ffcfa8f9317 UnrealEditor-Engine.dll!USkeletalMeshComponent::GetAnimInstance() [D:\P4\BRIM\TA\Engine\Source\Runtime\Engine\Private\Components\SkeletalMeshComponent.cpp:3552]
0x00007ffcfa161458 UnrealEditor-Engine.dll!FAnimInstanceProxy::UpdateAnimation_WithRoot() [D:\P4\BRIM\TA\Engine\Source\Runtime\Engine\Private\Animation\AnimInstanceProxy.cpp:1360]
0x00007ffcfa0b8000 UnrealEditor-Engine.dll!FAnimNode_LinkedAnimGraph::Update_AnyThread() [D:\P4\BRIM\TA\Engine\Source\Runtime\Engine\Private\Animation\AnimNode_LinkedAnimGraph.cpp:107]
0x00007ffcfa15deb3 UnrealEditor-Engine.dll!FPoseLinkBase::Update() [D:\P4\BRIM\TA\Engine\Source\Runtime\Engine\Private\Animation\AnimNodeBase.cpp:343]
0x00007ffcfa0ce796 UnrealEditor-Engine.dll!FAnimNode_LinkedInputPose::Update_AnyThread() [D:\P4\BRIM\TA\Engine\Source\Runtime\Engine\Private\Animation\AnimNode_LinkedInputPose.cpp:37]
0x00007ffcfa15f682 UnrealEditor-Engine.dll!FAnimInstanceProxy::UpdateAnimationNode_WithRoot() [D:\P4\BRIM\TA\Engine\Source\Runtime\Engine\Private\Animation\AnimInstanceProxy.cpp:148]
0x00007ffcfa161676 UnrealEditor-Engine.dll!FAnimInstanceProxy::UpdateAnimation_WithRoot() [D:\P4\BRIM\TA\Engine\Source\Runtime\Engine\Private\Animation\AnimInstanceProxy.cpp:1373]
0x00007ffce52c1c6e UnrealEditor-AnimGraphRuntime.dll!FAnimNode_SkeletalControlBase::UpdateComponentPose_AnyThread() [D:\P4\BRIM\TA\Engine\Source\Runtime\AnimGraphRuntime\Private\BoneControllers\AnimNode_SkeletalControlBase.cpp:56]
0x00007ffce52c986c UnrealEditor-AnimGraphRuntime.dll!FAnimNode_SkeletalControlBase::Update_AnyThread() [D:\P4\BRIM\TA\Engine\Source\Runtime\AnimGraphRuntime\Private\BoneControllers\AnimNode_SkeletalControlBase.cpp:77]
0x00007ffcfa15f51e UnrealEditor-Engine.dll!FAnimInstanceProxy::UpdateAnimationNode() [D:\P4\BRIM\TA\Engine\Source\Runtime\Engine\Private\Animation\AnimInstanceProxy.cpp:124]
0x00007ffcfa16164a UnrealEditor-Engine.dll!FAnimInstanceProxy::UpdateAnimation_WithRoot() [D:\P4\BRIM\TA\Engine\Source\Runtime\Engine\Private\Animation\AnimInstanceProxy.cpp:1370]
0x00007ffcfa15f3d1 UnrealEditor-Engine.dll!FAnimInstanceProxy::UpdateAnimation() [D:\P4\BRIM\TA\Engine\Source\Runtime\Engine\Private\Animation\AnimInstanceProxy.cpp:1241]
0x00007ffcfa07f0ed UnrealEditor-Engine.dll!UAnimInstance::ParallelUpdateAnimation() [D:\P4\BRIM\TA\Engine\Source\Runtime\Engine\Private\Animation\AnimInstance.cpp:831]
0x00007ffcfa91e16b UnrealEditor-Engine.dll!USkeletalMeshComponent::PerformAnimationProcessing() [D:\P4\BRIM\TA\Engine\Source\Runtime\Engine\Private\Components\SkeletalMeshComponent.cpp:2442]
0x00007ffcfa91d470 UnrealEditor-Engine.dll!USkeletalMeshComponent::ParallelAnimationEvaluation() [D:\P4\BRIM\TA\Engine\Source\Runtime\Engine\Private\Components\SkeletalMeshComponent.cpp:4665]
0x00007ffcfa8f0f69 UnrealEditor-Engine.dll!FParallelAnimationEvaluationTask::DoTask() [D:\P4\BRIM\TA\Engine\Source\Runtime\Engine\Private\Components\SkeletalMeshComponent.cpp:367]
0x00007ffcfa8f58a0 UnrealEditor-Engine.dll!TGraphTask<FParallelAnimationEvaluationTask>::ExecuteTask() [D:\P4\BRIM\TA\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:706]
0x00007ffcf9ef0fe0 UnrealEditor-Engine.dll!UE::Tasks::Private::FTaskBase::TryExecuteTask() [D:\P4\BRIM\TA\Engine\Source\Runtime\Core\Public\Tasks\TaskPrivate.h:527]
0x00007ffcf9e8ca74 UnrealEditor-Engine.dll!LowLevelTasks::TTaskDelegate<LowLevelTasks::FTask * __cdecl(bool),48>::TTaskDelegateImpl<`LowLevelTasks::FTask::Init<`UE::Tasks::Private::FTaskBase::Init'::`2'::<lambda_1> >'::`13'::<lambda_1>,0>::CallAndMove() [D:\P4\BRIM\TA\Engine\Source\Runtime\Core\Public\Async\Fundamental\TaskDelegate.h:171]
0x00007ffcff4cd165 UnrealEditor-Core.dll!LowLevelTasks::FTask::ExecuteTask() [D:\P4\BRIM\TA\Engine\Source\Runtime\Core\Public\Async\Fundamental\Task.h:627]
I didn’t have time to if we miss a call to FAnimInstanceProxy::InitializeObjects, at the moment I didn’t even know how I can track a missing call.
Regards
Cédric
Ok, so this is also a linked anim graph, which is the same as the previous report of the same crash. I’ll spend some more time next week trying to get a repro of this. You could check whether InitializeObjects is being set by setting a bool in that function, checking the value in UpdateAnimation_WithRoot, and then resetting it back at the end of the update. But I’m pretty sure it’ll just tell us what we found with the last report which is that InitializeObjects isn’t being called on the frame the crash happens.
If you just want to work around this for now, the branch that you mentioned in UpdateAnimation_WithRoot should be ok (with the caveats that I mentioned previously). I’ll follow up next week once I’ve spent a bit more time investigating.
Hi, sorry for the delay following up on this. I’ve spent a bit of time over the last couple of weeks digging through the code and trying to get a repro but I haven’t had any luck unfortunately. We are somewhat suspicious that it could be related to the montage specific update codepath in UAnimInstance::UpdateAnimation - ie. this code:
/**
If we're set to OnlyTickMontagesWhenNotRendered and we haven't been recently rendered,
then only update montages and skip everything else.
*/
if (SkelMeshComp->ShouldOnlyTickMontages(DeltaSeconds) || (SkelMeshComp->ShouldOnlyTickMontagesAndRefreshBones(DeltaSeconds) && !IsAnyMontagePlaying()))
{
Because if the anim instance takes that codepath for the update, we don’t call PreUpdate on the anim instance proxy which in turn means that we haven’t called InitializeObjects. But in the case of the montage only update, we shouldn’t be updating the graph so shouldn’t hit UpdateAnimation_WithRoot.
Anyway, I don’t think there is much further we can do with this without a repro. However, you should be fine to keep the guard that you added to UpdateAnimation_WithRoot to make sure the skeletal mesh component is valid. I did suggest to the engine team that we submit that change but they would prefer to leave the code as is so we can try and catch this crash in future when we do have a repro.