Page 1 of 1

Packet Spam = World Crash now

Posted: Tue Jan 13, 2015 4:53 pm
by John Adams
I know, didn't see that one coming. Never tore down the server before.

Code: Select all

>	WorldServer.exe!std::_Fetch_add_seq_cst_2(volatile unsigned short * _Tgt, unsigned short _Value) Line 1166	C++
 	WorldServer.exe!std::_Atomic_fetch_add_2(volatile unsigned short * _Tgt, unsigned short _Value, std::memory_order _Order) Line 1188	C++
 	WorldServer.exe!std::atomic_fetch_add_explicit(std::atomic_ushort * _Atom, unsigned short _Value, std::memory_order _Order) Line 1175	C++
 	WorldServer.exe!std::atomic_ushort::fetch_add(unsigned short _Value, std::memory_order _Order) Line 1394	C++
 	WorldServer.exe!Client::GetAndIncrementServerSequence() Line 230	C++
 	WorldServer.exe!Client::PushOutgoing(SOEProtocolData * data, bool dump_packet) Line 359	C++
 	WorldServer.exe!Client::QueuePacket(SOEProtocolData * data, bool dump_packet) Line 293	C++
 	WorldServer.exe!CommandProcess::CommandSummon(std::shared_ptr<Client> & client, Separator * sep, unsigned char command_index, bool world_client) Line 1283	C++
 	WorldServer.exe!CommandProcess::Process(std::shared_ptr<Client> & client, Separator * sep, unsigned char command_index, bool world_client) Line 224	C++
 	WorldServer.exe!Net::HandleWorldChatPacket(std::shared_ptr<Client> & client, PacketStruct * packet_struct) Line 605	C++
 	WorldServer.exe!Net::Process() Line 219	C++
 	WorldServer.exe!main(int argc, char * * argv) Line 197	C++
 	WorldServer.exe!__tmainCRTStartup() Line 241	C
 	WorldServer.exe!mainCRTStartup() Line 164	C
 	kernel32.dll!7689338a()	Unknown
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
 	ntdll.dll!76f99f72()	Unknown
 	ntdll.dll!76f99f45()	Unknown
Nice and deep in a place we never had issues before, GetAndIncrementServerSequence -- server_sequence is unreadable.

Code: Select all

-		server_sequence	{...}	std::atomic<unsigned short>
-		std::atomic_ushort	{_My_val=??? }	std::atomic_ushort
		_My_val	<Unable to read memory>	
+		this	0x00000000 {outgoing={ size=??? } outgoing_noseq={ size=??? } sent_packets={ size=??? } ...}	Client *
Happened when Moldew tried .summon, while the other client was barfing.

Code: Select all

		// This is needed to send a message from the Chunk Server to a client other than the calling client.
==>		chunk->GetClient(pawn_casted->GetAccountID())->QueuePacket(out->Serialize());
		delete out;

Re: Packet Spam = World Crash now

Posted: Tue Jan 13, 2015 4:55 pm
by Moldew
I did it...

Re: Packet Spam = World Crash now

Posted: Tue Jan 13, 2015 5:20 pm
by Lokked
Ok, so the other client was spewing unknown opcodes and Moldew used a command on it? We can add checks in those commands to prevent a crash. Specifically, the server crashed in that function because there was no Client object (it had somehow been removed).

I *think* (not at home) that chunk->GetClient returns a weak_ptr<>.lock(), meaning wherever we have a chunk->GetClient(), we need to:

Code: Select all

auto other_client = chunk->GetClient(...)
If (!other_client) {
    return;
}
// continue code using other_client
This was likely an oversight on my part and just never came up until now (if this indeed is a weak_ptr.lock() issue).
Meaning, this is a separate issue from the packet spam issue.

Re: Packet Spam = World Crash now

Posted: Tue Jan 13, 2015 6:11 pm
by John Adams
I'm not sure he used a .summon command ON the other player, but it's a good thing to check. Wait until you see SpammyConsole4.txt, coming soon.