- Status Closed
- Percent Complete
- Task Type Bug Report
- Category
- Assigned To No-one
- Operating System
- Severity Critical
- Priority
- Reported Version
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#2365 - npc client can not handle large numbers of npcs
if you spawn too many npcs on the server the npcclient will segfault i have tested this with about 6000 npcs i will reset and see if i can get a more exact number, as we dont want this happening on laanx as more maps are added.
here is the bt for this crash
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fd89605b6f0 (LWP 20397)] 0x00007fd8925337ae in csRef<iFile>::operator iFile* (this=0x18) at /home/mdavis/server/cs/include/csutil/ref.h:354 354 { return obj; } (gdb) bt #0 0x00007fd8925337ae in csRef<iFile>::operator iFile* (this=0x18) at /home/mdavis/server/cs/include/csutil/ref.h:354 #1 0x00007fd892531270 in LogCSV::Write (this=0x0, type=3, text=@0x7fff9e07d590) at src/common/util/log.cpp:413 #2 0x00007fd89252b388 in psMysqlConnection::Select (this=0x7990b0, sql=0x515f20 "select * from character_relationships where related_id=%u") at src/server/database/mysql/dal.cpp:231 #3 0x00000000004255c4 in psNPCClient::AttachNPC (this=0x7c4cb0, actor=0x4638e50, DRcounter=6 '\006') at src/npcclient/npcclient.cpp:655 #4 0x000000000041042c in NetworkManager::HandleActor (this=0x8746e0, me=0x7fd88c0288b0) at src/npcclient/networkmgr.cpp:274 #5 0x0000000000413e6e in NetworkManager::HandleMessage (this=0x8746e0, me=0x7fd88c0288b0) at src/npcclient/networkmgr.cpp:160 #6 0x000000000041424c in psClientNetSubscriber::HandleMessage ( this=0x8746e0, msg=0x7fd88c0288b0) at ./src/common/net/cmdbase.h:70 #7 0x00000000004d68ca in MsgHandler::Publish (this=0x807560, me=0x7fd88c0288b0) at src/common/net/msghandler.cpp:70 #8 0x00000000004fcbd2 in EventManager::Run (this=0x807560) at src/common/util/eventmanager.cpp:191 ---Type <return> to continue, or q <return> to quit--- #9 0x00000000004264b4 in psNPCClient::MainLoop (this=0x7c4cb0) at src/npcclient/npcclient.cpp:277 #10 0x000000000045aeaa in main (argc=1, argv=0x7fff9e07e208) at src/npcclient/main.cpp:60 (gdb) bt full #0 0x00007fd8925337ae in csRef<iFile>::operator iFile* (this=0x18) at /home/mdavis/server/cs/include/csutil/ref.h:354 No locals. #1 0x00007fd892531270 in LogCSV::Write (this=0x0, type=3, text=@0x7fff9e07d590) at src/common/util/log.cpp:413 curtime = 140568181821722 loctime = (tm *) 0x7fff9e07d4e0 buf = {<csStringFast<36>> = {<csStringBase> = { _vptr.csStringBase = 0x7c5e70, Data = 0x7fd8959bfce0 "H\213U?H\213\005e'J", Size = 1223665387, MaxSize = 274894, GrowBy = 0}, minibuff = "??R\222?\177\000\000\000?\a\236?\177\000\000'?\233\225?\177\000\000\b?\a\236?\177\000\000??S?", miniused = 140735844701472}, <No data fields>} count = 0 #2 0x00007fd89252b388 in psMysqlConnection::Select (this=0x7990b0, sql=0x515f20 "select * from character_relationships where related_id=%u") at src/server/database/mysql/dal.cpp:231 status = {<csStringFast<36>> = {<csStringBase> = { _vptr.csStringBase = 0x7fd892742cb0, ---Type <return> to continue, or q <return> to quit--- Data = 0x4641b80 "SQL query select * from character_relationships where related_id=4721, has taken 1348 time to process.\n", Size = 103, MaxSize = 128, GrowBy = 64}, minibuff = "SQL query select * from character_r", miniused = 36}, <No data fields>} rs = (iResultSet *) 0x7fd89489ec1c timer = {start = 170408} querystr = {<csStringFast<36>> = {<csStringBase> = { _vptr.csStringBase = 0x7fd892742cb0, Data = 0x4641b30 "select * from character_relationships where related_id=4721", Size = 59, MaxSize = 64, GrowBy = 64}, minibuff = "select * from character_relationshi", miniused = 36}, <No data fields>} args = {{gp_offset = 24, fp_offset = 48, overflow_arg_area = 0x7fff9e07d720, reg_save_area = 0x7fff9e07d650}} #3 0x00000000004255c4 in psNPCClient::AttachNPC (this=0x7c4cb0, actor=0x4638e50, DRcounter=6 '\006') at src/npcclient/npcclient.cpp:655 result = {rs = 0x7fff9e07d7e0} npc = (NPC *) 0x0 ---Type <return> to continue, or q <return> to quit--- #4 0x000000000041042c in NetworkManager::HandleActor (this=0x8746e0, me=0x7fd88c0288b0) at src/npcclient/networkmgr.cpp:274 mesg = {<psDRMessage> = {<psMessageCracker> = { _vptr.psMessageCracker = 0x781270, static msghandler = 0x807560, msg = {obj = 0x0}, valid = true}, counter = 6 '\006', on_ground = true, mode = 0 '\0', pos = {{{x = -42.9404907, y = 0.00178007782, z = -147.543823}, m = {-42.9404907, 0.00178007782, -147.543823}}}, vel = {{{x = 0, y = 0, z = 0}, m = {0, 0, 0}}}, worldVel = {{{x = 0, y = 0, z = 0}, m = {0, 0, 0}}}, yrot = 0.981747746, sector = 0x7fd88b765f2c, sectorName = {<csStringFast<36>> = {<csStringBase> = { _vptr.csStringBase = 0x510fd0, Data = 0x0, Size = 7, MaxSize = 0, GrowBy = 64}, minibuff = "NPCroom\000\000?\a\236?\177\000\000\000\000\000\000\000\000\000\000z\036\211\224?\177\000\000\217?x", miniused = 8}, <No data fields>}, ang_vel = 0, entityid = 14746}, name = {<csStringFast<36>> = {<csStringBase> = { _vptr.csStringBase = 0x510fd0, Data = 0x0, Size = 11, MaxSize = 0, GrowBy = 64}, minibuff = "DictMaster2\000\000\177\000\0000{m\203?\177\000\000\000---Type <return> to continue, or q <return> to quit--- \000\000\000\000\000\000\000??\a\236", miniused = 12}, <No data fields>}, guild = {<csStringFast<36>> = {<csStringBase> = { _vptr.csStringBase = 0x510fd0, Data = 0x0, Size = 0, MaxSize = 0, GrowBy = 64}, minibuff = "\000\000m\203?\177\000\000\220\000\000\000\000\000\000\000@?\a\226?\177\000\000?zm\203?\177\000\000\000\000\000", miniused = 2}, <No data fields>}, factname = {<csStringFast<36>> = {<csStringBase> = { _vptr.csStringBase = 0x510fd0, Data = 0x0, Size = 7, MaxSize = 0, GrowBy = 64}, minibuff = "stonebm\000?zm\203?\177\000\000\000\000\000\000\000\000\000\000x\221?\225?\177\000\000?zm\203", miniused = 8}, <No data fields>}, filename = {<csStringFast<36>> = {<csStringBase> = { _vptr.csStringBase = 0x510fd0, Data = 0xc72ae0 "/planeshift/models/stonebm/stonebm.cal3d", Size = 40, MaxSize = 64, GrowBy = 64}, minibuff = "?zm\203?\177\000\000??\a\236?\177\000\000E\030A\224?\177\000\000?zm\203?\177\000\000\020\000\000", ---Type <return> to continue, or q <return> to quit--- miniused = 0}, <No data fields>}, race = {<csStringFast<36>> = {<csStringBase> = { _vptr.csStringBase = 0x510fd0, Data = 0x0, Size = 13, MaxSize = 0, GrowBy = 64}, minibuff = "Hammerwielder\000\000\000\000?\a\236?\177", '\0' <repeats 13 times>, miniused = 14}, <No data fields>}, gender = 2, helmGroup = {<csStringFast<36>> = {<csStringBase> = { _vptr.csStringBase = 0x510fd0, Data = 0x0, Size = 0, MaxSize = 0, GrowBy = 64}, minibuff = "@?\a\236?\177\000\000\001\000\000\000\001\000\000\000\001\000\000\000?\177\000\0009\000\000\000\001\000\000\000P??\210", miniused = 0}, <No data fields>}, top = {{{x = 1.16877687, y = 0.695877612, z = 0.470216453}, m = {1.16877687, 0.695877612, 0.470216453}}}, bottom = {{{x = 1.09877694, y = 0.699999988, z = 0.40021643}, m = {1.09877694, 0.699999988, 0.40021643}}}, offset = {{{x = 0, y = 0, z = 0}, m = {0, 0, 0}}}, texParts = {<csStringFast<36>> = {<csStringBase> = { _vptr.csStringBase = 0x510fd0, Data = 0x0, Size = 17, MaxSize = 0, GrowBy = 64}, minibuff = "<traits></traits>\000\a\236?\177\000\000?>?\210?\177\00---Type <return> to continue, or q <return> to quit--- 0\000?>?\210", miniused = 18}, <No data fields>}, equipment = {<csStringFast<36>> = {<csStringBase> = { _vptr.csStringBase = 0x510fd0, Data = 0x36e9200 "<equiplist><helm></helm></equiplist>", Size = 36, MaxSize = 64, GrowBy = 64}, minibuff = "\023\000\000\000\n\000\000\000\t\000\000\000l\000\000\000\005\000\000\000\033\001\000\000??\v\220?\177\000\000\000\000\000", miniused = 0}, <No data fields>}, type = -1, masqueradeType = -1, serverMode = 1 '\001', playerID = 4721, groupID = 0, ownerEID = 0, control = false, flags = 4, instance = 0, posPlayerID = 32728, posInstance = -2089999344} obj = (class gemNPCObject *) 0x0 actor = (class gemNPCActor *) 0x4638e50 #5 0x0000000000413e6e in NetworkManager::HandleMessage (this=0x8746e0, me=0x7fd88c0288b0) at src/npcclient/networkmgr.cpp:160 No locals. #6 0x000000000041424c in psClientNetSubscriber::HandleMessage ( this=0x8746e0, msg=0x7fd88c0288b0) at ./src/common/net/cmdbase.h:70 No locals. #7 0x00000000004d68ca in MsgHandler::Publish (this=0x807560, ---Type <return> to continue, or q <return> to quit--- me=0x7fd88c0288b0) at src/common/net/msghandler.cpp:70 client = (struct Client *) 0x7fd88c0288b0 x = 0 lock = {lockObj = @0x809560} handled = false mtype = 117 __FUNCTION__ = "Publish" #8 0x00000000004fcbd2 in EventManager::Run (this=0x807560) at src/common/util/eventmanager.cpp:191 start = 170405 timeTaken = 2 now = 170405 timeout = 229 status = {<csStringFast<36>> = {<csStringBase> = { _vptr.csStringBase = 0x510fd0, Data = 0x14fce00 "Message type 117 has taken 746 time to process, average time of events is 31", Size = 76, MaxSize = 128, GrowBy = 64}, minibuff = "Message type 117 has taken 851 time", miniused = 36}, <No data fields>} eventtimes = {2, 1, 2, 2, 2, 1, 1, 91, 4, 3, 2, 3, 3, 2, 2, 2, ---Type <return> to continue, or q <return> to quit--- 30, 7, 2, 3, 4, 4, 3, 4, 4, 2, 3, 2, 2, 5, 2, 3, 2, 50, 2, 2, 2, 4, 2, 1, 2, 1, 2, 2, 2, 2, 1, 2, 2, 15} index = 16 eventtimesTotal = 299 filled = true msg = {obj = 0x7fd88c0288b0} nextEvent = 170634 #9 0x00000000004264b4 in psNPCClient::MainLoop (this=0x7c4cb0) at src/npcclient/npcclient.cpp:277 cmdline = {obj = 0x7fd89603432c} #10 0x000000000045aeaa in main (argc=1, argv=0x7fff9e07e208) at src/npcclient/main.cpp:60 CSSetup = (psCSSetup *) 0x789970 object_reg = (class iObjectRegistry *) 0x7fd895fed8fc host = 0x0 user = 0x0 pass = 0x0 port = 0 cfgmgr = {obj = 0x0}
Closed by peeg
11.10.2008 16:52
Reason for closing:
Additional comments about closing:
11.10.2008 16:52
Reason for closing:
Additional comments about closing:
Fixed by weltall.
tested and got to between 4000 and 5000 npcs are needed before the npc client can run with no issues, this does not include pets atleast in my test i dont know how that figures into laanx.