# UE 5.5 crash while accessing garbage data in FGameplayAttribute

**URL:** <https://forums.unrealengine.com/t/ue-5-5-crash-while-accessing-garbage-data-in-fgameplayattribute/2450267>\
**Category:** C++\
**Tags:** unreal-engine, bug-report\
**Created:** [April 10, 2025, 8:30pm UTC](https://forums.unrealengine.com/t/ue-5-5-crash-while-accessing-garbage-data-in-fgameplayattribute/2450267 "2025-04-10T20:30:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RiotEpiphane](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RiotEpiphane](https://forums.unrealengine.com/u/RiotEpiphane)\
**Post date:** [April 10, 2025, 8:30pm UTC](https://forums.unrealengine.com/t/ue-5-5-crash-while-accessing-garbage-data-in-fgameplayattribute/2450267/1 "2025-04-10T20:30:42Z")

</div>

Hello! While upgrading our project from 5.4 to 5.5, we found an issue with `FGameplayAttribute` allowing garbage data to be accessed which can cause a crash.

Steps to reproduce:

- Create a BP reference to a gameplay attribute - in our case it was a float `UPROPERTY()` value
- Delete the `UPROPERTY()` value but don’t remove the reference in blueprints
- Restart editor/game, and run anything that uses the old blueprint logic

In both engine versions, an `FGameplayAttribute` is deserialized for the invalid property, but in 5.4 and earlier errors would be avoided because `FGameplayAttribute::IsValid()` returns false. In 5.5 this is no longer the case. It appears to be because the operation used for `Attribute != nullptr` has changed. I’ve written up a simple test here that passes in 5.4 but not 5.5:

`GameplayAttributeTest.h`

```auto
USTRUCT()
struct FGameplayAttributeTestPoint
{
	GENERATED_BODY()
public:
	UPROPERTY()
	int32 X = 0;
	UPROPERTY()
	int32 Y = 0;
};

```

`GameplayAttributeTest.cpp`

```auto
TEST_CASE_NAMED(FGameplayAttributeTest, "GameplayAbilities::GameplayAttribute", "[Core][UObject][SmokeFilter]")
{
	SECTION("Serialization")
	{
		FGameplayAttribute Attribute;
		Attribute.SetUProperty(FGameplayAttributeTestPoint::StaticStruct()->PropertyLink);
		
		TArray<uint8> Data;
		FMemoryWriter ByteWriter(Data);
		FObjectAndNameAsStringProxyArchive Writer(ByteWriter, false);
		FGameplayAttribute::StaticStruct()->SerializeItem(Writer, &Attribute, nullptr);
		{
			// Change the property name from X to Y.
			Data[47] = 'Y';
			Data[102] = 'Y';
		
			TFieldPath<FProperty> FieldPath;
			FMemoryReader ByteReader(Data);
			FObjectAndNameAsStringProxyArchive Reader(ByteReader, false);
		
			FGameplayAttribute::StaticStruct()->SerializeItem(Reader, &Attribute, nullptr);
			// Attribute is valid, because property Y exists.
			bool Result = Attribute.IsValid();
			CHECK(Result);
		}
		
		{
			// Change the property name from X to Z. In normal circumstances this could indicate that property Z _used_ to exist and does not anymore, but there is still a serialized reference to it on disk.
			Data[47] = 'Z';
			Data[102] = 'Z';
		
			TFieldPath<FProperty> FieldPath;
			FMemoryReader ByteReader(Data);
			FObjectAndNameAsStringProxyArchive Reader(ByteReader, false);
		
			FGameplayAttribute::StaticStruct()->SerializeItem(Reader, &Attribute, nullptr);
			// Attribute should not be valid, because property Z does not exist.
			bool Result = Attribute.IsValid();
			CHECK(!Result);
		}
	}
}

```

---

<div class="post-metadata">

**Author:** ![GraphiteDragons](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GraphiteDragons](https://forums.unrealengine.com/u/GraphiteDragons)\
**Post date:** [May 1, 2025, 8:30pm UTC](https://forums.unrealengine.com/t/ue-5-5-crash-while-accessing-garbage-data-in-fgameplayattribute/2450267/2 "2025-05-01T20:30:43Z")

</div>

Running into this as well. @RiotEpiphane Did you find a workaround?

---

<div class="post-metadata">

**Author:** ![RiotEpiphane](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RiotEpiphane](https://forums.unrealengine.com/u/RiotEpiphane)\
**Post date:** [July 17, 2025, 8:44pm UTC](https://forums.unrealengine.com/t/ue-5-5-crash-while-accessing-garbage-data-in-fgameplayattribute/2450267/3 "2025-07-17T20:44:28Z")

</div>

Nope, they did fix it in the GitHub mirror though: [https://github.com/EpicGames/UnrealEngine/commit/7190f8f8aa0312b094e99e8f1c56fc129f04a287](https://github.com/EpicGames/UnrealEngine/commit/7190f8f8aa0312b094e99e8f1c56fc129f04a287)
