Description

This looks like it can be fixed with an early-out when the passed array of indices is empty.

Log:
[2024.01.03-16.38.36:091][291]LogOutputDevice: Warning:

Script Stack (1 frames) :
/Game/BP_Crashy.BP_Crashy_C.ClickMeToCrash

Assertion failed: (Index >= 0) & (Index < ArrayNum)
[Link Removed] [Line: 771]
Array index out of bounds: 0 from an array of size 0
A breakpoint instruction (__debugbreak() statement or a similar call) was executed in UnrealEditor.exe.

Steps to Reproduce

1. Download the attached test project and open.
2. Select the actor "BP_Crashy".
3. Click the button "ClickMeToCrash"
4. Observe the crash.

Callstack

> [Inline Frame] UnrealEditor-Engine.dll!TArray<int,TSizedDefaultAllocator<32>>::RangeCheck(int) Line 771
C++
[Inline Frame] UnrealEditor-Engine.dll!TArray<int,TSizedDefaultAllocator<32>>::operator[](int) Line 839 C++
UnrealEditor-Engine.dll!UInstancedStaticMeshComponent::RemoveInstances::__l2::<lambda_1>::operator()(const TArray<int,TSizedDefaultAllocator<32>> & SortedInstancesToRemove) Line 3828 C++
UnrealEditor-Engine.dll!UInstancedStaticMeshComponent::RemoveInstances(const TArray<int,TSizedDefaultAllocator<32>> & InstancesToRemove, bool bInstanceArrayAlreadySortedInReverseOrder) Line 3850 C++
UnrealEditor-Engine.dll!UInstancedStaticMeshComponent::execRemoveInstances(UObject * Context, FFrame & Stack, void * const Z_Param__Result) Line 290 C++
UnrealEditor-CoreUObject.dll!UFunction::Invoke(UObject * Obj, FFrame & Stack, void * const Z_Param__Result) Line 6665 C++
UnrealEditor-CoreUObject.dll!UObject::CallFunction(FFrame & Stack, void * const Z_Param__Result, UFunction * Function) Line 1139 C++
[Inline Frame] UnrealEditor-CoreUObject.dll!FFrame::Step(UObject *) Line 477 C++
UnrealEditor-CoreUObject.dll!UObject::ProcessContextOpcode(FFrame & Stack, void * const Z_Param__Result, bool bCanFailSilently) Line 3094 C++
[Inline Frame] UnrealEditor-CoreUObject.dll!FFrame::Step(UObject *) Line 477 C++
UnrealEditor-CoreUObject.dll!UObject::execLetBool(UObject * Context, FFrame & Stack, void * const Z_Param__Result) Line 2985 C++
[Inline Frame] UnrealEditor-CoreUObject.dll!FFrame::Step(UObject *) Line 477 C++
UnrealEditor-CoreUObject.dll!ProcessLocalScriptFunction(UObject * Context, FFrame & Stack, void * const Z_Param__Result) Line 1209 C++
UnrealEditor-CoreUObject.dll!UObject::ProcessInternal(UObject * Context, FFrame & Stack, void * const Z_Param__Result) Line 1306 C++
UnrealEditor-CoreUObject.dll!UFunction::Invoke(UObject * Obj, FFrame & Stack, void * const Z_Param__Result) Line 6665 C++
UnrealEditor-CoreUObject.dll!UObject::ProcessEvent(UFunction * Function, void * Parms) Line 2145 C++
UnrealEditor-Engine.dll!AActor::ProcessEvent(UFunction * Function, void * Parameters) Line 1122 C++
UnrealEditor-DetailCustomizations.dll!FObjectDetails::OnExecuteCallInEditorFunction(TWeak ObjectPtr<UFunction,FWeakObjectPtr> WeakFunctionPtr) Line 241 C++
[Inline Frame] UnrealEditor-DetailCustomizations.dll!Invoke(FReply(FObjectDetails::*)(TWeakObjectPtr<UFunction,FWeakObjectPtr>)) Line 66 C++
[Inline Frame] UnrealEditor-DetailCustomizations.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned
int,0>,TWeakObjectPtr<UFunction,FWeakObjectPtr>>::ApplyAfter(FReply(FObjectDetails::*)(TWeakObjectPtr<UFunction,FWeakObjectPtr>) &) Line 311 C++
UnrealEditor-DetailCustomizations.dll!TBaseSPMethodDelegateInstance<0,FObjectDetails,1,
FReply__cdecl(void),FDefaultDelegateUserPolicy,TWeakObjectPtr<UFunction,FWeakObjectPtr>>::Execute() Line 281 C++
UnrealEditor-Slate.dll!TDelegate<FReply__cdecl(void),FDefaultDelegateUserPolicy>::Execute() Line 549 C++
UnrealEditor-Slate.dll!SButton::ExecuteOnClick() Line 465 C++
UnrealEditor-Slate.dll!SButton::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 390 C++
[Inline Frame] UnrealEditor-Slate.dll!FSlateApplication::RoutePointerUpEvent::__l8::<lambda_3>::operator()(const FArrangedWidget &) Line 5220 C++
UnrealEditor-Slate.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,`FSlateApplication::RoutePointerUpEvent'::`8'::<lambda_3>>(FSlateApplication * ThisApplication, FEventRouter::FToLeafmostPolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerUpEvent::__l8::<lambda_3> & Lambda, ESlateDebuggingInputEvent DebuggingInputEvent) Line 442 C++
UnrealEditor-Slate.dll!FSlateApplication::RoutePointerUpEvent(const FWidgetPath & WidgetsUnderPointer, const FPointerEvent & PointerEvent) Line 5206 C++
UnrealEditor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent(const FPointerEvent & MouseEvent) Line 5775 C++
UnrealEditor-Slate.dll!FSlateApplication::OnMouseUp(const EMouseButtons::Type Button, const UE::Math::TVector2<double> CursorPos) Line 5740 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessDeferredMessage(const
FDeferredWindowsMessage & DeferredMessage) Line 2231 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,1> & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) Line 2738 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 1099 C++
[Inline Frame] UnrealEditor-ApplicationCore.dll!WindowsApplication_WndProc(HWND__ *) Line 931 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 937 C++
[External Code]
[Inline Frame] UnrealEditor-ApplicationCore.dll!WinPumpMessages() Line 119 C++
UnrealEditor-ApplicationCore.dll!FWindowsPlatformApplicationMisc::PumpMessages(bool bFromMainLoop) Line 148 C++
UnrealEditor.exe!FEngineLoop::Tick() Line 5749 C++
[Inline Frame] UnrealEditor.exe!EngineTick() Line 61 C++
UnrealEditor.exe!GuardedMain(const wchar_t * CmdLine) Line 188 C++
UnrealEditor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 247 C++
UnrealEditor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 298 C++
[External Code]

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-203420 in the post.

0
Login to Vote

Cannot Reproduce
Affects Versions5.3
Target Fix5.4
Fix Commit30322091
CreatedJan 8, 2024
ResolvedJan 8, 2024
UpdatedJan 9, 2024