[FIXED?]World Crash - SendSpawnChanges

Old bugs stored here for reference.
Locked
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

[FIXED?]World Crash - SendSpawnChanges

Post by John Adams » Wed Aug 14, 2013 7:10 am

5 players came and went on EQ2TC yesterday and there were no crashes until this one. Seems pretty random.

Stack:
feeefeee()
> EQ2World.exe!ZoneServer::SendSpawnChanges() Line 1426 + 0x7 bytes C++
EQ2World.exe!ZoneServer::SpawnProcess() Line 975 C++
EQ2World.exe!SpawnLoop(void * tmp) Line 5074 + 0xa bytes C++
EQ2World.exe!_callthreadstart() Line 259 + 0x6 bytes C
EQ2World.exe!_threadstart(void * ptd) Line 241 + 0x5 bytes C
kernel32.dll!_BaseThreadStart@8() + 0x34 bytes

Code:

Code: Select all

	while(spawn_iter.Next()){		
		spawn = spawn_iter->value;
		if(spawn && spawn->changed){
==> here		if(!spawn->IsPlayer() || (spawn->IsPlayer() && (spawn->info_changed || spawn->vis_changed))){
"value" again has data, but "spawn" ends up with nothing.

Console:
20:13:58 I ZoneAuth : Access Key: 1376450036, Character Name: Adriannale, Account ID: 6592
20:13:58 D Player : Loading character for 'Adriannale' (char_id: 411)
20:13:58 D Recipes : Loaded 0 recipes for player: Adriannale (411)
20:13:58 D Achievements: Loaded 0 player achievement updates
20:13:58 D Player : Loading character_details for 'Adriannale' (char_id: 411)
20:13:58 E World : Incompatible version: 57062
20:13:58 I World : Removing client from ip: 50.193.217.230 port: 54041
Looks like the same bug I reported with incompatible client that no one can reproduce.

This will likely go away once I restart EQ2TC and get the opcode changes Xinux did yesterday. However, I sure would like a World-ending crash to stop just because the opcode isn't there.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: World Crash - SendSpawnChanges

Post by Jabantiz » Fri Aug 16, 2013 2:10 pm

As you already suggested it looks like the same bug from here. Will try to reproduce this tonight to see what is going on.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: World Crash - SendSpawnChanges

Post by Jabantiz » Fri Aug 16, 2013 6:01 pm

Committed a possible fix for this.

All I did was check if we have opcodes for the version the client is using, if not send the login denied packet and return out. Also did this right after the version is obtained from the packet so an incompatible version should not even launch the zone.

Code: Select all

				if (EQOpcodeManager.count(version) == 0) {
					LogWrite(WORLD__ERROR, 0, "World", "Incompatible version: %i", version);
					ClientPacketFunctions::SendLoginDenied( this );
					return false;
				}
Let me know if this continues to happen.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: [FIXED?]World Crash - SendSpawnChanges

Post by John Adams » Fri Aug 16, 2013 7:50 pm

You know I will :mrgreen: Thanks for taking a look.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: [FIXED?]World Crash - SendSpawnChanges

Post by John Adams » Tue Oct 15, 2013 6:07 pm

It's back! First connection since last commit.

Stack:
> EQ2World.exe!Spawn::spawn_update_packet(Spawn * player, unsigned short version, bool override_changes, bool override_vis_changes) Line 554 + 0x12 bytes C++
EQ2World.exe!ZoneServer::SendSpawnChanges(Spawn * spawn, Client * client, bool override_changes, bool override_vis_changes) Line 1346 C++
EQ2World.exe!ZoneServer::SendSpawnChanges(Spawn * spawn) Line 1356 C++
EQ2World.exe!ZoneServer::SendSpawnChanges() Line 1468 C++
EQ2World.exe!ZoneServer::SpawnProcess() Line 1000 C++
EQ2World.exe!SpawnLoop(void * tmp) Line 5193 + 0x9 bytes C++
EQ2World.exe!_callthreadstart() Line 259 + 0x6 bytes C
EQ2World.exe!_threadstart(void * ptd) Line 241 + 0x5 bytes C
kernel32.dll!_BaseThreadStart@8() + 0x34 bytes

Code: In EQ2Packet* Spawn::spawn_update_packet()

Code: Select all

	int32 size = info_size + pos_size + vis_size + 11;
	int8 oversized = 255;
=>>	int16 opcode_val = EQOpcodeManager[version]->EmuToEQ(OP_EqUpdateGhostCmd);
	uchar* tmp = new uchar[size];
	memset(tmp, 0, size);
	uchar* ptr = tmp;
opcode_val = 32992
version = 373
OP_EqUpdateGhostCmd = 338



Console:
crash.jpg
You do not have the required permissions to view the files attached to this post.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: [FIXED?]World Crash - SendSpawnChanges

Post by Jabantiz » Tue Oct 15, 2013 6:43 pm

The console has me confused, some one was in and camped, if this was all caused by a single client my best bet would be a desync, if it was a second client I have no clue as the wrong version should come before the quest error message. Judging by the info you gave and the info in the console for the camp I would bet on a desync. As for how it managed to crash the server I have no clue...

Locked

Who is online

Users browsing this forum: No registered users and 0 guests