FSceneViewport::UpdateViewportRHI() Assertion failed: IsInGameThread()

Hello, since integrating 5.8.0-preview-1 we’ve started failing an IsInGameThread() check in FSceneViewport::UpdateViewportRHI() sporadically. It happens during teardown for different maps while running test automation in editor. The log immediately prior to the assert looks like this:

[2026.06.10-15.50.55:134][634]LogWorld: BeginTearingDown for /HavokNavigationTest/Maps/Test/UEDPIE_0_NavMeshFindPathTest

[2026.06.10-15.50.55:146][634]LogWorld: UWorld::CleanupWorld for NavMeshFindPathTest, bSessionEnded=true, bCleanupResources=true

[2026.06.10-15.50.55:158][634]LogSlate: InvalidateAllWidgets triggered. All widgets were invalidated

[2026.06.10-15.50.55:170][634]LogHavokNavTest: SamsaraWorldSubsystem_0 (000001F5391CB900): USamsaraWorldSubsystem::Deinitialize ()

[2026.06.10-15.50.55:182][634]LogPlayLevel: Display: Shutting down PIE online subsystems

[2026.06.10-15.50.55:194][634]LogSlate: InvalidateAllWidgets triggered. All widgets were invalidated

[2026.06.10-15.50.55:206][634]LogAudio: Display: Audio Device unregistered from world ‘NavMeshFindPathTest’.

[2026.06.10-15.50.55:218][634]LogAudioMixer: Deinitializing Audio Bus Subsystem for audio device with ID 100

[2026.06.10-15.50.55:230][634]LogAudioMixer: Display: FAudioMixerWasapi::StopAudioStream() InstanceID=100, StreamState=4

[2026.06.10-15.50.55:242][634]LogAudioMixer: Display: StopRunningNullDevice() called, InstanceID=100

[2026.06.10-15.50.55:254][634]LogSlate: Updating window title bar state: overlay mode, drag disabled, window buttons hidden, title bar hidden

That’s all the info I have, hope it’s helpful, thank you!

[Attachment Removed]

Steps to Reproduce[Attachment Removed]

I’m not sure if the call stack was captured since I don’t see it here, so pasting it here just to be sure:

* Fatal Error: Assertion failed: IsInGameThread() [File:D:\GH\18f2bb4c1110\Engine\Source\Runtime\Engine\Private\Slate\SceneViewport.cpp] [Line: 2104]

0x00007ffe324eed88 UnrealEditor-Core.dll!FDebug::CheckVerifyFailedImpl2() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\Core\Private\Misc\AssertionMacros.cpp:797]

0x00007ffe2d8df0f7 UnrealEditor-Engine.dll!FSceneViewport::UpdateViewportRHI() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\Engine\Private\Slate\SceneViewport.cpp:2104]

0x00007ffe2d86c1cd UnrealEditor-Engine.dll!FSceneViewport::~FSceneViewport() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\Engine\Private\Slate\SceneViewport.cpp:111]

0x00007ffe2d8748a3 UnrealEditor-Engine.dll!FSceneViewport::`vector deleting destructor’() [Unknown File]

0x00007ffe1104fc78 UnrealEditor-SlateRHIRenderer.dll!SharedPointerInternals::TReferenceControllerBase<1>::ReleaseSharedReferenceNoInline() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\Core\Public\Templates\SharedPointerInternals.h:259]

0x00007ffe11022581 UnrealEditor-SlateRHIRenderer.dll!FSlateRHIRenderer::DrawWindow_RenderThread() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\SlateRHIRenderer\Private\SlateRHIRenderer.cpp:1237]

0x00007ffe11024421 UnrealEditor-SlateRHIRenderer.dll!FSlateRHIRenderer::DrawWindows_RenderThread() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\SlateRHIRenderer\Private\SlateRHIRenderer.cpp:1475]

0x00007ffe11005238 UnrealEditor-SlateRHIRenderer.dll!`FSlateRHIRenderer::DrawWindows_Private’::`76’::<lambda_3>::operator()() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\SlateRHIRenderer\Private\SlateRHIRenderer.cpp:1738]

0x00007ffe2b676373 UnrealEditor-RenderCore.dll!ExecuteCommand() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp:1531]

0x00007ffe2b6499bc UnrealEditor-RenderCore.dll!UE::RenderCommandPipe::FCommandList::ConsumeCommands<`FRenderThreadCommandPipe::ExecuteCommands’::`2’::<lambda_1> >() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\RenderCore\Public\RenderingThread.h:335]

0x00007ffe2b6664f1 UnrealEditor-RenderCore.dll!`FRenderThreadCommandPipe::EnqueueAndLaunch’::`5’::<lambda_1>::operator()() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp:1926]

0x00007ffe2b676bec UnrealEditor-RenderCore.dll!TGraphTask<TFunctionGraphTaskImpl<void __cdecl(void),1> >::ExecuteTask() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:703]

0x00007ffe32172f43 UnrealEditor-Core.dll!UE::Tasks::Private::FTaskBase::TryExecuteTask() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\Core\Public\Tasks\TaskPrivate.h:524]

0x00007ffe32166c2d UnrealEditor-Core.dll!FNamedTaskThread::ProcessTasksNamedThread() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:807]

0x00007ffe32166f9e UnrealEditor-Core.dll!FNamedTaskThread::ProcessTasksUntilQuit() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:696]

0x00007ffe2b6961b3 UnrealEditor-RenderCore.dll!RenderingThreadMain() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp:261]

0x00007ffe2b6968b4 UnrealEditor-RenderCore.dll!FRenderingThread::Run() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp:390]

0x00007ffe3288b928 UnrealEditor-Core.dll!FRunnableThreadWin::Run() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:167]

0x00007ffe3288548a UnrealEditor-Core.dll!FRunnableThreadWin::GuardedRun() [D:\GH\18f2bb4c1110\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:87]

0x00007ffe7e154cb0 KERNEL32.DLL!UnknownFunction [Unknown File]

[Attachment Removed]

Hello,

Thanks for reporting this, it’s a known unresolved crash we’re aware of but haven’t gotten to yet. It’s likely due to a race condition between the game/render threads stemming from how SlateRHIRenderer.cpp creates a temporary TSharedPtr in FSlateRHIRenderer::DrawWindow_RenderThread

DrawWindowViewport_RenderThread(
    Inputs.Window->GetViewport().Get()

If you’re able to reproduce this error you can try working around it by adding ISlateViewport* to FWindowToRender and FSlateDrawWindowPassInputs and set it in DrawWindows_Private near the code that creates the FWindowToRender

ISlateViewport* Viewport = Window->GetViewport().Get();
if (Viewport)
{
    // ... existing code using Viewport ...
}
// Later:
WindowsToRender.Emplace(FWindowToRender { ..., .SlateViewport = Viewport });

Then, replace the temp TSharedPointer with

DrawWindowViewport_RenderThread(
      Inputs.SlateViewport

If you’re able to share a small repro with us that would also be very helpful, especially if it’s in vanilla UE.

[Attachment Removed]

Here’s a bug report Codex generated from what I believe is this same issue, UE-382156.

I can reproduce the same render/game-thread viewport teardown crash on macOS using the stock Launcher build of UE 5.8.2. For this project, it appears to be a regression between 5.8.1 and 5.8.2.

Environment

  • UE 5.8.2: 56702186+++UE5+Release-5.8
  • macOS 26.6.2 (25G83)
  • Apple M3 Max, 64 GB
  • Xcode 26.6
  • Stock Launcher engine; no engine source modifications

Reproduction

  1. Open the project and a normal gameplay map.
  2. Start New Editor Window (PIE), single player.
  3. Allow gameplay to initialize.
  4. Stop PIE or close the preview window.

The log shows normal world teardown followed by destruction of the floating PIE window:

LogWorld: BeginTearingDown for /Game/.../UEDPIE_0_...
LogSlate: Window '... Preview [NetMode: Standalone 0] ...' being destroyed

Approximately 16 ms later:

Assertion failed: IsInGameThread()
[File:./Runtime/Engine/Private/Slate/SceneViewport.cpp]
[Line: 196]

The important stack is:

FSceneViewport::Destroy()
FSceneViewport::~FSceneViewport()
SharedPointerInternals::ReleaseSharedReferenceNoInline()
FSlateRHIRenderer::DrawWindow_RenderThread()
FSlateRHIRenderer::DrawWindows_RenderThread()
RenderingThreadMain()

Crash GUID:

UECC-Mac-6FD74B51444B54680751F9A7AF4E7225_0000

A/B results

  • Same project on Mac with UE 5.8.1 (56057345): does not reproduce.
  • Same project on Mac with UE 5.8.2 (56702186): reproduces.
  • Same project on Windows: does not reproduce.

I compared the 5.8.1 and 5.8.2 release source. The temporary Inputs.Window->GetViewport().Get() ownership path identified above appears unchanged, but 5.8.2 added two nearby timing/lifetime changes:

  • CL 56699292 / UE-387022: Metal viewport zero-size handling now retains the previous nonzero backbuffer size when the Mac window reports 0×0.
  • CL 56699282 / UE-387232: SetPresentLatencyCallbacks is now deferred through RHICmdList.EnqueueLambda.

I am not claiming either change is definitively causal, but they landed immediately before the 5.8.2 build and alter Metal viewport or RHI-command lifetime around the existing race. In particular, retaining a nonzero backbuffer while the PIE window closes might allow one final queued Slate draw to pin and then release the last FSceneViewport reference on the render thread.

There is also a second Mac 5.8.2 PIE-exit assertion when using Selected Viewport:

Assertion failed: GameViewport.IsUnique()
SLevelViewport::EndPlayInEditorSession()
UEditorEngine::TeardownPlaySession()

That may be separate, but both failures occur during in-process PIE viewport teardown and neither reproduces for me on Mac 5.8.1. I can provide that complete stack separately.

The crash report is routed to our project’s Sentry endpoint, so Epic may not be able to resolve the GUID through its own crash backend. I can provide the CrashContext.runtime-xml, log, and minidump privately.