Crash on leaving PIE during Widget Animation with AudioTrack due to ScrubberSound_Root_*

Hi,

we recently upgraded from 5.4 to 5.6 and are experiencing a crash on leaving PIE in our project.

We narrowed down, that the crash is only ever happening if we try to leave PIE while an Audio from a Widget Animation was playing.

Some more digging and adding additional log in a Source Version of 5.6 in PlayLevel.cpp at line 505 (see code snippet below) helped us discover that a ScrubedSound_Root_* is the root cause of a leaked object being detected. Learning this made the crash a 100% repro for us.

// Make sure that all objects in the temp levels were entirely garbage collected.
TSet<UObject*> LeakedObjectsSet;
TSet<UPackage*> LeakedPackages;
for(FThreadSafeObjectIterator ObjectIt; ObjectIt; ++ObjectIt )
{
    UObject* Object = *ObjectIt;
    UPackage* ObjectPackage = Object->GetOutermost();
    if (ObjectPackage->HasAnyPackageFlags(PKG_PlayInEditor))
    {
       FString ErrorMessage = FString::Printf(TEXT("Object '%s' from PIE level still referenced.}"), *Object->GetFName().ToString());
       FMessageLog(NAME_CategoryPIE).Error()
          ->AddToken(FUObjectToken::Create(Object, FText::FromString(Object->GetFullName())))
          ->AddToken(FTextToken::Create(FText::FromString(ErrorMessage)));
       
       LeakedPackages.Add(ObjectPackage);
       if (UWorld* TheWorld = UWorld::FindWorldInPackage(ObjectPackage))
       {
          LeakedObjectsSet.Add(TheWorld);
       }
       else
       {
          LeakedObjectsSet.Add(ObjectPackage);
       }
    }
}

ScrubbedSound_Root_* get added by Sequencer Audio Tracks that have no Actor Bindings in MovieSceneAudioSystem line 1253.

So far we only could verify the crash happens from WidgetAnimations with AudioTracks not from LevelSequences with AudioTracks, but in theory it could be possible.

Is there anything we can do in Launcher Engine to fix this or add a workaround?

Any help appreciated,

Ann

Steps to Reproduce

  1. Create a Widget Blueprint and make sure it is spawned on runtime
  2. Add an Animation to the Widget Blueprint
  3. Add an AudioTrack and Sound to the AudioTrack. For easier reproduction use a long audio file and let the animation loop.
  4. Leave Attach of the AudioTrack unbound
  5. Start PIE.
  6. While the Audio is playing leave PIE.
  7. Observe crash.

Hi David and Ann,

Yes I think it may be related to a strong object ptr that was added to a new feature in 5.6.

This was removed in CL 44320933.

Here’s the github commit

https://github.com/EpicGames/UnrealEngine/commit/dd8779ad3c9017baa7ec3318d9a01185a4a91492

Hi and thanks for the answers!

[mention removed] lots of thanks for the answer and rhe tip! As written in the question I was already able to deduce the object with the strong pointer that prevented the garbage collection and it was an object created by the engine as confirmed by Aaron. So it wasn’t really helpful. Appreciated anyway :blush:

[mention removed]​ Thanks to you as well! Is there a chance this CL made it into the 5.6.1 Release? Or will it be in a future release? At least we know how to avoid it if we have to live with it a while longer.

Our team is working in the launcher version, and we only use a source version for packaging and for debugging engine issues. So integrating the CL is not really an option to get the fix to our team.