Jump to content
  • 0
devilake

open DB Core Crash SIGSEGV

Question

Ok, so my DB core crashes randomly and this is the bt

 

#0  0x2851871b in strncmp () from /usr/lib32/libc.so.7
No symbol table info available.
#1  0x2851774b in strncmpeq (nameValue=0x305c305c <error: Cannot access memory at address 0x305c305c>, name=<optimized out>, nameLen=<optimized out>) at /usr/src/lib/libc/stdlib/getenv.c:144
No locals.
#2  __findenv_environ (name=<optimized out>, nameLen=<optimized out>) at /usr/src/lib/libc/stdlib/getenv.c:195
        envNdx = <optimized out>
#3  getenv (name=0x28533060 "TZ") at /usr/src/lib/libc/stdlib/getenv.c:441
        nameLen = <optimized out>
        envNdx = <optimized out>
#4  0x28500623 in tzset_basic (rdlocked=676540512) at /usr/src/contrib/tzcode/stdtime/localtime.c:1271
        name = <optimized out>
#5  0x28500877 in localtime (timep=0xffffc698) at /usr/src/contrib/tzcode/stdtime/localtime.c:1455
        p_tm = 0x288441b0
#6  0x0809c751 in sys_log (bit=0, format=0x80dbf8c "SIGNAL: SIGSEGV") at log.c:199
        ct = 1585165952
        time_s = <optimized out>
        args = <optimized out>
#7  0x0804f7a9 in emergency_sig (sig=11) at Main.cpp:60
No locals.
#8  0x283d40b9 in handle_signal (actp=<optimized out>, sig=<optimized out>, info=0xffffcd00, ucp=0xffffca40) at /usr/src/lib/libthr/thread/thr_sig.c:246
        curthread = 0x28814000
        in_sigsuspend = <optimized out>
        cancel_async = <optimized out>
        cancel_enable = <optimized out>
        cancel_point = <optimized out>
        sigfunc = 0x305c305c
        err = <optimized out>
        uc2 = <optimized out>
#9  0x283d35f2 in thr_sighandler (sig=11, info=0xffffcd00, _ucp=0xffffca40) at /usr/src/lib/libthr/thread/thr_sig.c:189
        ucp = 0xffffca40
        err = <optimized out>
        curthread = 0x28814000
        usa = <optimized out>
        act = <optimized out>
#10 <signal handler called>

I have no idea about what could cause this Segmentation Fault.

It happens since the server went live ( ~ a month ago ). I cannot replicate it on my test server though ( it stays online 24/24, no crashes yet ).

I've wrapped every single query into smart pointers and i am still getting this same exact bt.

I did alot of research into this but i can't find anything relevant or helpful.

If anyone has ANY hint, tip, idea about what could cause this, please let me know. 

Share this post


Link to post

3 answers to this question

Recommended Posts

  • 0

__QUERY_PLAYER_DELETE

or maybe you're using monarch.

Share this post


Link to post
  • 0
44 minutes ago, WeedHex said:

__QUERY_PLAYER_DELETE

or maybe you're using monarch.

 

 

ClientManager.cpp 

 

case HEADER_GD_PLAYER_DELETE:
                sys_log(1, "HEADER_GD_PLAYER_DELETE (handle: %d length: %d)", dwHandle, dwLength);
                __QUERY_PLAYER_DELETE(peer, dwHandle, (TPlayerDeletePacket *) data);
                break;

 

ClientManagerPlayer.cpp

void CClientManager::__QUERY_PLAYER_DELETE(CPeer* peer, DWORD dwHandle, TPlayerDeletePacket* packet)
{
    if (!packet->login[0] || !packet->player_id || packet->account_index >= PLAYER_PER_ACCOUNT)
        return;

    CLoginData * ld = GetLoginDataByLogin(packet->login);

    if (!ld)
    {
        peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
        peer->EncodeBYTE(packet->account_index);
        return;
    }

    TAccountTable & r = ld->GetAccountRef();

    // block for japan 
    if (g_stLocale != "sjis")
    {
        if (!IsChinaEventServer())
        {
            //if (strlen(r.social_id) < 7 || strncmp(packet->private_code, r.social_id + strlen(r.social_id) - 7, 7))
            if (strlen(r.social_id) != 7 || strcmp(packet->private_code, r.social_id))
            {
                sys_log(0, "PLAYER_DELETE FAILED len(%d) %s %s", strlen(r.social_id), packet->private_code, r.social_id);
                peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
                peer->EncodeBYTE(packet->account_index);
                return;
            }

            CPlayerTableCache * pkPlayerCache = GetPlayerCache(packet->player_id);
            if (pkPlayerCache)
            {
                TPlayerTable * pTab = pkPlayerCache->Get();

                if (pTab->level >= m_iPlayerDeleteLevelLimit)
                {
#ifdef ENABLE_MAXIMUM_LEVEL_2147483647
                    sys_log(0, "PLAYER_DELETE FAILED LEVEL %d >= DELETE LIMIT %d", pTab->level, m_iPlayerDeleteLevelLimit);
#else
                    sys_log(0, "PLAYER_DELETE FAILED LEVEL %u >= DELETE LIMIT %d", pTab->level, m_iPlayerDeleteLevelLimit);
#endif
                    peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
                    peer->EncodeBYTE(packet->account_index);
                    return;
                }

                if (pTab->level < m_iPlayerDeleteLevelLimitLower)
                {
                    sys_log(0, "PLAYER_DELETE FAILED LEVEL %u < DELETE LIMIT %d", pTab->level, m_iPlayerDeleteLevelLimitLower);
                    peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
                    peer->EncodeBYTE(packet->account_index);
                    return;
                }
            }
        }
    }

 

Im not using Monarch. Thanks for help btw.

Share this post


Link to post
  • 0
Posted (edited)
Quote

if (strlen(r.social_id) < 7 || strncmp(packet->private_code, r.social_id + strlen(r.social_id) - 7, 7))

 

ENABLE_MAXIMUM_LEVEL_2147483647 

Wtf?

Edited by WeedHex (see edit history)
  • Haha 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.