Firecracker 3 Posted February 5, 2017 Share Posted February 5, 2017 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 (sz=sz@entry=12120) at ../../.././../gcc-4.8-20131212/libstdc++-v3/libsupc++/new_op.cc:56 #8 0x080af313 in CHARACTER_MANAGER::CreateCharacter (this=0xffffbe58, name=name@entry=0x2a3e6b9d "G\374\347l\374 Yabani Deli", dwPID=dwPID@entry=0) at char_manager.cpp:84 #9 0x080afda9 in CHARACTER_MANAGER::SpawnMob (this=this@entry=0xffffbe58, dwVnum=dwVnum@entry=552, lMapIndex=lMapIndex@entry=43, x=x@entry=898133, y=289388, z=z@entry=0, bSpawnMotion=bSpawnMotion@entry=false, iRot=iRot@entry=-1, bShow=bShow@entry=true) at char_manager.cpp:419 ---Type <return> to continue, or q <return> to quit--- #10 0x080b01ca in CHARACTER_MANAGER::SpawnMobRange (this=this@entry=0xffffbe58, dwVnum=552, lMapIndex=lMapIndex@entry=43, sx=sx@entry=896800, sy=sy@entry=288100, ex=ex@entry=898800, ey=ey@entry=290100, bIsException=bIsException@entry=true, bSpawnMotion=<optimized out>, bSpawnMotion@entry=false, bAggressive=bAggressive@entry=false) at char_manager.cpp:470 #11 0x080b067d in CHARACTER_MANAGER::SpawnGroup (this=this@entry=0xffffbe58, dwVnum=552, lMapIndex=lMapIndex@entry=43, sx=sx@entry=896800, sy=sy@entry=288100, ex=ex@entry=898800, ey=ey@entry=290100, pkRegen=pkRegen@entry=0x3acb3480, bAggressive_=bAggressive_@entry=false, pDungeon=pDungeon@entry=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, bAggressive_=bAggressive_@entry=false, pDungeon=pDungeon@entry=0x0) at char_manager.cpp:561 #13 0x081b0937 in regen_spawn (regen=regen@entry=0x3acb3480, bOnce=bOnce@entry=false) at regen.cpp:385 #14 0x081b09e2 in regen_event (event=..., processing_time=1000) at regen.cpp:616 #15 0x0810829d in event_process (pulse=pulse@entry=3684235) at event.cpp:140 #16 0x08210fde in heartbeat (ht=0x2913e550, pulse=pulse@entry=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 Share on other sites More sharing options...
Firecracker 3 Posted February 6, 2017 Author Share Posted February 6, 2017 help pls one more time core crashed. 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=0x4f466540, 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 (sz=sz@entry=12120) at ../../.././../gcc-4.8-20131212/libstdc++-v3/libsupc++/new_op.cc:56 #8 0x080af313 in CHARACTER_MANAGER::CreateCharacter (this=0xffffbe48, name=name@entry=0x2a35099d "Yeti", dwPID=dwPID@entry=0) at char_manager.cpp:84 #9 0x080afda9 in CHARACTER_MANAGER::SpawnMob (this=this@entry=0xffffbe48, dwVnum=dwVnum@entry=1106, lMapIndex=lMapIndex@entry=660141, x=x@entry=268418, y=731821, z=z@entry=0, bSpawnMotion=bSpawnMotion@entry=true, iRot=iRot@entry=-1, bShow=bShow@entry=true) at char_manager.cpp:419 #10 0x080b01ca in CHARACTER_MANAGER::SpawnMobRange (this=this@entry=0xffffbe48, dwVnum=1106, lMapIndex=lMapIndex@entry=660141, sx=sx@entry=267865, sy=sy@entry=731794, ex=ex@entry=268613, ey=ey@entry=732668, bIsException=bIsException@entry=true, bSpawnMotion=<optimized out>, bSpawnMotion@entry=true, bAggressive=bAggressive@entry=false) at char_manager.cpp:470 #11 0x080b067d in CHARACTER_MANAGER::SpawnGroup (this=0xffffbe48, dwVnum=dwVnum@entry=1113, lMapIndex=660141, sx=267865, sy=731794, ex=268613, ey=732668, pkRegen=pkRegen@entry=0x0, bAggressive_=bAggressive_@entry=false, pDungeon=pDungeon@entry=0x0) at char_manager.cpp:600 #12 0x080c4f54 in CHARACTER::__StateIdle_Stone (this=0x28322000) at char_state.cpp:449 #13 0x0806e2f8 in CHARACTER::UpdateStateMachine (this=0x28322000, dwPulse=6170391) at char.cpp:4455 #14 0x080b0e9e in std::mem_fun1_t<void, CHARACTER, unsigned int>::operator() (x=6170391, p=<optimized out>, this=0xffffa2bc) at /usr/local/lib/gcc48/include/c++/bits/stl_function.h:623 #15 std::binder2nd<std::mem_fun1_t<void, CHARACTER, unsigned int> >::operator() (__x=<optimized out>, this=0xffffa2bc) at /usr/local/lib/gcc48/include/c++/backward/binders.h:160 #16 std::for_each<__gnu_cxx::__normal_iterator<CHARACTER*, std::vector<CHARACTER, std::allocator<CHARACTER*> > >, std::binder2nd<std::mem_fun1_t<void, CHARACTER, unsigned int> > > (__first=..., last=..., f=...) at /usr/local/lib/gcc48/include/c++/bits/stl_algo.h:4440 #17 0x080aecbf in CHARACTER_MANAGER::Update (this=0xffffbe48, iPulse=6170391) at char_manager.cpp:699 #18 0x082120d4 in idle () at main.cpp:979 #19 0x08054b9d in main (argc=1, argv=0xffffdc24) at main.cpp:640 Link to comment Share on other sites More sharing options...
Firecracker 3 Posted February 6, 2017 Author Share Posted February 6, 2017 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 Share on other sites More sharing options...
Firecracker 3 Posted February 7, 2017 Author Share Posted February 7, 2017 4 minutes ago, arves100 said: Try undefine DEBUG_ALLOC it is already undefined. thanks for reply. Link to comment Share on other sites More sharing options...
Firecracker 3 Posted February 7, 2017 Author Share Posted February 7, 2017 (edited) 2 minutes ago, arves100 said: Too low memory on your system, it can't allocate a new character pointer. but how? future of my system is very good i think. https://metin2.download/picture/0AOePZ3GUTtGh5hwtkIxIV8Yr5jTHZzt/.png Edited September 3, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Root 58 Posted February 7, 2017 Share Posted February 7, 2017 (edited) I dont know about ur serverfiles but that mysql usage is very bad. Try add more ram.Clear logs. look mine : Spoiler Edited August 24, 2022 by Metin2 Dev Core X - External 2 Internal 2 Link to comment Share on other sites More sharing options...
Firecracker 3 Posted February 7, 2017 Author Share Posted February 7, 2017 (edited) 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 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. Edited August 24, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Root 58 Posted February 7, 2017 Share Posted February 7, 2017 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 1 2 Link to comment Share on other sites More sharing options...
Firecracker 3 Posted February 8, 2017 Author Share Posted February 8, 2017 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 Share on other sites More sharing options...
Premium Istny 79 Posted February 8, 2017 Premium Share Posted February 8, 2017 add log-queries-not-using-indexes to my.cnf and run mysqltuner on server Link to comment Share on other sites More sharing options...
Firecracker 3 Posted February 8, 2017 Author Share Posted February 8, 2017 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 1 Link to comment Share on other sites More sharing options...
Firecracker 3 Posted February 9, 2017 Author Share Posted February 9, 2017 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 Share on other sites More sharing options...
Firecracker 3 Posted February 11, 2017 Author Share Posted February 11, 2017 Mysql usage is OK. But core crashes randomly because of the same problem. Link to comment Share on other sites More sharing options...
Firecracker 3 Posted February 12, 2017 Author Share Posted February 12, 2017 Help pls. What can cause this crash? Link to comment Share on other sites More sharing options...
Firecracker 3 Posted March 20, 2017 Author Share Posted March 20, 2017 Up Link to comment Share on other sites More sharing options...
Firecracker 3 Posted March 28, 2017 Author Share Posted March 28, 2017 Up Link to comment Share on other sites More sharing options...
Premium Speachless 759 Posted March 28, 2017 Premium Share Posted March 28, 2017 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 Share on other sites More sharing options...
Firecracker 3 Posted March 30, 2017 Author Share Posted March 30, 2017 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 Share on other sites More sharing options...
Premium Speachless 759 Posted March 31, 2017 Premium Share Posted March 31, 2017 Your main problem of getting crash is that mysql usage. Fix it. Link to comment Share on other sites More sharing options...
Firecracker 3 Posted April 1, 2017 Author Share Posted April 1, 2017 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 Share on other sites More sharing options...
Premium Speachless 759 Posted April 1, 2017 Premium Share Posted April 1, 2017 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 Share on other sites More sharing options...
Firecracker 3 Posted April 11, 2017 Author Share Posted April 11, 2017 push... Link to comment Share on other sites More sharing options...
forestking11 0 Posted November 30, 2018 Share Posted November 30, 2018 This core is solved? Link to comment Share on other sites More sharing options...
Firecracker 3 Posted January 9, 2019 Author Share Posted January 9, 2019 On 11/30/2018 at 2:24 PM, forestking11 said: This core is solved? no Link to comment Share on other sites More sharing options...
Zoltanbaszasi 5 Posted January 10, 2019 Share Posted January 10, 2019 Up Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now