rive-unreal icon indicating copy to clipboard operation
rive-unreal copied to clipboard

Packaged build crashes during seamless travel during seamless travel / async loading

Open con-bren opened this issue 2 months ago • 3 comments

Packaged build crashes during seamless travel when a Rive widget/state machine is active (UE 5.5.4). Disappear when Rive is excluded.

Environment

  • Unreal Engine: 5.5.4 (Win64)
  • Builds: Development + Shipping (Game target)
  • RHI: DX12
  • Project: C++
  • Rive plugin: 0.3.10a-gh
  • OS: Windows 11

Summary

When performing seamless travel, packaged builds sometimes crash with various errors stemming from Rive widget/artboard/state machines.
If we disable/remove Rive, all crashes go away under the same flow.
We cannot reproduce any of the crashes in Editor/PIE.
It always happens on seamless travel transitions and appears related to async functions in the Rive widgets not being cleaned up appropriately.

Crash logs (representative)

A) Rive runtime while advancing state machine

[2025.09.28-09.21.51:871][ 59]LogWindows: Error: === Critical error: ===
[2025.09.28-09.21.51:871][ 59]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff
[2025.09.28-09.21.51:871][ 59]LogWindows: Error: [Callstack] 0x00007ff66fd8dd2e RadbotEngine.exe!rive::Path::buildPath() [C:\Development\Work\rive\packages\runtime\src\shapes\path.cpp:176]
[2025.09.28-09.21.51:871][ 59]LogWindows: Error: [Callstack] 0x00007ff66fd031d6 RadbotEngine.exe!rive::Artboard::updatePass() [C:\Development\Work\rive\packages\runtime\src\artboard.cpp:942]
[2025.09.28-09.21.51:871][ 59]LogWindows: Error: [Callstack] 0x00007ff66fd32027 RadbotEngine.exe!rive::StateMachineInstance::advanceAndApply() [C:\Development\Work\rive\packages\runtime\src\animation\state_machine_instance.cpp:1768]
[2025.09.28-09.21.51:871][ 59]LogWindows: Error: [Callstack] 0x00007ff67a9844fb RadbotEngine.exe!FRiveStateMachine::Advance() [C:\Git\RadbotEngine\Plugins\Rive\Source\Rive\Private\Rive\RiveStateMachine.cpp:113]
[2025.09.28-09.21.51:871][ 59]LogWindows: Error: [Callstack] 0x00007ff67a997111 RadbotEngine.exe!URiveArtboard::Tick_StateMachine() [C:\Git\RadbotEngine\Plugins\Rive\Source\Rive\Private\Rive\RiveArtboard.cpp:925]
[2025.09.28-09.21.51:871][ 59]LogWindows: Error: [Callstack] 0x00007ff67a996c7e RadbotEngine.exe!URiveTextureObject::Tick() [C:\Git\RadbotEngine\Plugins\Rive\Source\Rive\Private\Rive\RiveTextureObject.cpp:97]

B) DX12 descriptor allocator assert during transition

[2025.09.28-09.14.55:278][993]LogWindows: Error: appError called: Assertion failed: Range.Start < Range.End
[File:D:\build++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12Descriptors.cpp] [Line: 419]

C) Async loader crash (packaged only)

[2025.09.28-09.19.01:969][949]LogThreadingWindows: Error: Runnable thread FAsyncLoadingThread crashed.
[2025.09.28-09.19.01:969][949]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000270148c1ad0
[2025.09.28-09.19.01:969][949]LogWindows: Error: [Callstack] 0x00007ff778dd5a76 RadbotEngine.exe!TSet<UClass *>::TryReplaceExisting() []
[2025.09.28-09.19.01:970][949]LogWindows: Error: [Callstack] 0x00007ff778b43f52 RadbotEngine.exe!FAsyncPackage2::EventDrivenSerializeExport() []
[2025.09.28-09.19.01:970][949]LogWindows: Error: [Callstack] 0x00007ff778b7bdda RadbotEngine.exe!FAsyncLoadingThread2::Run() []

D) Bad cleanup / teardown (input bindings destroyed during GC)

[2025.09.28-09.12.15:020][369]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff
[2025.09.28-09.12.15:020][369]LogWindows: Error: [Callstack] 0x00007ff7806b58a3 RadbotEngine.exe!DestructItems<TUniquePtr<FEnhancedInputActionEventBinding,TDefaultDelete<FEnhancedInputActionEventBinding>>,int>() []
[2025.09.28-09.12.15:020][369]LogWindows: Error: [Callstack] 0x00007ff7806bf05a RadbotEngine.exe!UEnhancedInputComponent::`vector deleting destructor'() []
[2025.09.28-09.12.15:020][369]LogWindows: Error: [Callstack] 0x00007ff778c65df0 RadbotEngine.exe!FObjectPurge::DestroyObjects() []

Always packaged, never editor

  • None of these reproduce in PIE/Editor.
  • All disappear if we exclude Rive from the transition scene (no Rive widget/state machine tick).

Initialization Flow

  1. Construction hook
    OnInitialized fires for the widget instance (UMG lifecycle entry point).

  2. Ready callback registration
    Bind the widget’s OnReady delegate so post-asset initialization runs when the Rive backend reports readiness.

  3. Asset resolution
    Query the Rive asset for the target Artboard, then resolve a ViewModel (prefer by name, fallback by index). This yields the authoring-time template, not a runtime instance.

  4. Validation gate
    Guard with IsValid(ViewModel) to avoid instantiating a null/redirected resource.

  5. Instance creation
    Call CreateDefaultInstance(ViewModel) to allocate the runtime StateMachine/Animation instance (mutable, tickable).

  6. Widget binding
    Assign the authoring object via SetViewModel(...) and the runtime instance via SetViewModelInstance(...) so the widget renders/ticks the correct live object.

  7. Focus policy
    Set IsFocusable = true so the control participates in CommonUI/Slate focus and consumes input as needed.

Observations

  • Crashes are timing-dependent and correlate with level travel while Rive is advancing/ticking.
  • Given the rive::Path::buildPath stack plus the DX12 assert, we suspect size/lifetime races (e.g., advancing while render resources/layout are 0-sized or being torn down).

What we tried

  • Reinstalled the Rive plugin (0.3.10a-gh).
  • Reproduces only in packaged builds; Editor never crashes.
  • Completely removing the Rive widget/artboard from the transition scene stabilizes the build.

Requests / Questions

  • Are there recommended initialization and teardown hooks to ensure async functionality is fully cleaned up (e.g., suspend on PreLoadMap, resume after PostLoadMapWithWorld)?
  • Any known pitfalls or required guards around state machine advance during seamless travel?

Happy to provide

  • Small repro project (menu → transition scene with this widget → seamless travel)
  • Symbolized crash dumps

Thanks for looking!

con-bren avatar Sep 28 '25 19:09 con-bren

I wanted to also mention that all of my crash logs contain the following trace:

[2025.09.08-05.03.10:697][  0]LogStats: FPlatformStackWalk::StackWalkAndDump -  0.292 s
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: === Handled ensure: ===
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: 
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: Ensure condition failed: oldValue == newValue  [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\HAL\ThreadingBase.cpp] [Line: 318] 
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: oldValue(1) newValue(0) If this check fails make sure that there is a FTaskTagScope(ETaskTag::EParallelRenderingThread) as deep as possible on the current callstack, you can see the current value in ActiveNamedThreads(40000002), GRenderingThread(42358080)
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: Stack: 
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff783c5c2ba RadbotEngine.exe!`FLocMetadataObject::GetField<4>'::`3'::<lambda_1>::operator()() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff77633d63c RadbotEngine.exe!IsInParallelRenderingThread() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff779cee016 RadbotEngine.exe!OIT::InternalIsSortedPixelsEnabled() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff7793b86ae RadbotEngine.exe!CreateTranslucencyStandardPassProcessor() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff77cd8b05c RadbotEngine.exe!FMaterialShaderMap::CollectPSOPrecacheData() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff77d1f5c9f RadbotEngine.exe!FMaterialPSOPrecacheCollectionTask::DoTask() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff77d204f01 RadbotEngine.exe!TGraphTask<FMaterialPSOPrecacheCollectionTask>::ExecuteTask() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff776188823 RadbotEngine.exe!UE::Tasks::Private::FTaskBase::TryExecuteTask() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff77615b83f RadbotEngine.exe!LowLevelTasks::TTaskDelegate<LowLevelTasks::FTask * __ptr64 __cdecl(bool),48>::TTaskDelegateImpl<`LowLevelTasks::FTask::Init<`UE::Tasks::Private::FTaskBase::Init'::`2'::<lambda_1> >'::`13'::<lambda_1>,0>::CallAndMove() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff77616692e RadbotEngine.exe!LowLevelTasks::FTask::ExecuteTask() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff7761667da RadbotEngine.exe!LowLevelTasks::FScheduler::ExecuteTask() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff77618bddd RadbotEngine.exe!LowLevelTasks::FScheduler::WorkerLoop() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff776154341 RadbotEngine.exe!`FScopeCycleCounter::~FScopeCycleCounter'::`2'::<lambda_1>::operator()() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff7763500b3 RadbotEngine.exe!FThreadImpl::Run() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff776767408 RadbotEngine.exe!FRunnableThreadWin::Run() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ff77675ea6f RadbotEngine.exe!FRunnableThreadWin::GuardedRun() []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ffe5b3de8d7 KERNEL32.DLL!UnknownFunction []
[2025.09.08-05.03.10:697][  0]LogOutputDevice: Error: [Callstack] 0x00007ffe5cbbc34c ntdll.dll!UnknownFunction []

con-bren avatar Sep 28 '25 23:09 con-bren

I was able to fix this by downloading the rive-unreal-demos project and using the plugin files from there.

con-bren avatar Oct 01 '25 01:10 con-bren

Hello! The plugin you are using is no longer supported. We'll be releasing a rewritten version in the near future. You can find more details here.

Tod-Rive avatar Oct 01 '25 14:10 Tod-Rive