Crash in FRenderAssetStreamingManager::UpdateResourceStreaming due to invalid array index

We ran into a crash in FRenderAssetStreamingManager::UpdateResourceStreaming due to an invalid array index:

[Image Removed]

The TextureIndex in InflightRenderAssets is bigger than the number of elements in StreamingRenderAssets.

I think this happens in PIE mode when reimporting a texture on which Texture->StreamIn() is being called. (see repro steps)

The call stack is:

Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\jenkins\Build\Game\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 1067]

Array index out of bounds: 1350 into an array of size 1350

Unhandled Exception: 0x00004000

CALLSTACK

UnrealEditor_Core!FDebug::CheckVerifyFailedImpl2() [D:\jenkins\Build\Game\Engine\Source\Runtime\Core\Private\Misc\AssertionMacros.cpp:1018]

UnrealEditor_Engine!FRenderAssetStreamingManager::UpdateResourceStreaming() [D:\jenkins\Build\Game\Engine\Source\Runtime\Engine\Private\Streaming\StreamingManagerTexture.cpp:2041]

UnrealEditor_Engine!FStreamingManagerCollection::UpdateResourceStreaming() [D:\jenkins\Build\Game\Engine\Source\Runtime\Engine\Private\ContentStreaming.cpp:915]

UnrealEditor_Engine!IStreamingManager::Tick() [D:\jenkins\Build\Game\Engine\Source\Runtime\Engine\Private\ContentStreaming.cpp:744]

UnrealEditor_Engine!FStreamingManagerCollection::Tick() [D:\jenkins\Build\Game\Engine\Source\Runtime\Engine\Private\ContentStreaming.cpp:887]

UnrealEditor_UnrealEd!UEditorEngine::Tick() [D:\jenkins\Build\Game\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:2472]

UnrealEditor_UnrealEd!UUnrealEdEngine::Tick() [D:\jenkins\Build\Game\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:533]

UnrealEditor!FEngineLoop::Tick() [D:\jenkins\Build\Game\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5770]

UnrealEditor!GuardedMain() [D:\jenkins\Build\Game\Engine\Source\Runtime\Launch\Private\Launch.cpp:196]

UnrealEditor!GuardedMainWrapper() [D:\jenkins\Build\Game\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:129]

UnrealEditor!LaunchWindowsStartup() [D:\jenkins\Build\Game\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:305]

UnrealEditor!WinMain() [D:\jenkins\Build\Game\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:364]

UnrealEditor!__scrt_common_main_seh() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]

kernel32!BaseThreadInitThunk()

ntdll!RtlUserThreadStart()

Steps to Reproduce
Unfortunately, I can’t provide a repro in vanilla UE for the issue but I can describe how we reproduced it in our game:

  • Enter PIE
  • Make sure the texture gets streamed in. We have a system to stream in VFX textures that are soon going to be needed.
  • Open the VFX
  • Open the Texture
  • Reimport the texture
  • If it didn’t crash, make some changes to the source file (png) and reimport again.
  • Repeat the last step if necessary.

Usually this will trigger it after 4 attempts or so.

The texture needs to be streamable but non-virtual:

[Image Removed]

Hello,

Thank you for reaching out.

I’ve been assigned this issue, and we will be looking into this array out of bounds exception for you.

Hello,

We were unable to reproduce the crash you described.

Can you please send us a minimal test project that demonstrates this crash?

The guide for test projects:

[Content removed]

Thank you for giving it a try, Stephen.

Unfortunately, we won’t be able to make time to attempt a repro on vanilla for a few weeks. We’ll follow up here if and when we attempt as much.