E4-Unreal / test-simple-game-framework

simpleFramework for UE 5.1.0
MIT License
0 stars 1 forks source link

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION 0x0000000000000000 #22

Closed Eu4ng closed 1 year ago

Eu4ng commented 1 year ago

관련 파일

버그 설명

일정 시간 동안 에디터 게임 플레이 혹은 장비 교체를 여러 번 반복하면 Crash 발생

Crash 내역

자세히 보기
``` LoginId:87aa803a46db9fe52c3d3b93181443ab EpicAccountId:c7780943525c4234ac1b2c9f979865ed Unhandled Exception: EXCEPTION_ACCESS_VIOLATION 0x0000000000000000 UnrealEditor_ThirdPerson!UEquipmentComponent::SelectEquipment() [D:\Unreal Projects\simpleFramework\ThirdPerson\Source\ThirdPerson\EquipmentSystem\EquipmentComponent.cpp:103] UnrealEditor_ThirdPerson!UEquipmentComponent::execSelectEquipment() [D:\Unreal Projects\simpleFramework\ThirdPerson\Intermediate\Build\Win64\UnrealEditor\Inc\ThirdPerson\UHT\EquipmentComponent.gen.cpp:284] UnrealEditor_CoreUObject!UFunction::Invoke() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:6455] UnrealEditor_CoreUObject!UObject::CallFunction() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1118] UnrealEditor_CoreUObject!UObject::ProcessContextOpcode() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:3084] UnrealEditor_CoreUObject!UObject::execLetBool() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:2975] UnrealEditor_CoreUObject!ProcessLocalScriptFunction() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1188] UnrealEditor_CoreUObject!ProcessScriptFunction() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1018] UnrealEditor_CoreUObject!ProcessLocalFunction() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1258] UnrealEditor_CoreUObject!ProcessLocalScriptFunction() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1188] UnrealEditor_CoreUObject!UObject::ProcessInternal() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1285] UnrealEditor_CoreUObject!UFunction::Invoke() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:6455] UnrealEditor_CoreUObject!UObject::ProcessEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:2116] UnrealEditor_Engine!AActor::ProcessEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:1055] UnrealEditor_Engine!FInputActionUnifiedDelegate::Execute() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Classes\Components\InputComponent.h:302] UnrealEditor_Engine!UPlayerInput::ProcessInputStack() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\UserInterface\PlayerInput.cpp:1433] UnrealEditor_EnhancedInput!UEnhancedPlayerInput::ProcessInputStack() [D:\build\++UE5\Sync\Engine\Plugins\EnhancedInput\Source\EnhancedInput\Private\EnhancedPlayerInput.cpp:257] UnrealEditor_Engine!APlayerController::ProcessPlayerInput() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:2707] UnrealEditor_Engine!APlayerController::TickPlayerInput() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:4955] UnrealEditor_Engine!APlayerController::PlayerTick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:2311] UnrealEditor_Engine!APlayerController::TickActor() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:5107] UnrealEditor_Engine!FActorTickFunction::ExecuteTick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:222] UnrealEditor_Engine!FTickFunctionTask::DoTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:284] UnrealEditor_Engine!TGraphTask::ExecuteTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:1348] UnrealEditor_Core!FNamedTaskThread::ProcessTasksNamedThread() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:760] UnrealEditor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:649] UnrealEditor_Core!FTaskGraphCompatibilityImplementation::WaitUntilTasksComplete() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:2203] UnrealEditor_Engine!FTickTaskSequencer::ReleaseTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:565] UnrealEditor_Engine!FTickTaskManager::RunTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:1592] UnrealEditor_Engine!UWorld::RunTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:794] UnrealEditor_Engine!UWorld::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:1537] UnrealEditor_UnrealEd!UEditorEngine::Tick() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:1890] UnrealEditor_UnrealEd!UUnrealEdEngine::Tick() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:517] UnrealEditor!FEngineLoop::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5367] UnrealEditor!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:202] UnrealEditor!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:107] UnrealEditor!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:244] UnrealEditor!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:282] UnrealEditor!__scrt_common_main_seh() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288] kernel32 ntdll ```

Log 내역 일부

[2023.01.23-13.35.40:816][254]LogEquipment: EquipmentComponent::MoveEquipmentToSlot > BP_Equipment_C_0 is attached to WeaponSocket_Primary
[2023.01.23-13.35.40:816][254]LogEquipment: EquipmentComponent::MoveEquipmentToSlot > BP_Equipment_C_1 is attached to WeaponSocket_Secondary
[2023.01.23-13.35.40:991][275]LogEquipment: Error: UEquipmentComponent::SelectEquipment() Executed, MainState_0
[2023.01.23-13.35.40:991][275]LogEquipment: Error: UEquipmentState::SwapToSelectedEquipment() Executed
[2023.01.23-13.35.40:991][275]LogEquipment: Error: UMainState::SwapToMainEquipment() Executed
[2023.01.23-13.35.40:991][275]LogEquipment: EquipmentComponent::MoveEquipmentToSlot > BP_Equipment_C_0 is attached to WeaponSocket_Secondary
[2023.01.23-13.35.40:991][275]LogEquipment: EquipmentComponent::MoveEquipmentToSlot > BP_Equipment_C_1 is attached to WeaponSocket_Primary
[2023.01.23-13.35.41:124][291]LogEquipment: Error: UEquipmentComponent::SelectEquipment() Executed, MainState_0
[2023.01.23-13.35.41:124][291]LogEquipment: Error: UEquipmentState::SwapToSelectedEquipment() Executed
[2023.01.23-13.35.41:124][291]LogEquipment: Error: UMainState::SwapToMainEquipment() Executed
[2023.01.23-13.35.41:124][291]LogEquipment: EquipmentComponent::MoveEquipmentToSlot > BP_Equipment_C_0 is attached to WeaponSocket_Primary
[2023.01.23-13.35.41:124][291]LogEquipment: EquipmentComponent::MoveEquipmentToSlot > BP_Equipment_C_1 is attached to WeaponSocket_Secondary
[2023.01.23-13.35.41:316][314]LogEquipment: Error: UEquipmentComponent::SelectEquipment() Executed, None
[2023.01.23-13.35.41:316][314]LogEquipment: Error: UEquipmentState::SwapToSelectedEquipment() Executed
[2023.01.23-13.35.41:316][314]LogEquipment: Error: UMainState::SwapToMainEquipment() Executed
[2023.01.23-13.35.41:316][314]LogEquipment: EquipmentComponent::MoveEquipmentToSlot > BP_Equipment_C_0 is attached to WeaponSocket_Secondary
[2023.01.23-13.35.41:316][314]LogEquipment: EquipmentComponent::MoveEquipmentToSlot > BP_Equipment_C_1 is attached to WeaponSocket_Primary

추정 원인

참고 링크

Eu4ng commented 1 year ago

해결 방안

UPROPERTY() 매크로를 설정해주어야 GC 당하지 않는다

UPROPERTY()
UEquipmentState* EquipmentState;
UPROPERTY()
UMainState* MainState;
UPROPERTY()
USubState* SubState;

언리얼 엔진 5.1 문서 오브젝트 # 레퍼런스자동업데이트

  • AActor 또는 UActorComponent가 소멸되면 레퍼런스는 자동으로 null이 됩니다.
  • 이 기능은 UPROPERTY로 마킹되어 있거나 언리얼 엔진 컨테이너 클래스에 저장된 레퍼런스에만 적용됩니다. raw 포인터에 저장된 오브젝트 레퍼런스는 언리얼 엔진이 알지 못하기 때문에, 자동으로 null 되거나, 가비지 컬렉션이 방지되지 않습니다.