Random Server Crashes..

General Comments, Questions about all things OmnipotentS that don't go in other topics/forums
User avatar
pooty
Posts: 4496
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Random Server Crashes..

Post by pooty »

So the one crash today, end of round, I typed 'teams' during the countdown and boom. Might be coincidence but right after I hit return music stopped and it crashed. I definitely think its releated to teams/people coming going during mid rounds.
FuriousRabbit
Posts: 140
Joined: Sat Jun 04, 2022 12:28 am

Re: Random Server Crashes..

Post by FuriousRabbit »

Just make it so people aren't allowed to quit. That'll also solve the problem with not having enough players.
User avatar
Enyo
Posts: 1684
Joined: Mon Apr 05, 2021 11:27 pm
Server Sponsor: Yes
Server Admin: Yes

Re: Random Server Crashes..

Post by Enyo »

pooty wrote: Mon Jan 02, 2023 10:50 pm So the one crash today, end of round, I typed 'teams' during the countdown and boom. Might be coincidence but right after I hit return music stopped and it crashed. I definitely think its releated to teams/people coming going during mid rounds.
Crashes happen too sometimes when people join/leave between rounds. Is it maybe evenmatch that's getting tripped up by that?
“Never argue with stupid people, they will drag you down to their level and then beat you with experience.”
― Mark Twain
User avatar
pooty
Posts: 4496
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Random Server Crashes..

Post by pooty »

So last night we crashed at end of round on AJY, and someone did leave. I found this snippet as the last line of the log

Warning: UTComp_ONSGameRules ONS-ArcticJunkYard-)o(-Randomizer-V24.UTComp_ONSGameRules (Function UTCo

It cut off like that, but I noticed in that class, Two functions that maybe a place to look.
Which might be CheckScores?

Warning: UTComp_ONSGameRules ONS-AratheiaC)o(mplex-V2.UTComp_ONSGameRules (Function UTCompOmni.UTComp_ONSGameRules.CheckScore:01C7) Accessed None 'C'
Which we've seen a bunch in the logs.
Also in conjuntion with
Warning: UAMGameRules ONS-AratheiaC)o(mplex-V2.UAMGameRules (Function UAdminModV095b.UAMGameRules.PreventDeath:002F) Accessed None 'Controller'



Function NavigationPoint
which changes the playerstarts, which might be related to this warning

Warning: SpawnActor failed because class Pawn is abstract
ScriptLog: Couldn't spawn player of type UTCompOmni.UTComp_xPawn at ONS-Dria-Randomizer-V21.PlayerStart37

Although I think we figured this wasn't a cause.

But back to CheckScores code

Code: Select all

// snarf attempt to fix the after round shenanigans
function bool CheckScore(PlayerReplicationInfo Scorer)
{
    local PlayerController PC;
    local Controller C;
    local ONSOnslaughtGame ONS;
    local int deadCore;
    local bool retval;

    retval = false;
    if(NextGameRules != none)
        retval = NextGameRules.CheckScore(Scorer);

    deadCore = -1;
    ONS = ONSOnslaughtGame(Level.Game);
    if(ONS != none && ONS.PowerCores[ONS.FinalCore[0]].Health <= 0)
        deadCore = 0;
    else if(ONS != none && ONS.PowerCores[ONS.FinalCore[1]].Health <= 0)
        deadCore = 1;

        //round has ended
    if(deadCore >= 0)
    {
        for (C = Level.ControllerList; C != None; C = C.NextController)
        {
            PC = PlayerController(C);
            if (PC != None)
            {
                PC.ClientSetBehindView(true);
                PC.ClientSetViewTarget(ONS.PowerCores[ONS.FinalCore[deadCore]]);
                PC.SetViewTarget(ONS.PowerCores[ONS.FinalCore[deadCore]]);
                PC.ClientRoundEnded();

            }

            if(C != None)
                C.RoundHasEnded();
        }
    }

    return retval;
}
Only spot I can see where accessing C = None would be PC=PlayerController(C) (Player Controller being the player, but what if they leave? Note: this construct is used quite a bit in engine.gameinfo ( http://kos.informatik.uni-osnabrueck.de ... einfo.html )

So maybe we need two more checks:

Code: Select all

[b] for (C = Level.ControllerList; C != None; C = C.NextController)
        {
           if ( C != None)  // this should be unecessary based on for loop but only spot where C could be accessed and be none.
            	PC = PlayerController(C);
           
           if ((PC != None) && P.IsA('PlayerController')) // Saw that check in engine.gameinfo, is it possible for PC to be non Player and PC.ClientSet functions fail causing a crash?
            {
                PC.ClientSetBehindView(true);
                PC.ClientSetViewTarget(ONS.PowerCores[ONS.FinalCore[deadCore]]);
                PC.SetViewTarget(ONS.PowerCores[ONS.FinalCore[deadCore]]);
                PC.ClientRoundEnded();

            }

            if(C != None)
                C.RoundHasEnded();
                
        }[/b]
Snarf, what do you think?
User avatar
captainsnarf
Posts: 2685
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: Random Server Crashes..

Post by captainsnarf »

I think I need to change it to use a while loop instead of for loop.

Code: Select all

 for (C = Level.ControllerList; C != None; C = C.NextController)
 {
 }
If Level.ControllerList is None, then this for loop will cause a 'Accessed None' error when it tries to execute 'C = C.NextController'.

Code: Select all

for(expression A;expression B; expression C) { ... }
expression A is executed first. At the end of the loop, expression C is executed. Before entering the loop again, expression B is checked for true. If false the looping is over.

Level.ControllerList is a linked list. Generally you use a while loop for those.

Code: Select all

local Controller C;
C = Level.ControllerList;
while(C != None) 
{
   ... 
   C = C.NextController;
}
The for loop was copy/paste from existing engine code, so I thought it would work.

this is unnecessary

Code: Select all

if(C != None)
  PC = PlayerController(C);
It's safe to do

Code: Select all

PC = PlayerController(None);
This will result in PC = None also, not 'Accessed None' error.
Player Controller being the player, but what if they leave?
As far as I understand this is all single threaded. This function will execute in its entirety before processing any players that leave. It should be a non-issue.
User avatar
pooty
Posts: 4496
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Random Server Crashes..

Post by pooty »

As far as I understand this is all single threaded. This function will execute in its entirety before processing any players that leave. It should be a non-issue.
Should be.. but somewhere something is getting messed up.. I am fairly certain it has to do with timing of a player leaving usually right at the end of the round (before the countdown of 1...2...3).
User avatar
captainsnarf
Posts: 2685
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: Random Server Crashes..

Post by captainsnarf »

We were playing Valarna last night and a few players dropped. Enyo nope'd out between rounds and bam.. another crash. I posted a new version of UTCompOmni with that 'for' loop changed to a 'while' loop to avoid the possible None reference discussed above.
User avatar
pooty
Posts: 4496
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Random Server Crashes..

Post by pooty »

Yep saw that. I'll get the new version up. I think if it still crashes, maybe we start to focus on EvenMatch. (or UAdminMod but we don't have the source for that) - those two care about team sizes.
User avatar
captainsnarf
Posts: 2685
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: Random Server Crashes..

Post by captainsnarf »

Sadly, we are still having crashes. I checked the logs and this is the main error:

Code: Select all

Warning: Other object in slot
Warning: Other is: NewNet_AssaultGrenade ONS-Valarna-Randomizer-V7.NewNet_AssaultRifle.NewNet_AssaultGrenade385
Warning: This is: TcpipConnection Package.TcpipConnection
Critical: Assertion failed: IsValid() [File:.\UnObj.cpp] [Line: 464]
Exit: Executing UObject::StaticShutdownAfterError
The warning 'Other object in slot' comes from the IsValid() function. That is called from the destructor for the the object (line 464 of UnObj.cpp).

This is still there also.

Code: Select all

Warning: UTComp_ONSGameRules ONS-Valarna-Randomizer-V7.UTComp_ONSGameRules (Function UTCompOmni.UTComp_ONSGameRules.CheckScore:01D2) Accessed None 'C'
I don't think it's the problem though. It's definitely UTComp, but not this function.
User avatar
pooty
Posts: 4496
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Random Server Crashes..

Post by pooty »

It seems about 1 a night, 1 every other night or so. I've also noticed besides it being an end of round thing, I always seem to get much more lag just before it happens... meaning there will be a round with a bunch of lag/slowness and shortly afterwards..boom. I wonder if its a memory leak somewhere?
Post Reply