@ranierin @mattai I ran the debugger with engine symbols added to Unreal and I got a more detailed feedback on the error. again the code crashes at the end of beginplay after all the code executes successfully (load model, setup model, preprocess input, run inference, post process output), this only happens with a multiinput/multioutput neural net, any thoughts on the error ? here is the call stack
[Inlined] [UnrealEditor-Core.dll] _mi_page_malloc(mi_heap_s *, mi_page_s *, unsigned long long) 0x00007ffaedd7255c
[Inlined] [UnrealEditor-Core.dll] mi_heap_malloc_small(mi_heap_s *, unsigned long long) 0x00007ffaedd72559
[Inlined] [UnrealEditor-Core.dll] mi_heap_malloc(mi_heap_s *, unsigned long long) 0x00007ffaedd72559
[UnrealEditor-Core.dll] _mi_heap_malloc_zero(mi_heap_s *, unsigned long long, bool) 0x00007ffaedd72559
[UnrealEditor-Core.dll] mi_heap_malloc_zero_aligned_at(mi_heap_s *const, const unsigned long long, const unsigned long long, const unsigned long long, const bool) 0x00007ffaedd7995b
[UnrealEditor-Core.dll] mi_heap_realloc_zero_aligned_at(mi_heap_s *, void *, unsigned long long, unsigned long long, unsigned long long, bool) 0x00007ffaedd7a0b5
[Inlined] [UnrealEditor-Core.dll] mi_heap_realloc_zero_aligned(mi_heap_s *, void *, unsigned long long, unsigned long long, bool) 0x00007ffaedd7d2a3
[Inlined] [UnrealEditor-Core.dll] mi_heap_realloc_aligned(mi_heap_s *, void *, unsigned long long, unsigned long long) 0x00007ffaedd7d27b
[UnrealEditor-Core.dll] mi_realloc_aligned(void *, unsigned long long, unsigned long long) 0x00007ffaedd7d27b
[Inlined] [UnrealEditor-Core.dll] FMallocMimalloc::TryRealloc(void *, unsigned long long, unsigned int) MallocMimalloc.cpp:136
[UnrealEditor-Core.dll] FMallocMimalloc::Realloc(void *, unsigned long long, unsigned int) MallocMimalloc.cpp:155
[Inlined] [UnrealEditor-Core.dll] FLowLevelMemTracker::IsEnabled() LowLevelMemTracker.h:1086
[UnrealEditor-Core.dll] FMemory::Realloc(void *, unsigned long long, unsigned int) FMemory.inl:118
[UnrealEditor-Core.dll] TSizedHeapAllocator<32, FMemory>::ForAnyElementType::ResizeAllocation(int, int, unsigned long long, unsigned int) ContainerAllocationPolicies.h:725
[Inlined] [UnrealEditor-Engine.dll] TArray<FCookStatsManager::TKeyValuePair<FString, FString>, TSizedDefaultAllocator<32> >::AllocatorResizeAllocation(int, int) Array.h:3064
[UnrealEditor-Engine.dll] TArray<FCookStatsManager::TKeyValuePair<FString, FString>, TSizedDefaultAllocator<32> >::ResizeTo(int) Array.h:3141
[Inlined] [UnrealEditor-Engine.dll] TArray<FCookStatsManager::TKeyValuePair<FString, FString>, TSizedDefaultAllocator<32> >::Empty(int) Array.h:1945
[Inlined] [UnrealEditor-Engine.dll] FCookStatsManager::CreateKeyValueArray(const wchar_t (&)[11], const wchar_t (&)[11], const wchar_t (&)[5], const wchar_t *&, const wchar_t (&)[10], const wchar_t *&&, const wchar_t (&)[6], long long &&, const wchar_t (&)[8], double &&, const wchar_t (&)[3], double &&, const wchar_t (&)[5], double &&, const wchar_t (&)[5], const FString &) CookStats.h:135
[UnrealEditor-Engine.dll] FCookStats::CallStats::LogStats'::
2’::<lambda_1>::operator()(EHitOrMiss,bool) CookStats.h:252
[Inlined] [UnrealEditor-Engine.dll] FCookStats::CallStats::LogStats(TFunctionRef<void __cdecl(const FString &, const TArray<FCookStatsManager::TKeyValuePair<FString, FString>, TSizedDefaultAllocator<32> > &)>, const FString &, const FString &, const wchar_t *) CookStats.h:271
[UnrealEditor-Engine.dll] FDerivedDataUsageStats::LogStats(TFunctionRef<void __cdecl(const FString &, const TArray<FCookStatsManager::TKeyValuePair<FString, FString>, TSizedDefaultAllocator<32> > &)>, const FString &, const FString &) CookStats.h:432
[UnrealEditor-Engine.dll] ??R<lambda_13>@BodySetupCookStats@@QEBA@V?$TFunctionRef@$$A6AXAEBVFString@@AEBV?$TArray@U?$TKeyValuePair@VFString@@V1@@FCookStatsManager@@V?$TSizedDefaultAllocator@$0CA@@@@@@Z@@@Z(TFunctionRef<void __cdecl(FString const &,TArray<FCookStatsManager::TKeyValuePair<FString,FString>,TSizedDefaultAllocator<32> > const &)>) BodySetup.cpp:81
[Inlined] [UnrealEditor-Engine.dll] Invoke(BodySetupCookStats::<lambda_13> &, TFunctionRef<void __cdecl(const FString &, const TArray<FCookStatsManager::TKeyValuePair<FString, FString>, TSizedDefaultAllocator<32> > &)> &&) Invoke.h:47
[Inlined] [UnrealEditor-Engine.dll] UE::Core::Private::Tuple::TTupleBase<TIntegerSequence >::ApplyAfter(BodySetupCookStats::<lambda_13> &, TFunctionRef<void __cdecl(const FString &, const TArray<FCookStatsManager::TKeyValuePair<FString, FString>, TSizedDefaultAllocator<32> > &)> &&) Tuple.h:309
[UnrealEditor-Engine.dll] ?ExecuteIfSafe@?$TBaseFunctorDelegateInstance@$$A6AXV?$TFunctionRef@$$A6AXAEBVFString@@AEBV?$TArray@U?$TKeyValuePair@VFString@@V1@@FCookStatsManager@@V?$TSizedDefaultAllocator@$0CA@@@@@@Z@@@ZUFDefaultDelegateUserPolicy@@V<lambda_13>@BodySetupCookStats@@$$V@@UEBA_NV?$TFunctionRef@$$A6AXAEBVFString@@AEBV?$TArray@U?$TKeyValuePair@VFString@@V1@@FCookStatsManager@@V?$TSizedDefaultAllocator@$0CA@@@@@@Z@@@Z(TFunctionRef<void __cdecl(FString const &,TArray<FCookStatsManager::TKeyValuePair<FString,FString>,TSizedDefaultAllocator<32> > const &)>) DelegateInstancesImpl.h:868
[Inlined] [UnrealEditor-Core.dll] TMulticastDelegateBase::Broadcast(TFunctionRef<void __cdecl(const FString &, const TArray<FCookStatsManager::TKeyValuePair<FString, FString>, TSizedDefaultAllocator<32> > &)>) MulticastDelegateBase.h:254
[UnrealEditor-Core.dll] TMulticastDelegate<void __cdecl(TFunctionRef<void cdecl(const FString &, const TArray<FCookStatsManager::TKeyValuePair<FString, FString>, TSizedDefaultAllocator<32> > &)>), FDefaultDelegateUserPolicy>::Broadcast(TFunctionRef<void cdecl(const FString &, const TArray<FCookStatsManager::TKeyValuePair<FString, FString>, TSizedDefaultAllocator<32> > &)>) DelegateSignatureImpl.inl:956
[UnrealEditor-Core.dll] FCookStatsManager::LogCookStats(TFunctionRef<void cdecl(const FString &, const TArray<FCookStatsManager::TKeyValuePair<FString, FString>, TSizedDefaultAllocator<32> > &)>) CookStats.cpp:32
[UnrealEditor-DerivedDataCache.dll] GatherDerivedDataCacheSummaryStats(FDerivedDataCacheSummaryStats &) DerivedDataCacheUsageStats.cpp:129
[UnrealEditor-StudioTelemetry.dll] FStudioTelemetryEditor::RecordEvent_Loading(const FString &, double, TArray<FAnalyticsEventAttribute, TSizedDefaultAllocator<32> >) StudioTelemetryEditor.cpp:180
[UnrealEditor-StudioTelemetry.dll] ??R<lambda_13>@?1??Initialize@FStudioTelemetryEditor@@QEAAXXZ@QEBA@PEAVUGameInstance@@@Z(UGameInstance *) StudioTelemetryEditor.cpp:685
[Inlined] [UnrealEditor-StudioTelemetry.dll] Invoke(<lambda_13> &, UGameInstance *&&) Invoke.h:47
[Inlined] [UnrealEditor-StudioTelemetry.dll] UE::Core::Private::Tuple::TTupleBase<TIntegerSequence >::ApplyAfter(<lambda_13> &, UGameInstance *&&) Tuple.h:309
[UnrealEditor-StudioTelemetry.dll] ?ExecuteIfSafe@?$TBaseFunctorDelegateInstance@$$A6AXPEAVUGameInstance@@@ZUFDefaultDelegateUserPolicy@@V<lambda_13>@?1??Initialize@FStudioTelemetryEditor@@QEAAXXZ@$$V@@UEBA_NPEAVUGameInstance@@@Z(UGameInstance *) DelegateInstancesImpl.h:868
[Inlined] [UnrealEditor-Engine.dll] TMulticastDelegateBase::Broadcast(UGameInstance *) MulticastDelegateBase.h:254
[UnrealEditor-Engine.dll] TMulticastDelegate<void cdecl(UGameInstance *), FDefaultDelegateUserPolicy>::Broadcast(UGameInstance *) DelegateSignatureImpl.inl:956
[UnrealEditor-Engine.dll] UGameInstance::StartPlayInEditorGameInstance(ULocalPlayer *, const FGameInstancePIEParameters &) GameInstance.cpp:572
[UnrealEditor-UnrealEd.dll] UEditorEngine::CreateInnerProcessPIEGameInstance(FRequestPlaySessionParams &, const FGameInstancePIEParameters &, int) PlayLevel.cpp:3141
[UnrealEditor-UnrealEd.dll] UEditorEngine::OnLoginPIEComplete_Deferred(int, bool, FString, FPieLoginStruct) PlayLevel.cpp:1589
[UnrealEditor-UnrealEd.dll] UEditorEngine::CreateNewPlayInEditorInstance(FRequestPlaySessionParams &, const bool, EPlayNetMode) PlayLevel.cpp:1853
[UnrealEditor-UnrealEd.dll] UEditorEngine::StartPlayInEditorSession(FRequestPlaySessionParams &) PlayLevel.cpp:2868
[UnrealEditor-UnrealEd.dll] UEditorEngine::StartQueuedPlaySessionRequestImpl() PlayLevel.cpp:1167
[UnrealEditor-UnrealEd.dll] UEditorEngine::StartQueuedPlaySessionRequest() PlayLevel.cpp:1064
[UnrealEditor-UnrealEd.dll] UEditorEngine::Tick(float, bool) EditorEngine.cpp:1901
[UnrealEditor-UnrealEd.dll] UUnrealEdEngine::Tick(float, bool) UnrealEdEngine.cpp:547
[UnrealEditor.exe] FEngineLoop::Tick() LaunchEngineLoop.cpp:5904
[Inlined] [UnrealEditor.exe] EngineTick() Launch.cpp:61
[UnrealEditor.exe] GuardedMain(const wchar_t *) Launch.cpp:182
[UnrealEditor.exe] LaunchWindowsStartup(HINSTANCE *, HINSTANCE *, char *, int, const wchar_t *) LaunchWindows.cpp:247
[UnrealEditor.exe] WinMain(HINSTANCE *, HINSTANCE *, char *, int) LaunchWindows.cpp:298
[Inlined] [UnrealEditor.exe] invoke_main() 0x00007ff773f7b95a
[UnrealEditor.exe] __scrt_common_main_seh() 0x00007ff773f7b939
[kernel32.dll] 0x00007ffb4aeb257d
[ntdll.dll] 0x00007ffb4b9caa48
the error is in line 136 of as shown in the image in the following engine file
C:\Program Files\Epic Games\UE_5.4\Engine\Source\Runtime\Core\Private\HAL\MallocMimalloc.cpp
here is my BeginPlay() that produced the output logs in the previous demo I posted:
void ULandMarkDetector::BeginPlay()
{
Super::BeginPlay();
UE_LOG(LogTemp, Warning, TEXT("##########-------------------- HandLandMarksDetection --------------------##########"));
std::string imagePath = "C:/Users/ahmed/Documents/Unreal Projects/LandMarkDetection/Source/LandMarkDetection/hand_center_cropped.png";
this->SourceImage = cv::imread(imagePath, cv::IMREAD_COLOR);
// check if the image has been loaded correctly
if(this->SourceImage.empty())
{
UE_LOG(LogTemp, Error, TEXT("Image cannot be loaded"));
}
else
{
this->HandLandMarksInput = new cv::Mat(this->SourceImage);
this->LoadModel();
if (this->bModelLoaded)
{
UE_LOG(LogTemp, Display, TEXT("Model load sucess"));
this->SetupModel();
this->RunModel();
}
}
}
this has been frustrating, I can’t figure it out, any feedback would be appreciated
Thank you