Page 1 of 1

World Crash: KickDupeClients (moved)

Posted: Sun Mar 15, 2015 3:49 am
by Kandra
The New Telon server is currently down.

Re: New Telon is down

Posted: Sun Mar 15, 2015 10:47 am
by John Adams
Thanks for the heads up, sorry I did not check the forums before going to sleep Here's the crash report:

Stack: our buddy KickDupeClients is back

Code: Select all

 	ntdll.dll!77bb8277()	Unknown
 	[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]	
>	WorldServer.exe!Mutex::ReadLock() Line 99	C++
 	WorldServer.exe!UDPServer::GetClient(unsigned int account_id) Line 194	C++
 	WorldServer.exe!ChunkServer::GetClient(unsigned int account_id) Line 288	C++
 	WorldServer.exe!UDPServer::KickDupeClients(unsigned int account_id, unsigned int connection_id) Line 268	C++
 	WorldServer.exe!Net::HandleCharacterSelected(std::shared_ptr<Client> & client, PacketStruct * packet_struct) Line 496	C++
 	WorldServer.exe!Net::Process() Line 161	C++
 	WorldServer.exe!main(int argc, char * * argv) Line 216	C++
 	WorldServer.exe!__tmainCRTStartup() Line 241	C
 	WorldServer.exe!mainCRTStartup() Line 164	C
 	kernel32.dll!7694338a()	Unknown
 	ntdll.dll!77b49f72()	Unknown
 	ntdll.dll!77b49f45()	Unknown
Looks like "udp" was null again.

Console:
[quote]20:50:21.692 I UDP New client connected from 206.116.250.230:54595
20:50:21.692 I UDP Received session request from 206.116.250.230:54595 with connection ID 1126371649
20:50:21.926 I Chunk New Session: Account ID: 80 Session ID: 'giojnj56bbnpooops9hdvufa55'
20:50:22.191 D Chunk control_text='HELLO REVISION=0 MINVER=3151 VER=3186'
20:51:19.425 I UDP New client connected from 206.116.250.230:62214
20:51:19.425 I UDP Received session request from 206.116.250.230:62214 with connection ID 2096404461
20:51:19.691 I Net New Session: Account ID: 80 Session ID: 'giojnj56bbnpooops9hdvufa55'
20:51:20.003 D Char Loading 12 characters for account_id: 80
20:51:20.003 D Char Loaded 4 characters for account_id: 80
20:51:20.003 D Net Net:Loading character inventory for Varg.
20:51:20.003 D Char Loading Inventory for character_id 96
20:51:20.003 I Char Loaded 0 items for character_id 96
20:51:20.003 E Database Unable to properly load character inventory!
20:51:20.003 D Net Net:Character inventory loaded.
20:51:20.003 D Net Net:Loading character inventory for Thog.
20:51:20.003 D Char Loading Inventory for character_id 525
20:51:20.018 I Char Loaded 0 items for character_id 525
20:51:20.018 E Database Unable to properly load character inventory!
20:51:20.018 D Net Net:Character inventory loaded.
20:51:20.018 D Net Net:Loading character inventory for Will.
20:51:20.018 D Char Loading Inventory for character_id 646
20:51:20.018 I Char Loaded 0 items for character_id 646
20:51:20.018 E Database Unable to properly load character inventory!
20:51:20.018 D Net Net:Character inventory loaded.
20:51:20.018 D Net Net:Loading character inventory for Riken.
20:51:20.018 D Char Loading Inventory for character_id 947
20:51:20.034 I Char Loaded 19 items for character_id 947
20:51:20.034 D Net Net:Character inventory loaded.[/quote]

Re: World Crash: KickDupeClients (moved)

Posted: Wed Aug 19, 2015 5:29 pm
by John Adams
So, this guy is back. Seen it a couple times the last week, likely because there are more visitors now. Same scenario; I'm watching 1 player in particular continually go back to character select, over and over. I am sure they'll not bother reporting their experience, so I can only conclude they are either crashing, or purposely camping to mass-create their menagerie of characters.

Either way, I'm suspecting the camping/coming back again. Xinux thought he found a disconnect timer, but I am wary to lower it out of fear of causing unintentional drops. If anyone is bored, it would be nice to take another look at this stack (though the line #'s have changed) to see if we can at least add logging to see what's going on.

This is incredibly disruptive, especially when we had 6 player connected trying things out, and now we have none

If we don't stop these crashes, we'll stop having testers.

Re: World Crash: KickDupeClients (moved)

Posted: Wed Aug 19, 2015 8:48 pm
by Xinux
Ok I think I narrowed it down to this section.

You have this function

Code: Select all

void UDPServer::KickDupeClients(uint32_t account_id, uint32_t connection_id) {
Which run this on line 285

Code: Select all

auto chunk_client = character->GetCurrentChunk()->GetClient(world_client->GetAccountID());
When it hits GetClient it goes here.

Code: Select all

shared_ptr<Client> ChunkServer::GetClient(uint32_t account_id) {
	LogInfo(LOG_CHUNK, 0, "ChunkServer::GetClient Account_id = %i", account_id);
    return udp.GetClient(account_id);
}
And then it run's this and seem's to crashes on m_clients.ReadLock();

Code: Select all

shared_ptr<Client> UDPServer::GetClient(uint32_t account_id) {
	LogInfo(LOG_UDP, 0, "UDPServer::GetClient Account_id = %i", account_id);
    
	shared_ptr<Client> client;
	
	LogInfo(LOG_UDP, 0, "UDPServer::GetClient shared_ptr");
   
	m_clients.ReadLock();
	
	LogInfo(LOG_UDP, 0, "UDPServer::GetClient ReadLock Account_id = %i", account_id);
   
	for (auto& itr : clients) {
        if (itr.second->GetAccountID() == account_id && itr.second->IsConnected()) {
            client = itr.second;
            break;
        }
    }
    m_clients.ReadUnlock();
	
	LogInfo(LOG_UDP, 0, "GetClient Return Client Account_id = %i", account_id);
    
	return client;
}

Code: Select all

20:40:55.796 I UDP      KickDupeClients Account_id = 1 Connection_id = 543107592
20:40:55.798 I UDP      KickDupeClients Readlock Account_id = 1 Connection_id = 543107592
20:40:55.799 I UDP      KickDupeClients ReadUnlock Account_id = 1 Connection_id = 543107592
20:40:55.800 I UDP      KickDupeClients before auto chunk_client
20:40:55.801 I Chunk    ChunkServer::GetClient Account_id = 1
20:40:55.802 I UDP      UDPServer::GetClient Account_id = 1
20:40:55.802 I UDP      UDPServer::GetClient shared_ptr
I'm almost thinking the issue is if there is multiple of the same account it's getting confused. I'm going to post in private on how to get the server to crash every time.

Re: World Crash: KickDupeClients (moved)

Posted: Thu Aug 20, 2015 10:56 am
by Xinux
Ok just committed a fix for this hopefully since i cannot reproduce the crash i was able to reproduce 99% of the time.

Re: World Crash: KickDupeClients (moved)

Posted: Thu Aug 20, 2015 3:49 pm
by John Adams
Recompiling and restarting New Telon now.