Jump to content

[DB] Db crashing error


Recommended Posts

Hello guys,

 

I have a problem in my server, my db is crashing a lot and i cant figure it out why is this happening. if someone can help, send me message please.

My discord: Sunset#9839

 

my syserr before crash:

SYSERR: Nov  1 13:28:41 :: ProcessPackets: Unknown header (header: 8 handle: 520093696 length: 0)
SYSERR: Nov  1 13:28:41 :: ProcessPackets: Unknown header (header: 8 handle: 520093696 length: 0)
SYSERR: Nov  1 13:28:41 :: ProcessPackets: Unknown header (header: 8 handle: 520093696 length: 0)
SYSERR: Nov  1 13:28:41 :: ProcessPackets: Unknown header (header: 8 handle: 520093696 length: 0)
SYSERR: Nov  1 13:28:41 :: ProcessPackets: Unknown header (header: 8 handle: 520093696 length: 0)
SYSERR: Nov  1 13:28:41 :: ProcessPackets: Unknown header (header: 8 handle: 520093696 length: 0)
SYSERR: Nov  1 13:28:41 :: ProcessPackets: Unknown header (header: 8 handle: -16777216 length: 0)
SYSERR: Nov  1 13:28:42 :: ProcessPackets: Unknown header (header: 68 handle: 503316480 length: 0)
SYSERR: Nov  1 13:28:42 :: ProcessPackets: Unknown header (header: 68 handle: 503316480 length: 0)
SYSERR: Nov  1 13:28:42 :: ProcessPackets: Unknown header (header: 68 handle: 503316480 length: 0)
SYSERR: Nov  1 13:28:42 :: ProcessPackets: Unknown header (header: 68 handle: -16777216 length: 0)
SYSERR: Nov  1 13:41:59 :: hupsig: SIGHUP, SIGINT, SIGTERM signal has been received. shutting down.

 

The headers that come in syserr: 

HEADER_CG_SYNC_POSITION = 8,

HEADER_CG_UNUSED = 68,

 

my gdb from db.core:
#0  0x207affbb in thr_kill () from /usr/lib32/libc.so.7
#1  0x207ae1c1 in raise () from /usr/lib32/libc.so.7
#2  0x2071f0d3 in abort () from /usr/lib32/libc.so.7
#3  0x0041a657 in emergency_sig (sig=11) at Main.cpp:66
#4  0x20619458 in ?? () from /usr/lib32/libthr.so.3
#5  0x2061888b in ?? () from /usr/lib32/libthr.so.3
#6  <signal handler called>
#7  cache<SPlayerItem>::CheckFlushTimeout (this=0x50536c20)
    at ./../../common/cache.h:34
#8  CClientManager::UpdateItemCache (this=0xffffdc18) at ClientManager.cpp:1822
#9  0x004203b3 in CClientManager::Process (this=0xffffdc18)
    at ClientManager.cpp:3198
#10 0x0041f97c in CClientManager::MainLoop (this=0xffffdc18)
    at ClientManager.cpp:296
#11 0x0041a794 in main () at Main.cpp:106

 

Edited by Xaroca
Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Bronze

Are you sure your db port is in written in firewall and can be accesed by localhost only  ?

Those headers you wroted does not exist in game->db connection so my guess is that somebody is sending random packets in your db.

 

There is a fix in source code (CPeerBase::Accept) for the problem above but I recommend to add that port in firewall too.

Link to comment
Share on other sites

1 minute ago, Johnny69 said:

Are you sure your db port is in written in firewall and can be accesed by localhost only  ?

Those headers you wroted does not exist in game->db connection so my guess is that somebody is sending random packets in your db.

 

There is a fix in source code (CPeerBase::Accept) for the problem above but I recommend to add that port in firewall too.

Yes i have written in firewall this port, dont know why is this happening. 

Link to comment
Share on other sites

  • Developer

Here is wher your db is crashing:

 

  

void CClientManager::UpdateItemCache()
{
	if (m_iCacheFlushCount >= m_iCacheFlushCountLimit)
		return;

	TItemCacheMap::iterator it = m_map_itemCache.begin();

	while (it != m_map_itemCache.end())
	{
		CItemCache * c = (it++)->second;

		
		if (c->CheckFlushTimeout()) // Boom right here
		{
			if (g_test_server)
				sys_log(0, "UpdateItemCache ==> Flush() vnum %d id owner %d", c->Get()->vnum, c->Get()->id, c->Get()->owner);

			c->Flush();

			if (++m_iCacheFlushCount >= m_iCacheFlushCountLimit)
				break;
		}
	}
}

 

 

It make me think you are getting dangling pointers in your cache map.
It's impossible to me to give you an exact cause of why your cache looks corrupted.

You can read more about dangling pointers here.

 

 

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

10 hours ago, Ikarus_ said:

Here is wher your db is crashing:

 

  


void CClientManager::UpdateItemCache()
{
	if (m_iCacheFlushCount >= m_iCacheFlushCountLimit)
		return;

	TItemCacheMap::iterator it = m_map_itemCache.begin();

	while (it != m_map_itemCache.end())
	{
		CItemCache * c = (it++)->second;

		
		if (c->CheckFlushTimeout()) // Boom right here
		{
			if (g_test_server)
				sys_log(0, "UpdateItemCache ==> Flush() vnum %d id owner %d", c->Get()->vnum, c->Get()->id, c->Get()->owner);

			c->Flush();

			if (++m_iCacheFlushCount >= m_iCacheFlushCountLimit)
				break;
		}
	}
}

 

 

It make me think you are getting dangling pointers in your cache map.
It's impossible to me to give you an exact cause of why your cache looks corrupted.

You can read more about dangling pointers here.

 

 

You know how can i solve this problem? 

Link to comment
Share on other sites

  • Developer
19 hours ago, Ikarus_ said:

It's impossible to me to give you an exact cause of why your cache looks corrupted.

You can read more about dangling pointers here.

 

I ve already said that we don't have enoght information to know where the problem is.

I guess you might check all the parts where the m_map_itemCache is used and try to debug your code by adding sys_log and analyze what the code do.

Edited by Ikarus_

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.