How can I solve this problem?

I’m building an inventory system and naturally need to use a struct. However, while trying to add a variable to it normally, I added it, changed its name, pressed enter, but the editor froze. I closed and restarted the editor. When I tried to change the variable name again, it gave an error. I opened it again, and this time I was able to change the variable name and data type. However, when I tried to save all, it gave an error. I asked ChatGPT for help. They offered a few solutions, but none worked. Finally, they suggested creating a new struct and replacing the existing structs with the new one. I did that. It worked fine for about two hours, but then when I tried to add another variable to the struct, the same error started again. What could be the solution? I’m including the current error code below; maybe it will help.

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff

UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_Kismet
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_Kismet
UnrealEditor_Kismet
UnrealEditor_Kismet
UnrealEditor_UnrealEd
UnrealEditor_KismetCompiler
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_KismetCompiler
UnrealEditor_KismetCompiler
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_Kismet
UnrealEditor_Kismet
UnrealEditor_KismetWidgets
UnrealEditor_KismetWidgets
UnrealEditor_KismetWidgets
UnrealEditor_KismetWidgets
UnrealEditor_KismetWidgets
UnrealEditor_KismetWidgets
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_ApplicationCore
UnrealEditor_ApplicationCore
UnrealEditor_ApplicationCore
UnrealEditor_ApplicationCore
user32
user32
UnrealEditor_ApplicationCore
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
kernel32
ntdll

first things first: EXCEPTION_ACCESS_VIOLATION means that something somewhere is attempting to read from a pointer that either did exist at some point but doesn’t anymore, or never existed in the first place.
typically the fix for UObject Stuff to check agains IsValid (in Blueprints the one with the question mark has the branch built in)
if it is a raw pointer in C++ check against null

a good rule of thumb if the pointer (or reference in Blueprints) is not the object itself, and it could stop existing for any reason check that it IsValid() before reading from it or writing to it.

can you show the DataTypes of the Members for your struct? my guess is that you have either an AActor* (reference to Actor in Blueprints), or a UActorComponent* (reference to ActorComponent), and that pointer is getting lost during the serialization, and de-serialization when you added a member to the struct.

if this struct is meant to be in an Array, or DataTable that can also cause this issue to exaggerated levels.

to help with the callstack, it would be greatly helpful to see the actual functions in question: in the Epic Games Launcher, on the tile for the engine version, hit the down arrow (next to launch)->Options, and check “Editor symbols for debugging”, if for some reason you don’t have “Engine Source” that should also be checked,

  • now when you get a crash report with a callstack it will include the function calls, so that it is easier to figure out the specifics.

because you didn’t have the Symbols when this crash happened (the crash report is really showing the raw text from the log file generated the moment of the crash) you would need to re-produce the crash for a more usable callstack.


you “shouldn’t” need to create a brand new struct, you might at the worst case need to remove the current instances of that struct and recreate them when you change the type or name of a member, but changing types, and names should be avoided whenever possible especially if you have a lot of instances of the struct setup.

if you absolutely must change the name of a struct member the method that will cause the least headaches:

  • add a new member of the correct type and name to the struct
    • leaving the previous one in place
  • go to each instance of that struct and assign the value to the new member for each instance
    • this process can be automated, but is most easily done with centralized data-stores, or in C++
  • once you have finished with each instance of the struct, go back to the struct definition, and delete the member that is no longer needed.

keep in mind that both the adding the new member, and removing the one no longer needed will cause all of the instances to serialize, and de-serialize, and each instance will need to be checked after both modifications to the struct definition.

My variables data type is here. And then I downloaded what you suggested (Editor symbols for debugging) and then reopened the project. I created a new variable again and changed its name and data type. Then when I pressed the “save all” button, it gave another error. And this time, as you said, something longer and different came out. I’m attaching the resulting code below:

Assertion failed: Index >= 0 [File:D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Public\UObject\UObjectArray.h] [Line: 943]

UnrealEditor_CoreUObject!FUObjectArray::AllocateSerialNumber() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectArray.cpp:472]
UnrealEditor_CoreUObject!FWeakObjectPtr::operator=() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\WeakObjectPtr.cpp:39]
UnrealEditor_CoreUObject!FFieldPath::Generate() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\FieldPath.cpp:101]
UnrealEditor_CoreUObject!FPropertyProxyArchive::operator<<() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Public\UObject\PropertyProxyArchive.h:46]
UnrealEditor_CoreUObject!UStruct::SerializeExpr() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Public\UObject\ScriptSerialization.h:222]
UnrealEditor_CoreUObject!UStruct::SerializeExpr() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:2580]
UnrealEditor_CoreUObject!UStruct::Serialize() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:2375]
UnrealEditor_CoreUObject!UFunction::Serialize() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:7205]
UnrealEditor_CoreUObject!FPackageHarvester::ProcessExport() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\SavePackage\PackageHarvester.cpp:531]
UnrealEditor_CoreUObject!anonymous namespace'::HarvestPackage() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\SavePackage2.cpp:376] UnrealEditor_CoreUObject!anonymous namespace’::InnerSave() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\SavePackage2.cpp:3060]
UnrealEditor_CoreUObject!UPackage::Save2() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\SavePackage2.cpp:3237]
UnrealEditor_CoreUObject!UPackage::Save() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\SavePackage.cpp:20]
UnrealEditor_UnrealEd!UEditorEngine::Save() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:4428]
UnrealEditor_UnrealEd!UEditorEngine::SavePackage() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:4437]
UnrealEditor_UnrealEd!UEditorEngine::Exec_Obj() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorServer.cpp:4659]
UnrealEditor_UnrealEd!UEditorEngine::Exec_Editor() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorServer.cpp:5732]
UnrealEditor_Core!FExec::Exec() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Misc\Exec.cpp:18]
UnrealEditor_Engine!UEngine::Exec() [D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp:5027]
UnrealEditor_UnrealEd!UUnrealEdEngine::Exec() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdSrv.cpp:662]
UnrealEditor_UnrealEd!InternalSavePackage() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\FileHelpers.cpp:3569]
UnrealEditor_UnrealEd!InternalPromptForCheckoutAndSave() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\FileHelpers.cpp:4216]
UnrealEditor_UnrealEd!FEditorFileUtils::PromptForCheckoutAndSave() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\FileHelpers.cpp:4610]
UnrealEditor_UnrealEd!InternalSavePackages() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\FileHelpers.cpp:3848]
UnrealEditor_UnrealEd!FEditorFileUtils::SaveDirtyPackages() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\FileHelpers.cpp:3994]
UnrealEditor_UnsavedAssetsTracker!FUnsavedAssetsTracker::PromptToSavePackages() [D:\build++UE5\Sync\Engine\Source\Developer\UnsavedAssetsTracker\Source\Private\UnsavedAssetsTracker.cpp:525]
UnrealEditor_UnsavedAssetsTracker!SHorizontalBox::FArguments::operator+() [D:\build++UE5\Sync\Engine\Source\Developer\UnsavedAssetsTracker\Source\Private\UnsavedAssetsTrackerModule.cpp:67]
UnrealEditor_UnsavedAssetsTracker!TSparseArray<TSetElement,TSparseArrayAllocator<TSizedDefaultAllocator<32>,FDefaultBitArrayAllocator> >::Empty() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:864]
UnrealEditor_Slate!SButton::ExecuteOnClick() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Widgets\Input\SButton.cpp:467]
UnrealEditor_Slate!SButton::OnMouseButtonUp() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Widgets\Input\SButton.cpp:392]
UnrealEditor_Slate!FSlateApplication::RoutePointerUpEvent'::8’::<lambda_2>::operator()() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5346]
UnrealEditor_Slate!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,FSlateApplication::RoutePointerUpEvent'::8’::<lambda_2> >() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:456]
UnrealEditor_Slate!FSlateApplication::RoutePointerUpEvent() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5332]
UnrealEditor_Slate!FSlateApplication::ProcessMouseButtonUpEvent() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5917]
UnrealEditor_Slate!FSlateApplication::OnMouseUp() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5873]
UnrealEditor_ApplicationCore!FWindowsApplication::ProcessDeferredMessage() [D:\build++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2271]
UnrealEditor_ApplicationCore!FWindowsApplication::DeferMessage() [D:\build++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2783]
UnrealEditor_ApplicationCore!FWindowsApplication::ProcessMessage() [D:\build++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:1944]
UnrealEditor_ApplicationCore!FWindowsApplication::AppWndProc() [D:\build++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:945]
user32
user32
UnrealEditor_ApplicationCore!FWindowsPlatformApplicationMisc::PumpMessages() [D:\build++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsPlatformApplicationMisc.cpp:145]
UnrealEditor!FEngineLoop::Tick() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5806]
UnrealEditor!GuardedMain() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:188]
UnrealEditor!GuardedMainWrapper() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:123]
UnrealEditor!LaunchWindowsStartup() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:277]
UnrealEditor!WinMain() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:317]
UnrealEditor!__scrt_common_main_seh() [D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll

nah this is an age old struct bug in UE5, same with Enum’s too if you’re unlucky. they simply don’t like to be modified once they’re in use, if you just want static data i’d suggest using a DataAsset instead, if you need mutable data try to learn c++ for a struct its very easy.

if not search the forum there are 100 posts on this, some have ‘solutions’ such as saving without compiling and restarting the editor but none worked reliably for me

it’s not an “old struct bug” it is exactly what I said, and the people using them not understanding what is happening. The data was there, and now it isn’t, so the system attempts to access a null pointer and crashes. Blueprints is communicating to C++, and C++ doesn’t have automatic safeguards to handle Null_Reference_Exception.

if anything it is a Blueprint’s Struct issue where in the process of serializing the existing structs into the byte array, applying the change, and then when the struct is de-serialized the engine attempts to put everything back in the slots it was taken out of but it can’t find a match and panics putting the default value of null as an attempt to “fix it” which can cause other issues, and requires safeguard checks which should be happening anyways (because it is using runtime string resolution to try and match them, where C++ uses bit alignment which means that as long as the sizes and type order doesn’t change the name is irrelevant).

the reason C++ structs work is that the issues are handles at engine start, unless you are mad-lad and do a LiveCoding modification on a header and even worse a struct while the editor is open which can/will cause data corruption for “close” to the same reason

DataAssets can run into the same exact thing (A dataAsset is a Struct with an object wrapper), the biggest difference is instead of manually instantiating and managing the struct in place, you reference the DataAsset object which has other trade offs with regards to mutability on the instance.

you’re right i should have specified its a age old blueprint struct bug, hence i suggested switching to C++

that doesn’t change the fact there is no good way to safeguard against it, if you modify an existing BP struct that’s in use there is a high chance of crash/corruption. its been around since the start of the engine, there are 100s of topics on it and while there a steps you can take to mitigate it there is no solution.