Crash (AV) when saving a hidden scene with a reflection capture actor

Hello,

I’ve observed the following bug in UE 4.9.0. The repro requires a setup with two streaming levels in a persistent level. StreamingLevelA has a ReflectionCaptureActor in it.

  1. Make some changes to StreamingLevelA. Move objects, whatever.
  2. Use the Levels window to make StreamingLevelA invisible, and StreamingLevelB visible.
  3. Try to Save All to save your changes to StreamingLevelA (which is now invisible.)

Observe: The editor will crash with an AV in UReflectionCaptureComponent::ReadbackFromGPUAndSaveDerivedData, line 1274:

WorldToUpdate->Scene->GetReflectionCaptureData(this, *NewDerivedData);

It appears that WorldToUpdate’s Scene pointer is null.

I’m unsure what the proper fix would be. A simple null check to avoid dereferencing null Scene? If anyone has any suggestions I’m happy to submit a pull request with a fix.

Here’s the top of the call stack:

UE4Editor-Engine.dll!UReflectionCaptureComponent::ReadbackFromGPUAndSaveDerivedData(UWorld * WorldToUpdate) Line 1274	C++
UE4Editor-CoreUObject.dll!FPackageExportTagger::TagPackageExports(FArchiveSaveTagExports & ExportTagger, bool bRoutePresave) Line 2702	C++
UE4Editor-CoreUObject.dll!UPackage::SavePackage(UPackage * InOuter, UObject * Base, EObjectFlags TopLevelFlags, const wchar_t * Filename, FOutputDevice * Error, FLinkerLoad * Conform, bool bForceByteSwapping, bool bWarnOfLongFilename, unsigned int SaveFlags, const ITargetPlatform * TargetPlatform, const FDateTime & FinalTimeStamp, bool bSlowTask) Line 3183	C++
UE4Editor-UnrealEd.dll!UEditorEngine::SavePackage(UPackage * InOuter, UObject * InBase, EObjectFlags TopLevelFlags, const wchar_t * Filename, FOutputDevice * Error, FLinkerLoad * Conform, bool bForceByteSwapping, bool bWarnOfLongFilename, unsigned int SaveFlags, const ITargetPlatform * TargetPlatform, const FDateTime & FinalTimeStamp, bool bSlowTask) Line 3778	C++
UE4Editor-UnrealEd.dll!UEditorEngine::Exec_Obj(const wchar_t * Str, FOutputDevice & Ar) Line 4309	C++
UE4Editor-UnrealEd.dll!UEditorEngine::Exec(UWorld * InWorld, const wchar_t * Stream, FOutputDevice & Ar) Line 5375	C++
UE4Editor-UnrealEd.dll!UUnrealEdEngine::Exec(UWorld * InWorld, const wchar_t * Stream, FOutputDevice & Ar) Line 743	C++
UE4Editor-UnrealEd.dll!SaveWorld(UWorld * World, const FString * ForceFilename, const wchar_t * OverridePath, const wchar_t * FilenamePrefix, bool bRenamePackageToFile, bool bCheckDirty, FString & FinalFilename, bool bAutosaving, bool bPIESaving) Line 527	C++
UE4Editor-UnrealEd.dll!FEditorFileUtils::SaveMap(UWorld * InWorld, const FString & Filename) Line 2098	C++
UE4Editor-UnrealEd.dll!InternalSavePackage(UPackage * PackageToSave, bool & bOutPackageLocallyWritable, FOutputDevice & SaveOutput) Line 2479	C++
UE4Editor-UnrealEd.dll!FEditorFileUtils::PromptForCheckoutAndSave(const TArray<UPackage *,FDefaultAllocator> & InPackages, bool bCheckDirty, bool bPromptToSave, TArray<UPackage *,FDefaultAllocator> * OutFailedPackages, bool bAlreadyCheckedOut, bool bCanBeDeclined) Line 3009	C++

also getting this crash when trying to play standalone under the same conditions

Did you ever figure out what caused it? because we are having the same problem with level streams now as well since switching from 4.10.2 to 4.10.4

Nope, no luck yet. I’ll be sure to post back here if I make any headway.