[BUG] BP TMap Remove node causes engine to crash

Using 4.15.1

When using the remove node from a TMap in BP then getting the keys and using a for each loop to print all keys names causes engine to crash.

How to reproduce:

  • Create a Third Person template.

  • Create a Struct with a few string variables inside it

  • Create a TMap with String keys and add the Struct as the value.

  • Add a few keys to the TMap (Example: Slot1, Slot2)

  • Use any event to Get the TMap and remove the specified Key.

  • Get all keys from this TMap and use a for each loop to print all keys names.

Bad Result: Engine crashes, seems to be something about an infinite loop.

Should Result: Should print at screen just the remaining keys names.

Engine Crash Log:

LoginId:d43947f44306fc443be90c85952992d3
EpicAccountId:ddd51285f6d04d73bb0369057e5e5bdc

Access violation - code c0000005 (first/second chance not available)

UE4Editor_Core!rml::internal::Block::findObjectSize()
UE4Editor_Core!FMallocTBB::Realloc() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\core\private\hal\malloctbb.cpp:73]
UE4Editor_Core!TArray::ResizeForCopy() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\core\public\containers\array.h:2281]
UE4Editor_Core!TArray::operator=() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\core\public\containers\array.h:419]
UE4Editor_Core!FString::operator=() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\core\public\containers\unrealstring.h:1700]
UE4Editor_CoreUObject!TProperty::CopyValuesInternal() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\coreuobject\public\uobject\unrealtype.h:1017]
UE4Editor_Engine!UBlueprintMapLibrary::GenericMap_Keys() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\blueprintmaplibrary.cpp:57]
UE4Editor_Engine!UBlueprintMapLibrary::execMap_Keys() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\classes\kismet\blueprintmaplibrary.h:227]
UE4Editor_CoreUObject!UFunction::Invoke() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:4525]
UE4Editor_CoreUObject!UObject::CallFunction() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:721]
UE4Editor_CoreUObject!UObject::ProcessContextOpcode() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:2149]
UE4Editor_CoreUObject!UObject::ProcessInternal() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:948]
UE4Editor_CoreUObject!UObject::CallFunction() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:845]
UE4Editor_CoreUObject!UObject::execVirtualFunction() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:2255]
UE4Editor_CoreUObject!UObject::ProcessInternal() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:948]
UE4Editor_CoreUObject!UFunction::Invoke() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:4525]
UE4Editor_CoreUObject!UObject::ProcessEvent() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1318]
UE4Editor_Engine!AActor::ProcessEvent() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\actor.cpp:678]
UE4Editor_Engine!FInputActionHandlerDynamicSignature::Execute() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\classes\components\inputcomponent.h:108]
UE4Editor_Engine!FInputActionUnifiedDelegate::Execute() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\classes\components\inputcomponent.h:204]
UE4Editor_Engine!UPlayerInput::ProcessInputStack() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\userinterface\playerinput.cpp:1243]
UE4Editor_Engine!APlayerController::ProcessPlayerInput() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\playercontroller.cpp:2376]
UE4Editor_Engine!APlayerController::TickPlayerInput() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\playercontroller.cpp:4051]
UE4Editor_Engine!APlayerController::PlayerTick() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\playercontroller.cpp:2039]
UE4Editor_Engine!APlayerController::TickActor() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\playercontroller.cpp:4133]
UE4Editor_Engine!FActorTickFunction::ExecuteTick() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\actor.cpp:125]
UE4Editor_Engine!FTickFunctionTask::DoTask() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\ticktaskmanager.cpp:269]
UE4Editor_Engine!TGraphTask::ExecuteTask() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\core\public\async\taskgraphinterfaces.h:883]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:954]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:701]
UE4Editor_Core!FTaskGraphImplementation::WaitUntilTasksComplete() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:1798]
UE4Editor_Engine!FTickTaskSequencer::ReleaseTickGroup() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\ticktaskmanager.cpp:538]
UE4Editor_Engine!FTickTaskManager::RunTickGroup() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\ticktaskmanager.cpp:1450]
UE4Editor_Engine!UWorld::RunTickGroup() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\leveltick.cpp:758]
UE4Editor_Engine!UWorld::Tick() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\engine\private\leveltick.cpp:1373]
UE4Editor_UnrealEd!UEditorEngine::Tick() [d:\build++ue4+release-4.15+compile\sync\engine\source\editor\unrealed\private\editorengine.cpp:1630]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [d:\build++ue4+release-4.15+compile\sync\engine\source\editor\unrealed\private\unrealedengine.cpp:391]
UE4Editor!FEngineLoop::Tick() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3025]
UE4Editor!GuardedMain() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\launch\private\launch.cpp:166]
UE4Editor!GuardedMainWrapper() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
UE4Editor!WinMain() [d:\build++ue4+release-4.15+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll

Hello Filipe,

Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here

You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

OBs> the problem is that the Remove node is not working and not removing keys from the TMAP, the for each loop causes a crash because it stays in a infinite loop or something like that. But after several tests it is clear that the remove node is not removing the keys. Thanks

I think this needs to be addressed, as I can experience this as a crash on builds of my game.

It happens when I try to remove an element from a TMap with Integers as Keys and Components as Values on packaged Windows.

In order to reproduce this more easily, I have made a project that shows just how unstable TMap are. You can download it here Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.

If it doesn’t crash right when it starts to remove the spheres, just let it run for a while. It usually freezes at around 36 spheres added. Same goes for packaged versions of this, except that sometimes it crashes when just removing from the map.

Happens in my personal project as well. As soon as I try to “REMOVE” a key (integer type) from my Map(customstruct), it crashes the second time running. Circumventing the node prevents it from crashes, but of course completely ruins the functionality of using a Map. It should be noted my Map is also using a custom structure/Structure Map with Key of Integer.

It makes no sense to me why the Remove node would be failing and crashing, since it literally is grabbing index0 from an array of the keys from the map generated using the KEYS output array from all keys present in map node.

Looks like this bug has been marked as Cannot Reproduce, but we are also getting this exact same crash when using the Remove node on a Map.

We were really looking forward to this feature but seems completely unusable at the moment :frowning: