Edit: This crash is related to the usage of asset collections.
If an asset is part of a collection, it is possible to crash the content browser search when you type a character into the search that is part of the collection name, due to an order of operations bug in the FCompiledAssetTextFilter::PassesFilter function
-Original-
In 5.5, our team ran into a crash issue when typing into the search bar of the content browser. I tracked it to FCompiledAssetTextFilter::TestBasicStringExpression, which calls CompareFStringView, on FStringView objects that are empty.
I am not sure how or why the FCompiledAssetTextFilter gets into the state of having null string views, but here is an example of one such object that crashes.
[Image Removed]
You can see how all 4 string views are empty. Calling CompareFStringView with these empty string views dereferences the data pointer to a nullptr and then crashes in the string compare.
The asset just seems to be a simple gameplay ability. Nothing all that special. I don’t know how it’s getting to this function with none of those string views filled in, but it is
To avoid this crash, I put checks around the locations that would crash on these empty string views.
I did some more debugging, and I think I have found the issue
FCompiledAssetTextFilter::PassesFilter sets the string views at the bottom of the function
If the asset is referenced by dynamic collections (ReferencedDynamicCollections), DynamicCollection.Container->TestDynamicQuery will be called within the PassesFilter function, before the string views have been set, resulting in the string views being accessed before the caller has set them
So the key repro case is probably that the asset is part of a collection.
[Image Removed]A proper fix is probably to not call any other query functions prior to the FCompiledAssetTextFilter being fully initialized in this function
Moving the block
if ((CollectionContainers.IsValid() || ReferencedDynamicCollections.IsValid()) && bIncludeCollectionNames)
to after the string view initialization(before the call to
Wow thank you @anonymous-edc for your research! It solved my Content Browser crashing immediately and I haven’t noticed the fix causing other stability side effects. I went ahead and made an official PR so we can get it fixed for anyone else experiencing this.
I can’t fully build the most recent Engine release as that would be a 4 hour detour, but I did compile from 5.5.4 and the incremental build took 60 seconds. The PR is a rebase from the official release branch. Please upvote or tag a reviewer. Thank you!
@RafaelDeCP Can you update the relevant Bug Tracker link? That link is broken for me.