Constantly Crashing on opening the editor

Hi There, I have had a project get corrupted with a crash on launch that has left it totally unusable.

This is what the crash window displays:

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000bb0

UE4Editor_Engine
UE4Editor_GameDevelopment_0003!UNewSceneComponent_NPCBehaviour::HelloWorld() [D:\Unreal Projects\GameDevelopment\Source\GameDevelopment\NewSceneComponent_NPCBehaviour.cpp:42]
UE4Editor_GameDevelopment_0003!UNewSceneComponent_NPCBehaviour::UNewSceneComponent_NPCBehaviour() [D:\Unreal Projects\GameDevelopment\Source\GameDevelopment\NewSceneComponent_NPCBehaviour.cpp:15]
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_Core
UE4Editor_Core
UE4Editor_Projects
UE4Editor_Projects
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll

The code looks really innocent, but even after changing, then removing it, it continues to crash. It may be related to another error I have seen when I was changing an object type, and was 2/3 of the way through updating the object references when I hit compile (out of habit).

Things I have tried:

  1. Deleting the DerivedDataCache folder
  2. Updating to UE5 (just processed for an hour then immediately crashed on startup anyways)
  3. Editing the files (did nothing)
  4. Removing the files entirely (still nothing).

Obviously the file changes are not getting registered so is there a way to force a fresh import (or whatever the language would be) so I don’t have to just lose this project?

Related posts here: Related Thread 1 seems to suggest it is unresolved as their solution doesn’t work in this case.

Sorry if this is a noob question or something obvious, I am new to UE.

This is the cpp file in question:

> 
> #include "NewSceneComponent_NPCBehaviour.h"
> 
> UNewSceneComponent_NPCBehaviour::UNewSceneComponent_NPCBehaviour()
> {
> 	PrimaryComponentTick.bCanEverTick = true;
> 	TestVar = 42;// initializing a var
> 	HelloWorld();
> }
> 
> // Called when the game starts
> void UNewSceneComponent_NPCBehaviour::BeginPlay()
> {
> 	Super::BeginPlay();
> }
> 
> 
> // Called every frame
> void UNewSceneComponent_NPCBehaviour::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
> {
> 	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
> }
> 
> void UNewSceneComponent_NPCBehaviour::HelloWorld()
> {
> 	UE_LOG(LogTemp, Warning, TEXT("I just started running"));
> 	GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Screen Message"));
> }


Also, this blockquote is not supposed to extend over the end of the text, is this a bug or am I using the forum wrong too? :laughing:

Think your problem is a nullptr. Don’t see that in that you shared.

Dis you try deleting the Binaries folder Then opening up the engine?

1 Like

Is GEngine available during CDO construction? Try:

check(GEngine)

before calling GEngine->

Or try commenting out the GEngine line altogether and see if the “I just started running” shows up in Log and doesn’t crash.

or try moving HelloWorld() to BeginPlay() and see if that still crashes.

This worked, thanks!

1 Like

Thanks for the response, I had tried that, I needed to rebuild the binaries this time, editing the script wasn’t enough.