Texture Data un-Serialize crash while OpenLevel

Reporting a crash since UE 4.15.0/1 (a check fail critical error):

If you try to load a UTexture’s data (eg UpdateResource() or PlatformData .. Mip .. Lock/GetCopy) inside a PostLoad of anything during an OpenLevel.

Attached, a small UE4 repro project, and here are the reproduction steps:

  • Open in UE4Editor 4.15.0/1
  • in ProjectLauncher, Launch: Windows, Default (WindowsNoEditor), DebugGame (or any), By The Book
  • When opened, press [TAB]: level blueprint will OpenLevel “MapCrash”.
  • “MapCrash”'s AMyActor::PostLoad code will load a UTexture’s data, and crash during the de-Serialize of the pixels.

here is the crash:

LogWindows:Error: begin: stack for UATLogWindows:Error: === Critical error: ===
LogWindows:Error: === Critical error: ===LogWindows:Error:
LogWindows:Error: LogWindows:Error: Assertion failed: CurrentPos + Count <= TotalSizeOrMaxInt64IfNotReady() [File:D:\Build\++UE4+Release-4.15+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\Serialization\AsyncLoading.cpp] [Line: 7351]
LogWindows:Error: Assertion failed: CurrentPos + Count <= TotalSizeOrMaxInt64IfNotReady() [File:D:\Build\++UE4+Release-4.15+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\Serialization\AsyncLoading.cpp] [Line: 7351] LogWindows:Error: Seeked past end of file ../../../LoadTextureCrash/Content/T_Texture.uexp (4979 / 1346)

More info inside the project AMyActor source code.

Did not crash on 4.14.3.

Do not crash if called during the load of the first Level (I could only repro with a Blueprint OpenLevel).

Also crashes on PS4, XboxOne, but does not seem to crash on Linux (!?).

Does not crash in UE4Editor.

My guess, is some async Texture Streaming/Loading not perfectly thread safe.

Update 4.15.2 (9 May 2017):

Since 4.15.2, by default (as in default project settings) it does not crash anymore, because the Event Driven Loader seems to have been disabled by default:

On 4.15.1, default project settings, it logs (and crashes later):

LogStreaming:Display: Async Loading initialized: New Async IO: true, Event Driven Loader: true, Async Loading Thread: false

On 4.15.2, default project settings, it logs (and does NOT crash later):

LogStreaming:Display: Async Loading initialized: New Async IO: false, Event Driven Loader: false, Async Loading Thread: false

On 4.15.2, enable Project Settings > Streaming > Event Driven Loader Enabled, it logs (and crashes again later):

LogStreaming:Display: Async Loading initialized: New Async IO: true, Event Driven Loader: true, Async Loading Thread: false

(Edit: moved to Bug Report section. Edit: still crashes with 4.15.1. Edit May 9: added “Update 4.15.2”)

Update 4.17.0 (18 August 2017):

TL;DR: Fixed.

Could not repro the crash on 4.17, and Event-Driven Loader fixes in 4.17 changelog could be related to this bug, I’ll consider it fixed, !

Hey Jo_PkFX,

Thank you for submitting this post. I have reproduced this issue and logged a report for it here: Unreal Engine Issues and Bug Tracker (UE-43208)

You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

Cheers,

Ed.
I could not even find a condition to check to prevent the crash, I had to completely disable the feature, even if it would not have crashed in some cases. I’ll welcome any “workaround” ideas.

I currently am unaware of a valid workaround. If I see an engineer update that ticket with additional info I will be sure to post it as a public comment so you can see it on our public tracker.

Hey, it seems to have been fixed in UE 4.17, !