Jump to content
×
×
  • Create New...
  • 0

core crash debug


Firecracker

Question

Hi devs, one of my game's core crashed an hour ago. This is core debug bt. Do you have any idea what is the problem?

 

#0  0x288f68d7 in thr_kill () from /usr/lib32/libc.so.7
#1  0x288f68ca in raise () from /usr/lib32/libc.so.7
#2  0x288f6816 in abort () from /usr/lib32/libc.so.7
#3  0x2874f595 in __gnu_cxx::__verbose_terminate_handler ()
    at ../../.././../gcc-4.8-20131212/libstdc++-v3/libsupc++/vterminate.cc:95
#4  0x2874c295 in __cxxabiv1::__terminate (
    handler=0x2874f400 <__gnu_cxx::__verbose_terminate_handler()>)
    at ../../.././../gcc-4.8-20131212/libstdc++-v3/libsupc++/eh_terminate.cc:38
#5  0x2874c2ef in std::terminate ()
    at ../../.././../gcc-4.8-20131212/libstdc++-v3/libsupc++/eh_terminate.cc:48
#6  0x2874c54e in __cxxabiv1::__cxa_throw (obj=0x6cc600a0, tinfo=
    0x86b7460 <typeinfo for std::bad_alloc@@GLIBCXX_3.4>,
    dest=0x804ddf0 <std::bad_alloc::~bad_alloc()@plt>)
    at ../../.././../gcc-4.8-20131212/libstdc++-v3/libsupc++/eh_throw.cc:84
#7  0x2874dafe in operator new ([email protected]=12120)
    at ../../.././../gcc-4.8-20131212/libstdc++-v3/libsupc++/new_op.cc:56
#8  0x080af313 in CHARACTER_MANAGER::CreateCharacter (this=0xffffbe58,
    [email protected]=0x2a3e6b9d "G\374\347l\374 Yabani Deli",
    [email protected]=0) at char_manager.cpp:84
#9  0x080afda9 in CHARACTER_MANAGER::SpawnMob ([email protected]=0xffffbe58,
    [email protected]=552, [email protected]=43, [email protected]=898133,
    y=289388, [email protected]=0, [email protected]=false,
    [email protected]=-1, [email protected]=true) at char_manager.cpp:419
---Type <return> to continue, or q <return> to quit---
#10 0x080b01ca in CHARACTER_MANAGER::SpawnMobRange ([email protected]=0xffffbe58, dwVnum=552, [email protected]=43, [email protected]=896800, [email protected]=288100,
    [email protected]=898800, [email protected]=290100, [email protected]=true, bSpawnMotion=<optimized out>, [email protected]=false,
    [email protected]=false) at char_manager.cpp:470
#11 0x080b067d in CHARACTER_MANAGER::SpawnGroup ([email protected]=0xffffbe58, dwVnum=552, [email protected]=43, [email protected]=896800, [email protected]=288100,
    [email protected]=898800, [email protected]=290100, [email protected]=0x3acb3480, [email protected]=false, [email protected]=0x0)
    at char_manager.cpp:600
#12 0x080b08f3 in CHARACTER_MANAGER::SpawnGroupGroup (this=0xffffbe58, dwVnum=204, lMapIndex=43, sx=896800, sy=288100, ex=898800, ey=290100, pkRegen=0x3acb3480,
    [email protected]=false, [email protected]=0x0) at char_manager.cpp:561
#13 0x081b0937 in regen_spawn ([email protected]=0x3acb3480, [email protected]=false) at regen.cpp:385
#14 0x081b09e2 in regen_event (event=..., processing_time=1000) at regen.cpp:616
#15 0x0810829d in event_process ([email protected]=3684235) at event.cpp:140
#16 0x08210fde in heartbeat (ht=0x2913e550, [email protected]=3684235) at main.cpp:251
#17 0x082120aa in idle () at main.cpp:972
#18 0x08054b9d in main (argc=1, argv=0xffffdc28) at main.cpp:640

 

Link to comment

Recommended Posts

  • 0

in char_manager.cpp 84 

LPCHARACTER ch = M2_NEW CHARACTER;

in char_manager.cpp 419

LPCHARACTER ch = CHARACTER_MANAGER::instance().CreateCharacter(pkMob->m_table.szLocaleName);

in char_manager.cpp 470

LPCHARACTER ch = SpawnMob(dwVnum, lMapIndex, x, y, 0, bSpawnMotion);

in char_manager.cpp 600

LPCHARACTER tch = SpawnMobRange(c_rdwMembers, lMapIndex, sx, sy, ex, ey, true, bSpawnedByStone);

in char_state.cpp 449

CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);

in char.cpp 4455

Update();

in char_manager.cpp 699

for_each(v.begin(), v.end(), bind2nd(mem_fun(&CHARACTER::UpdateStateMachine), iPulse));

 

Pls help me. It is random crash. I dont know what causes this.

 

Link to comment
  • 0
2 minutes ago, Root said:

I dont know about ur serverfiles but that mysql usage is very bad.

Try add more ram.Clear logs.

look mine : 

  Hide contents

3f550b028a904b688b1d542de389b214.png

 

I know. But i dont know what uses mysql. My server files contains scirred offline shop and official pet system and they rape mysql i think. All log tables disabled already.

Link to comment
  • 0
Spoiler
2 minutes ago, Firecracker said:

I know. But i dont know what uses mysql. My server files contains scirred offline shop and official pet system and they rape mysql i think. All log tables disabled already.

 

I dont know if cluster will help.But maybe are to many calls to the same table.Spliting DB will help but i never did that.

Check this topic :

Spoiler

 

 

  • Love 2
Link to comment
  • 0
12 hours ago, arves100 said:

Check the log of mysql, maybie they say who's accessing mysql.

i activated general_log and slow_query_log but there is nothing.

when i check on my test server i realized that i warp any map and mysql usage goes up to %4 usage. And after 10 seconds it goes down to 0.

edit: when i activated mysql logs, there is not general_log table. i created manually.

Link to comment
  • 0

1 hour ago, Istny said:

add

log-queries-not-using-indexes

to my.cnf
and run mysqltuner on server

thanks for reply. i dont need mysql log anymore because i found what causes high usage of mysql. 

i used this query when i warp and when i close shop.

select * from INFORMATION_SCHEMA.PROCESSLIST where db = 'player'

i found that when i warp and when i close my shop there is a control on mysql and it causes high mysql usage.

now i have to modify this code. thanks all for your help up to here. any idea how i modify this code?

this code is:

void CHARACTER::RefreshGift()
{
	char szSockets[1024] = { '\0' };
	char *tempSockets = szSockets;
	for (int i = 0; i < ITEM_SOCKET_MAX_NUM; i++)
	{
		tempSockets += sprintf(tempSockets, "socket%d", i);

		if (i<ITEM_SOCKET_MAX_NUM - 1)
			tempSockets += sprintf(tempSockets, ",");
	}
	char szAttrs[1024] = { '\0' };
	char *tempAttrs = szAttrs;
	for (int i = 0; i < ITEM_ATTRIBUTE_MAX_NUM; i++)
	{
		if (i < 7)
			tempAttrs += sprintf(tempAttrs, "attrtype%d,attrvalue%d", i, i);
		else
			tempAttrs += sprintf(tempAttrs, "applytype%d,applyvalue%d", i - 7, i - 7);
		if (i<ITEM_ATTRIBUTE_MAX_NUM - 1)
			tempAttrs += sprintf(tempAttrs, ",");
	}
#ifdef __CHANGE_LOOK_SYSTEM__
	SQLMsg * pkMsg(DBManager::instance().DirectQuery("SELECT id,vnum,count,unix_timestamp(date_add),replace(reason,' ','_'),replace(`from`,' ','_'),%s,%s,dwLookVnum from player_gift where  owner_id = %d and status = 'WAIT' ORDER BY date_add ", szSockets, szAttrs, GetPlayerID()));
#else
	SQLMsg * pkMsg(DBManager::instance().DirectQuery("SELECT id,vnum,count,unix_timestamp(date_add),replace(reason,' ','_'),replace(`from`,' ','_'),%s,%s from player_gift where  owner_id = %d and status = 'WAIT' ORDER BY date_add ", szSockets, szAttrs, GetPlayerID()));
#endif
    SQLResult * pRes = pkMsg->Get();
	m_mapGiftGrid.clear();
	grid = M2_NEW CGrid(15, 8);
	grid->Clear();
	int page = 1;
	if (pRes->uiNumRows>0)
	{
		AddGiftGrid(page);
		MYSQL_ROW row;
		while ((row = mysql_fetch_row(pRes->pSQLResult)) != NULL)
		{
			int col = 0;
			TGiftItem item;
			memset(&item, 0, sizeof(item));
			str_to_number(item.id, row[col++]);
			str_to_number(item.vnum, row[col++]);
			str_to_number(item.count, row[col++]);
			str_to_number(item.dwDateAdd, row[col++]);
			strlcpy(item.szReason, row[col++], sizeof(item.szReason) - 1);
			strlcpy(item.szFrom, row[col++], sizeof(item.szFrom) - 1);
			for (int i = 0; i < ITEM_SOCKET_MAX_NUM; i++)
				str_to_number(item.alSockets[i], row[col++]);
			for (int i = 0; i < ITEM_ATTRIBUTE_MAX_NUM; i++)
			{
				str_to_number(item.aAttr[i].bType, row[col++]);
				str_to_number(item.aAttr[i].sValue, row[col++]);
			}
#ifdef __CHANGE_LOOK_SYSTEM__
			str_to_number(item.dwLookVnum, row[col++]);
#endif

			const TItemTable * item_table = ITEM_MANAGER::instance().GetTable(item.vnum);
			if (!item_table)
				continue;
			int iPos = AddGiftGridItem( page, item_table->bSize);
			if (iPos < 0)
			{
				page++;
				grid->Clear();
				iPos = AddGiftGridItem(page, item_table->bSize);
				if (iPos < 0)
				{
					sys_err("iPos <0");
					break;
				}
			}
			item.pos = iPos;
			m_mapGiftGrid[page].push_back(item);

		}
		M2_DELETE(grid);
	}
	if(GetGiftPages()>0)
		ChatPacket(CHAT_TYPE_COMMAND, "gift_info %d", GetGiftPages());
}
#endif

 

  • Love 1
Link to comment
  • 0

i dont know why the code which is above causes %4 mysql usage for every player. How this query cause? The website also has sorting query but it doesn't increase mysql usage for example. Do you have any idea?

Edit: I think i solved problem. Thanks all for your help. I just added indexes my player_gift table with following code. Now mysql usage is OK.

ALTER TABLE player_gift ADD INDEX episode_active(owner_id, status);

 

Link to comment
  • 0
  • Premium

If you disabled the log tables that will cause mysql high usage. If you want to disable log table do it from source, but let the table work like : disable the change bonus on item because it loads the table a lot.

Siccred offline shop doesn't have anything releated with your 170% mysql usage.

Link to comment
  • 0
On 28.03.2017 at 4:36 PM, Dobrescu Sebastian said:

If you disabled the log tables that will cause mysql high usage. If you want to disable log table do it from source, but let the table work like : disable the change bonus on item because it loads the table a lot.

Siccred offline shop doesn't have anything releated with your 170% mysql usage.

Scirred offline shop related with high mysql usage because every warp and in every 5 minutes there is a mysql search for every players.  So i solved with adding indexes to player_gift table and mysql usage is OK now. My problem is not mysql usage my problem is core crash which tells me that bad memory alloc. Although i have enough ram my cores crash randomly in a few days. I just wanted to learn that if someone faced a problem like this. It can be because of adding a system like transmutaion, new pets or just because of freebsd 10.3. I already disabled log tables from source.

Link to comment
  • 0
On 31.03.2017 at 11:30 AM, Dobrescu Sebastian said:

Your main problem of getting crash is that mysql usage. Fix it.

I fixed it. Mysql usage is %3-10 now. Crash problem is still exist. I said that i fixed mysql problem many times.

Link to comment
  • 0
  • Premium

I remembered now a friend had a problem because with map index, and you have map index 660141 ? Change your map index to something like 223. That's how he solved.

I be damned if this isn't the problem.

Link to comment

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


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.