Hi,
We’re seeing intermittent crashes on our Linux dedicated servers (5.8.2, Shipping) in GC reachability: SIGSEGV reading 0xc in FUObjectArray::ObjectToIndex from TReferenceBatcher<FMutableReference,…>::DrainValidatedFull. Same signature as UE-386410, but no FSharedStruct involved here. GC runs with EliminateGarbage | IncrementalReachability, not parallel.
We added a check that fatals when a validated slot reads back as null. It says the slot isn’t inside any live UObject (so heap memory reported through an ARO), and the last object processed is a StateTreeComponent.
Looking at the code, I think this is what happens:
- FStateTreeRunParallelStateTreeTask passes the outer tree’s event queue to the nested tree (SharedEventQueue, StateTreeRunParallelStateTreeTask.cpp:92).
- The nested FStateTreeInstanceData is a UPROPERTY of the task instance data, so the GC walks both storages.
- FStateTreeInstanceStorage::AddStructReferencedObjects (StateTreeInstanceData.cpp:766) reports the queue every time, without checking bIsOwningEventQueue.
So each queued event, and its payload, gets reported twice per pass. Our payloads hold a TObjectPtr. When that actor is garbage, the first report nulls the slot and the second one reads it back as null. The pest that crashed had a full queue (64 events) and the crash happened right after the session ended and the actors were destroyed.
The fix we’re testing locally:
if (bIsOwningEventQueue || EventQueue.IsUnique())
{
Collector.AddPropertyReferencesWithStructARO(TBaseStructure<FStateTreeEventQueue>::Get(), &EventQueue.Get());
}
It assumes the owner storage is reported and outlives the storages it shares with, which is true for RunParallel. We don’t have a local repro yet and the fix isn’t confirmed on servers.
The code is the same in Main, Dev-Release-5.9 and UE6 Main. Is this known on your side? And would you rather fix it per pass like CL 55907383 did for FSharedStruct?
Thanks