Unusual Exception_Access_Violation - Unreal Engine 4.24.2 (Launcher)

Just had a weird Crash, but not sure what to make of it. As an initial clarifier, this was originally written for 4.23. Nevertheless, I have already done the upgrades for 4.24. Without saying, the Plugin Compiles without issues and was working previously.

The Error stack is as follows:

In terms of what’s related to my doings, the stack is:

Checking them in order from top to bottom, this is the code in each section:

CharacterFirstPersonActor:


void ACMCharacterFirstPersonActor::PossessedBy(AController* NewController)
{
    Super::PossessedBy(NewController);
    if (!HasAuthority()) return; //LINE 28
    OscillatingComp->RegisterLayer();
}

CharacterBaseActor:



void ACMCharacterBaseActor::PossessedBy(AController* NewController)
{
    Super::PossessedBy(NewController);
    InteractionComp->SetNewCustomOwner(this, true, NewController); //LINE 94
}

And Finally, AdminComp at 639


void UCMAdminComp::SetNewCustomOwner(AActor* Input, bool CustomController, AController* Control)
{
    EWorldReplication Temp = CanRun(); //LINE 638
    if (Temp == EWorldReplication::ReplicatedRun)
    {
        SetNewCustomOwner_MC(Input, CustomController, Control);
    }
    else if (Temp == EWorldReplication::UnReplicatedRun)
    {
        SetNewCustomOwner_NR(Input, CustomController, Control);
    }
    else if (Temp == EWorldReplication::AutonomousProxyRun)
    {
        SetNewCustomOwner_S(Input, CustomController, Control);
    }
}

Likewise, AdminComp at 373



EWorldReplication UCMAdminComp::CanRun()
{
    return NetworkBasics.CanRun(GetOwner(), GetIsReplicated()); //Line373
}

For those curious, here is the Function from NetworkBasics; Simply an enumerator switch



    bool IsMultiplayer()
    {
        return ServerType != ENetworkServerType::LocalPlay;
    }
    bool IsDedicated()
    {
        return ServerType == ENetworkServerType::DedicatedServer;
    }

    void SetModel(ENetworkServerType Model)
    {
        ServerType = Model;
    }
    EWorldReplication CanRun(AActor* Context, bool NaturalReplicates)
    {
        if (!Context) return EWorldReplication::None;
        if (NaturalReplicates)
        {
            if (!IsMultiplayer()) return EWorldReplication::UnReplicatedRun;
            if (Context->GetLocalRole() == ENetRole::ROLE_AutonomousProxy) return EWorldReplication::AutonomousProxyRun;
            else if (IsDedicated()) return UKismetSystemLibrary::IsDedicatedServer(Context) ? EWorldReplication::ReplicatedRun : EWorldReplication::None; //OwnerActor &&
            return UKismetSystemLibrary::IsServer(Context) ? EWorldReplication::ReplicatedRun : EWorldReplication::None;
        }
        else if (!IsMultiplayer()) return EWorldReplication::UnReplicatedRun;
        //TODO Have to add a Handle for Multiplayer and !Replicates
        return EWorldReplication::None;
    }

I checked the Functions from AActor and UActorComponent that I’m using, and all of them are within allowed Scope. Any Clues/Cues?

Thanks!

In case you’re curious about NetworkBasics, this is the declaration of the Ustruct



//Regular Network-based Data
USTRUCT(BlueprintType) struct FNetBasics //Declaration. 
{
    GENERATED_BODY()

    //If this is true, the implementing system (if Not World Manager) will broadcast to the World Manager in request for the selected Model
    //If you do not want to follow replication models, Set IsStandardReplicationModel to False -> in this case, the system will follow whatever the system sets (usually by default)
    //Will only do so if the implementing system replicates
    UPROPERTY(NotReplicated, EditAnywhere, BlueprintReadOnly, Category = "Data")
    bool IsStandardReplicationModel = true;
    //Multiplayer Handle #Crucial for Determining Authority
    //LocalPlay = Offline, ListenServer = Lan, DedicatedServer = True Multiplayer
    //By Default, this value should be set by manually broadcasting it to all Clients (NR)
    UPROPERTY(NotReplicated, EditAnywhere, BlueprintReadOnly, Category = "Data")
    ENetworkServerType ServerType = ENetworkServerType::ListenServer;
    FNetBasics() {}
    explicit FNetBasics(ENetworkServerType ServerType): ServerType(ServerType) {}
    bool IsStandardReplication()
    {
        return IsStandardReplicationModel;
    }
    bool IsMultiplayer()
    {
        return ServerType != ENetworkServerType::LocalPlay;
    }
    bool IsDedicated()
    {
        return ServerType == ENetworkServerType::DedicatedServer;
    }

    void SetModel(ENetworkServerType Model)
    {
        ServerType = Model;
    }
    EWorldReplication CanRun(AActor* Context, bool NaturalReplicates)
    {
        if (!Context) return EWorldReplication::None;
        if (NaturalReplicates)
        {
            if (!IsMultiplayer()) return EWorldReplication::UnReplicatedRun;
            if (Context->GetLocalRole() == ENetRole::ROLE_AutonomousProxy) return EWorldReplication::AutonomousProxyRun;
            else if (IsDedicated()) return UKismetSystemLibrary::IsDedicatedServer(Context) ? EWorldReplication::ReplicatedRun : EWorldReplication::None; //OwnerActor && 
            return UKismetSystemLibrary::IsServer(Context) ? EWorldReplication::ReplicatedRun : EWorldReplication::None;
        } 
        else if (!IsMultiplayer() || Context->HasAuthority()) return EWorldReplication::UnReplicatedRun;
        //TODO Have to add a Handle for Multiplayer and !Replicates 
        return EWorldReplication::None;
    }
    bool IsServer(AActor* Context, bool NaturalReplicates)
    {
        EWorldReplication Temp = CanRun(Context, NaturalReplicates);
        return (Temp == EWorldReplication::ReplicatedRun) || (Temp == EWorldReplication::UnReplicatedRun);
    }
};

And its Declaration as a property inside CMAdminComp


    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Admin - Admin")
    FNetBasics NetworkBasics = FNetBasics(ENetworkServerType::LocalPlay);

I’ve sort of narrowed it down. The access violation seems to be on any function that tries to run the UCMAdminComp::CanRun() even though it is sent to public. It doesn’t matter what is inside the function; the moment that it’s called, it crashes. I tried renaming the function as you can see here (in the text above it is simply CanRun():wink:



    //Not Replicated. This determines General Authority for ActionExecution
    UFUNCTION(BlueprintPure, Category = "TTW Framework | Components | Admin | Base", meta = (BlueprintThreadSafe))
    EWorldReplication Replication_CanRun();

Really unsure what’s going on / what to do. Any advice?

Funnily enough, the issue was inside Unreal itself. Recreated the Blueprint Actor Classes. The Crash is gone. For crying out loud, Unreal. :’(