Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 35

Thread: Unidentified Server's Crash (Shutdown)

  1. #11
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    I had no downtimes until one player came... I'm not sure how, but he makes Segmentation Fault on connect.
    Code:
    8: EXE_DISCONNECTED
    Rcon from 89.36.219.214:-8170:
    say
    12: EXE_DISCONNECTED
    Client 362 connecting with 200 challenge ping from 118.107.128.42:28960
    Going from CS_FREE to CS_CONNECTED for  (num 8 guid 0)
    Segmentation fault (core dumped)
    ./cod2_lnxded_1_0: /usr/lib/i386-linux-gnu/libmysqlclient.so.18: no version information available (required by ./libcod2_1_0.so)
    > [INFO] Compiled for: CoD2 1.0
    Compiled: Jan 29 2015 02:23:00
    > [INFO] value of closer=08111d32
    > [INFO] value of download=0808e508
    > [PLUGIN LOADED]
    CoD2 MP 1.0 build linux-i386 Oct 24 2005
    ----- FS_Startup -----
    Current search path:
    /home/codserver/.callofduty2/whiskys.lair
    /home/codserver/whiskys.lair/zzz_modz.iwd (3 files)
    /home/codserver/whiskys.lair/zzz_all_rifles_v1.5.iwd (18 files)
    /home/codserver/whiskys.lair
    /home/codserver/.callofduty2/main
    /home/codserver/main/iw_14.iwd (4038 files)
    /home/codserver/main/iw_13.iwd (22624 files)
    /home/codserver/main/iw_12.iwd (1016 files)
    /home/codserver/main/iw_11.iwd (1462 files)
    /home/codserver/main/iw_10.iwd (1936 files)
    /home/codserver/main/iw_09.iwd (2142 files)
    /home/codserver/main/iw_08.iwd (2723 files)
    /home/codserver/main/iw_07.iwd (3384 files)
    /home/codserver/main/iw_06.iwd (990 files)
    /home/codserver/main/iw_05.iwd (928 files)
    /home/codserver/main/iw_04.iwd (698 files)
    /home/codserver/main/iw_03.iwd (26 files)
    /home/codserver/main/iw_02.iwd (40 files)
    /home/codserver/main/iw_01.iwd (16 files)
    /home/codserver/main/iw_00.iwd (102 files)
    /home/codserver/main
    /home/codserver/.callofduty2/raw
    /home/codserver/.callofduty2/raw_shared
    /home/codserver/.callofduty2/devraw
    /home/codserver/.callofduty2/devraw_shared
    /home/codserver/raw
    /home/codserver/raw_shared
    /home/codserver/devraw
    /home/codserver/devraw_shared
    
    File Handles:
    ----------------------
    42146 files in iwd files
    execing default_mp.cfg
    couldn't exec language.cfg
    execing config_mp_server.cfg
    dedicated is read only.
    fs_game is write protected.
    Opening IP socket: localhost:28960
    Hostname: localhost.domain
    Alias: localhost
    Alias: whiskers
    Alias: whiskers
    IP: 127.0.0.1
    IP: 89.36.219.214
    --- Common Initialization Complete ---
    net_port is write protected.
    dedicated is read only.
    fs_game is write protected.
    execing server.cfg
    net_ip is write protected.
    net_port is write protected.
    dedicated is read only.
    sv_cheats is write protected.
    map_rotate...
    
    "sv_mapRotation" is:"gametype tdm map mp_toujane gametype tdm map mp_carentan gametype tdm map mp_trainstation gametype tdm map mp_decoy gametype tdm map mp_farmhouse gametype tdm map mp_burgundy gametype tdm map mp_brecourt gametype tdm map mp_railyard gametype tdm map mp_downtown gametype tdm map mp_leningrad gametype tdm map mp_dawnville gametype tdm map mp_matmata gametype tdm map mp_breakout"
    
    "sv_mapRotationCurrent" is:""
    
    Setting g_gametype: tdm.
    Setting map: mp_toujane.
    manymaps> map=mp_toujane sv_iwdNames: 
    manymaps> link src=/home/codserver/.callofduty2/whiskys.lair/Library/mp_toujane.iwd dst=/home/codserver/.callofduty2/whiskys.lair/mp_toujane.iwd
    ------ Server Initialization ------
    Server: mp_toujane
    ----- FS_Startup -----
    Current search path:
    /home/codserver/.callofduty2/whiskys.lair
    /home/codserver/whiskys.lair/zzz_modz.iwd (3 files)
    /home/codserver/whiskys.lair/zzz_all_rifles_v1.5.iwd (18 files)
    /home/codserver/whiskys.lair
    /home/codserver/.callofduty2/main
    /home/codserver/main/iw_14.iwd (4038 files)
    /home/codserver/main/iw_13.iwd (22624 files)
    /home/codserver/main/iw_12.iwd (1016 files)
    /home/codserver/main/iw_11.iwd (1462 files)
    /home/codserver/main/iw_10.iwd (1936 files)
    /home/codserver/main/iw_09.iwd (2142 files)
    /home/codserver/main/iw_08.iwd (2723 files)
    /home/codserver/main/iw_07.iwd (3384 files)
    /home/codserver/main/iw_06.iwd (990 files)
    /home/codserver/main/iw_05.iwd (928 files)
    /home/codserver/main/iw_04.iwd (698 files)
    /home/codserver/main/iw_03.iwd (26 files)
    /home/codserver/main/iw_02.iwd (40 files)
    /home/codserver/main/iw_01.iwd (16 files)
    /home/codserver/main/iw_00.iwd (102 files)
    /home/codserver/main
    /home/codserver/.callofduty2/raw
    /home/codserver/.callofduty2/raw_shared
    /home/codserver/.callofduty2/devraw
    /home/codserver/.callofduty2/devraw_shared
    /home/codserver/raw
    /home/codserver/raw_shared
    /home/codserver/devraw
    /home/codserver/devraw_shared
    
    File Handles:
    ----------------------
    42146 files in iwd files
    ------- Game Initialization -------
    gamename: Call of Duty 2
    gamedate: Oct 24 2005
    -----------------------------------
    -----------------------------------
    Hitch warning: 2621 msec frame time
    Resolving cod2master.activision.com
    cod2master.activision.com resolved to 185.34.104.231:20710
    Sending heartbeat to cod2master.activision.com
    Resolving cod2master.activision.com
    cod2master.activision.com resolved to 185.34.104.231:20700
    Client 0 connecting with 50 challenge ping from 188.127.12.144:28960
    Going from CS_FREE to CS_CONNECTED for  (num 0 guid 735737)
    Sending heartbeat to cod2master.activision.com
    Client 1 connecting with 200 challenge ping from 118.107.128.42:28960
    Going from CS_FREE to CS_CONNECTED for  (num 1 guid 0)
    Segmentation fault (core dumped)
    In tdm.gsc
    PHP Code:
    Callback_PlayerConnect()
    {
        
    thread dummy();
        
        
    self.statusicon "hud_status_connecting";
        
    self waittill("begin");
        
    self.statusicon "";
        
    level notify("connected"self);
        
        if(!
    level.splitscreen)
            
    iprintln(&"MP_CONNECTED"self);
        
    lpselfnum self getEntityNumber();
        
    lpGuid self getGuid();
        
    logPrint("J;" lpGuid ";" lpselfnum ";" self.name "\n");
          
        
    self SearchForBan();

        if(
    game["state"] == "intermission")
        {
            
    spawnIntermission();
            return;
        } 
        
    level endon("intermission");

        if(
    level.splitscreen)
            
    scriptMainMenu game["menu_ingame_spectator"];
        else
            
    scriptMainMenu game["menu_ingame"];

        if(
    isDefined(self.pers["team"]) && self.pers["team"] != "spectator")
        {
            
    self setClientCvar("ui_allow_weaponchange""1");

            if(
    self.pers["team"] == "allies")
                
    self.sessionteam "allies";
            else
                
    self.sessionteam "axis";

            if(
    isDefined(self.pers["weapon"]))
                
    spawnPlayer();
            else
            {
                
    spawnSpectator();

                if(
    self.pers["team"] == "allies")
                {
                    
    self openMenu(game["menu_weapon_allies"]);
                    
    scriptMainMenu game["menu_weapon_allies"];
                }
                else
                {
                    
    self openMenu(game["menu_weapon_axis"]);
                    
    scriptMainMenu game["menu_weapon_axis"];
                }
            }
        }
        else
        {
            
    self setClientCvar("ui_allow_weaponchange""0");

            if(!
    isDefined(self.pers["skipserverinfo"]))
                
    self openMenu(game["menu_team"]);

            
    self.pers["team"] = "spectator";
            
    self.sessionteam "spectator";

            
    spawnSpectator();
        }

        
    self setClientCvar("g_scriptMainMenu"scriptMainMenu);

    Added functioncs
    PHP Code:
    SearchForBan()
    {
        
    myIP self getIP();
        
    maps\mp\gametypes\_mysql::asyncQuery("SELECT `ip`, `name`, `reason`, `whobanned` FROM `bans` WHERE `ip` = \"" myIP "\" LIMIT 1", ::checkBan);
    }

    checkBan(rowsargs)
    {
        
       if(
    isDefined(rows) && isDefined(rows[0]) && isDefined(rows[0]["ip"]))
       {
             
    kickmsg rows[0]["name"] + "^7, You're banned by " rows[0]["whobanned"] + "^7, because of reason: " rows[0]["reason"] + ". Check www.whiskaskitler.xyz to get unbanned :) " ". You will need your IP: " rows[0]["ip"];
          
    kick2(self getEntityNumber(), kickmsg);
       }

    Also _callbacksetup.gsc
    PHP Code:
    CodeCallback_PlayerConnect() 
    {   
        
    self endon("disconnect");  
        [[
    level.callbackPlayerConnect]]();
        
    self.pers["admin"] = 0

    Anything that could make this problem? Should I add Ip of this player to iptables to prevent new downtimes?

  2. #12
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Load the core dumb in gdb and show the trace, iirc just type "bt" for backtrace
    timescale 0.01

  3. The Following User Says Thank You to kung foo man For This Useful Post:

    Whiskas (18th March 2016)

  4. #13
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    Code:
    Program terminated with signal 11, Segmentation fault.
    #0  0xb716ab4b in mysql_options ()
       from /usr/lib/i386-linux-gnu/libmysqlclient.so.18
    (gdb) bt
    #0  0xb716ab4b in mysql_options ()
       from /usr/lib/i386-linux-gnu/libmysqlclient.so.18
    #1  0xb773ccb1 in ?? ()
    #2  0x00000000 in ?? ()
    Does Core store only new dump?

    Also providing _mysql.gsc file:
    PHP Code:
    init()
    {
        
    //get your host, user, pass, db, port here
        
    level.JH_mysql mysql_reuse_connection();
        if(!
    isDefined(level.JH_mysql))
            
    level.JH_mysql initMySQL("localhost""root""passhere""cod_db"3306);
        
    initAsyncMySQL("localhost""root""passhere""cod_db"3306);
    }

    query(query)
    {
        if(!
    isDefined(level.JH_mysql))
            return 
    undefined;
        
    result mysql_query(level.JH_mysqlquery);
        
    resettimeout();
        if(
    result)
        {
            
    printf("Error in " query "\n");
            return 
    undefined;
        }
        
    result mysql_store_result(level.JH_mysql);
        
    rows getRows(result);
        return 
    rows;
    }

    queryNosave(query)
    {
        if(!
    isDefined(level.JH_mysql))
            return 
    undefined;
        
    result mysql_query(level.JH_mysqlquery);
        
    resettimeout();
        if(
    result)
        {
            
    printf("Error in " query "\n");
            return 
    undefined;
        }
        return [];
    }

    getRows(result)
    {
        if(!
    isDefined(result))
            return [];
        
    rowcount mysql_num_rows(result);
        
    fields = [];
        
    field mysql_fetch_field(result);
        while(
    isDefined(field))
        {
            
    fields[fields.size] = field;
            
    field mysql_fetch_field(result);
        }
        
    rows = [];
        for(
    0rowcounti++)
        {
            
    row mysql_fetch_row(result);
            
    rows[rows.size] = [];
            for(
    0fields.sizej++)
                
    rows[rows.size 1][fields[j]] = row[j];
        }
        
    mysql_free_result(result);
        return 
    rows;
    }

    asyncQuery(query, function, args)
    {
        
    id mysql_async_create_Query(query);
        
    task spawnstruct();
        
    task.query query;
        
    task.invoker self;
        
    task.function = function;
        
    task.args args;
        
    level.JH_mysqlAsync["" id] = task;
    }

    asyncQueryNosave(query, function, args)
    {
        
    id mysql_async_create_Query_Nosave(query);
        
    task spawnstruct();
        
    task.query query;
        
    task.invoker self;
        
    task.function = function;
        
    task.args args;
        
    level.JH_mysqlAsync["" id] = task;
    }

    initAsyncMySQL(hostuserpassdbport)
    {
        
    mysql_async_initializer(hostuserpassdbport4);
        
    level.JH_mysqlAsync = [];
        
    thread loopAsyncMySQL();
    }

    loopAsyncMySQL()
    {
        while(
    true)
        {
            list = 
    mysql_async_GetDone_List();
            for(
    0< list.sizei++)
            {
                
    result mysql_async_getresult_and_free(list[i]);
                if(!
    isdefined(result))
                    continue;
                if(
    result == 0)
                    
    result undefined;
                
    task "" + list[i];
                if(
    isDefined(level.JH_mysqlAsync[task]))
                {
                    if(
    isDefined(level.JH_mysqlAsync[task].function))
                    {
                        if(
    isDefined(level.JH_mysqlAsync[task].invoker))
                        {
                            
    rows getRows(result);
                            
    level.JH_mysqlAsync[task].invoker thread [[level.JH_mysqlAsync[task].function]](rowslevel.JH_mysqlAsync[task].args);
                        }
                        else if(
    isDefined(result))
                            
    mysql_free_result(result);
                    }
                    else if(
    isDefined(result))
                        
    mysql_free_result(result);
                }
                else if(
    isDefined(result))
                    
    mysql_free_result(result);
                
    level.JH_mysqlAsync[task] = undefined;
            }
            
    wait .05;
        }
    }

    initMySQL(hostuserpassdbport)
    {
        
    mysql mysql_init();
        
    ret mysql_real_connect(mysqlhostuserpassdbport);
        if(!
    ret)
        {
            
    printf("errno=" mysql_errno(mysql) + " error= " mysql_error(mysql) + "\n");
            
    mysql_close(mysql);
            return 
    undefined;
        }
        return 
    mysql;
    }
    stripString(string)
    {
        if(
    isDefined(level.JH_mysql))
            return 
    mysql_real_escape_string(level.JH_mysqlstring);
        return 
    "";

    I also have to admit that this player IP is not banned (it's not in the mysql table).

    Thanks for your time!

  5. #14
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Please printf the query
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  6. The Following User Says Thank You to IzNoGoD For This Useful Post:

    Whiskas (18th March 2016)

  7. #15
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    I make my ban system, Whiskas check for all queryS if(isDefined..
    sometime player disconnect and cod2 make query for null login and server crash by error: Segmentation Fault

  8. The Following User Says Thank You to maxdamage99 For This Useful Post:

    Whiskas (18th March 2016)

  9. #16
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    printf supports more than one argument, in the form of printf("Hello %\n", "world"); and as such supports all types of secondary arguments. All % will be replaced by additional input arguments. If no arguments are given, the % will be removed. To print a % to console, use printf("this works 100%%");
    Is it what you said, IzNoGoD?:

    PHP Code:
    SearchForBan() 

        
    myIP self getIP(); 
        
    maps\mp\gametypes\_mysql::asyncQuery(printf("SELECT `ip`, `name`, `reason`, `whobanned` FROM `bans` WHERE `ip` = \"%\" LIMIT 1"myIP), ::checkBan); 

    maxdamage99
    I make my ban system, Whiskas check for all queryS if(isDefined..
    sometime player disconnect and cod2 make query for null login and server crash by error: Segmentation Fault
    You mean to check if any row from query is defined? I'm not sure what you mean.

  10. #17
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    no, do a printf("select etcetera") BEFORE you do the asyncquery line
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  11. The Following User Says Thank You to IzNoGoD For This Useful Post:

    Whiskas (18th March 2016)

  12. #18
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    PHP Code:
    SearchForBan() 

        
    myIP self getIP();
        
    printf("SELECT `ip`, `name`, `reason`, `whobanned` FROM `bans` WHERE `ip` = \"%\" LIMIT 1"myIP); 
        
    maps\mp\gametypes\_mysql::asyncQuery("SELECT `ip`, `name`, `reason`, `whobanned` FROM `bans` WHERE `ip` = \"" myIP "\" LIMIT 1", ::checkBan); 

    This? But what it's going on here?

  13. #19
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    I'm not sure your query is actually defined, if myip is undefined, the whole server might crash.

    If nothing else, it can show you the last query done before crashing

    You should also add a printf when 1) starting to parse the results of the query and 2) when you're done parsing the results of the query
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  14. The Following User Says Thank You to IzNoGoD For This Useful Post:

    Whiskas (18th March 2016)

  15. #20
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    PHP Code:
    callback_PlayerConnect()
    {
    /*....*/
        //CHECK_BAN
            
    login="";
        if(
    isDefined(self.stats["login"])) login=self.stats["login"]; //without if, sometimes server crash :(
        
    if(isBan(self getip())) 
        {
        
    ban=info_ipban(self getip());
        
    saychat(-1"^7: Player: "+self.name+" ^7banned from this server. ^5Reason^7: "+ban["reason"]+"^7; ^1ID^7: "+ban["id"]+"^4.");
        
    self setClientCvar("com_errorTitle""^7You are ^1BANNED^7!!!");
        
    self setClientCvar("com_errorMessage"self.name " \n^4|| ^7BAN ID^5: ^3"+ban["id"]+" ^4||\n^4|| ^7ADMIN^5:^7 "+ban["admin"]+" ^4||\n^4|| ^7Date (Moscow)^5:^7 "+ban["date"]+"^4 ||\n^4|| ^7Reason^5:^7 "+ban["reason"]+" ^4||\n");
        
    self closeMenu();
        
    self closeInGameMenu();
        
    msgconsole(self.name+" KICKED BY IP_BAN "+self getip()+" | "+login); //printf
        
    self exec("disconnect");
        return;
        }
        
    //CHECK_BAN
    ///////////////////////
    isBan(ip)
    {
    if(!
    isDefined(ip)) return; //if make query by argument ip (NULL) server crash
    sql "SELECT * FROM `table_bans` WHERE `ban_ip`='" ip "'";
    msgconsole(ip+" isBan(190) "+sql);
    mysql_query(level.mysqlsql);
    result mysql_store_result(level.mysql);
    if(
    mysql_num_rows(result) >= 1)
    {
    mysql_free_result(result);return 1;}
    mysql_free_result(result);
    return 
    0;
    }
    info_ipban(ip)
    {
    if(!
    isDefined(ip)) return; //if make query by argument ip (NULL) server crash
    info=[];
    info["id"]=999;
    info["admin"]="Unknown Soldier";
    info["date"]=readRealTime();
    info["reason"]="undefined";
    sql "SELECT `id`, `ban_reason`, `ban_date`, `admin_name` FROM `table_bans` WHERE `ban_ip`='" ip "'";
    msgconsole(ip+" info_ipban(207) "+sql);
    mysql_query(level.mysqlsql);
    result mysql_store_result(level.mysql);
    if(!
    isDefined(result)) {mysql_free_result(result);return info;}
    if(
    mysql_num_rows(result) != 1)
    return 
    info;
    row mysql_fetch_row(result);
    info["id"] = int(row[0]);
    info["admin"] = row[3];
    info["date"] = row[2];
    info["reason"] = row[1];
    mysql_free_result(result); 
    return 
    info;

    P.S: dont use async query, my server is lag (VDS BY OPENVZ), i change OPEVNZ on KVM, and without async server normal job (no lag, uptime > 20 days), async - server no lag, but sometime server crash!
    Last edited by maxdamage99; 18th March 2016 at 11:47.

  16. The Following User Says Thank You to maxdamage99 For This Useful Post:

    Whiskas (18th March 2016)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •