Following an update to 5.7 from 5.6.1, we’re seeing frequent crashes deep in the Paint of our hud content, normally around state changes (i.e. destroying the hud when we pause or hiding it on other events). The crash itself is hit when iterating over cached widgets from ClearAllFastPathData (as per the attached callstack), but on non-PC platforms we’re seeing a corresponding ensure firing some time before this, in FSlateCachedElementData::AddCache
FSlateCachedElementsHandle FSlateCachedElementData::AddCache(const SWidget* Widget)
{
#if WITH_SLATE_DEBUGGING
for (TSharedPtr<FSlateCachedElementList>& CachedElementList : CachedElementLists)
{
ensure(CachedElementList->OwningWidget != Widget);
}
#endif
This code just continues as normal after this point so we suspect an element is being referenced twice in cached lists and then either referenced after it’s destroyed or double freed - ‘OwningWidget’ is a raw pointer. We haven’t found an 100% solid repro yet but the timing seems variable, which would be consistent with a scenario like that.
As the callstack for the ensure contains invalidation boxes, we suspect some of the 7.1 changes in this area may be leading to the double-caching. It looks like this code has been updated since the 5.7 release was taken, so we’re speculating that these changes might help matters, but it’d be great if you could take a look and let us know if you think this is a likely path (and how easily we can cherry-pick the changes) - or any other potential fixes you can think of!
The main change we’re looking at is 48776307 (“This CL addresses three linked issues in the Dynamic Invalidation system…”), but that looks dependent on 47254763 (“Slate Invalidation - Show Slate Invalidation status in Diagnostic Window…”)
Thanks a lot!
Ian L
[Attachment Removed]