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.
1. Download the attached test project and open.
2. Select the actor "BP_Crashy".
3. Click the button "ClickMeToCrash"
4. Observe the crash.
> [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]
How does TextureRenderTarget2D get TArray<uint8> type data?
How do I set a material as a post-processing material?
Why does the REMOVE method of map container remove elements have memory leaks?
How to delete some elements correctly when deleting an array loop?
What is the cause of the packaging error falling back to 'GameUserSettings' in ue5?
What is the difference between Camera and CineCamera?
How to assign a value to a member of UMG's UMaterialInterface pointer type in C++?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-203420 in the post.
0 |
Fix Commit | 30322091 |
---|
Created | Jan 8, 2024 |
---|---|
Resolved | Jan 8, 2024 |
Updated | Jan 9, 2024 |