World Crash: null Character
Moderators: Community Managers, Developers
- John Adams
- Retired
- Posts: 4581
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
World Crash: null Character
Apparently, we need a more brutal approach to handling null characters. I'd like someone to look into disconnecting and destroying the client connection once a character object goes null. There's no reason to hold onto it if they are invalid, or bad things happen. Server was down since 7pm last night
Call Stack:
FVector GetLocation() { return location; } the 'location' is null because once again, and auto was used without validating the object.
I temp fixed this on NT, but we'll need this entire system looked at.
But the bigger issue is up stream, Console:
[quote]18:40:55.982 D Combat Processing 94 Damage
18:40:56.203 D NPC Acolyte Draker Exiting Combat
18:41:01.708 D Chunk ChunkServer::HandleClientReleaseSpirit() Releasing spirit for character: Drak
18:41:01.710 D Chunk Found altar at 40544.000000, -28676.000000, 36318.000000
18:41:01.712 D Chunk Found altar at -18057.000000, 16018.000000, 41583.000000
18:41:01.713 D Chunk Found altar at 29975.000000, 68372.000000, 42301.000000
18:41:01.715 D Chunk Nearest altar at 40544.000000, -28676.000000, 36318.000000
18:41:02.264 E Chunk Unhandled opcode 0x000003E5 (997) from 24.207.18.29 in ChunkServer::ProcessPackets
0000: 00 09 0E 09 02 00 E5 03 - 00 00 04 00 00 00 00 00 ................
0010: 00 41 7E D1 .A~.
18:43:04.325 D Char Saved successful for character 'Drak' (695)
18:48:04.417 D Char Saved successful for character 'Drak' (695)
18:50:50.249 E Unreal Could not find unreal channel list for account id 0!
18:51:20.356 W Chunk In ChunkServer::HandleClientUnstuck: character==null
18:51:24.282 W Chunk In ChunkServer::HandleClientUnstuck: character==null
18:51:28.338 E Item ClientUseItem could not obtain character!
18:51:28.979 E Unreal Could not find unreal channel list for account id 0!
18:51:29.165 E Item ClientUseItem could not obtain character!
18:51:30.273 E Item ClientUseItem could not obtain character!
18:51:30.284 E Item ClientUseItem could not obtain character!
18:51:30.295 E Item ClientUseItem could not obtain character!
18:51:30.306 E Item ClientUseItem could not obtain character!
18:51:30.317 E Item ClientUseItem could not obtain character!
18:51:30.403 E Item ClientUseItem could not obtain character!
18:51:30.409 E Item ClientUseItem could not obtain character!
18:51:30.605 E Item ClientUseItem could not obtain character!
18:51:32.641 W Chunk ClientMountRoa requested from client with character==null
18:51:33.642 E Unreal Could not find unreal channel list for account id 0!
18:51:33.833 E Unreal Could not find unreal channel list for account id 0!
18:51:35.349 W Chunk ClientMountRoa requested from client with character==null
18:51:35.790 E Unreal Could not find unreal channel list for account id 0!
18:51:35.926 E Unreal Could not find unreal channel list for account id 0!
18:51:36.137 E Unreal Could not find unreal channel list for account id 0!
18:51:36.308 E Unreal Could not find unreal channel list for account id 0!
18:51:36.784 E Item ClientUseItem could not obtain character!
18:51:36.895 E Item ClientUseItem could not obtain character!
18:51:37.126 E Item ClientUseItem could not obtain character!
18:51:37.367 E Item ClientUseItem could not obtain character!
18:51:37.489 E Item ClientUseItem could not obtain character!
18:51:37.730 E Item ClientUseItem could not obtain character!
18:51:37.886 E Item ClientUseItem could not obtain character!
18:51:38.067 E Item ClientUseItem could not obtain character!
18:51:38.213 E Item ClientUseItem could not obtain character!
18:51:38.389 E Item ClientUseItem could not obtain character!
18:51:41.495 E Item ClientUseItem could not obtain character!
18:51:42.269 E Item ClientUseItem could not obtain character!
18:51:45.515 E Unreal Could not find unreal channel list for account id 0!
18:51:45.856 E Unreal Could not find unreal channel list for account id 0!
18:51:47.322 E Unreal Could not find unreal channel list for account id 0!
18:51:47.468 E Unreal Could not find unreal channel list for account id 0!
18:51:47.679 E Unreal Could not find unreal channel list for account id 0!
18:52:35.371 E Item ClientUseItem could not obtain character![/quote]
While fixing the auto's is important, it wouldn't have failed if we handled the disconnect better.
Call Stack:
Code: Select all
> WorldServer.exe!UnrealActor::GetLocation() Line 240 C++
WorldServer.exe!ChunkServer::HandleRiftSelect(std::shared_ptr<Client> & client, PacketStruct * packet) Line 3712 C++
WorldServer.exe!ChunkServer::ProcessPackets() Line 785 C++
WorldServer.exe!ChunkPacketThread(void * data) Line 121 C++
WorldServer.exe!ThreadRun(void * arg) Line 77 C++
WorldServer.exe!_callthreadstart() Line 255 C
WorldServer.exe!_threadstart(void * ptd) Line 239 C
kernel32.dll!7716337a() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!77c492e2() Unknown
ntdll.dll!77c492b5() Unknown
Code: Select all
auto character = client->GetCharacter();
loc_vec = character->GetLocation();
But the bigger issue is up stream, Console:
[quote]18:40:55.982 D Combat Processing 94 Damage
18:40:56.203 D NPC Acolyte Draker Exiting Combat
18:41:01.708 D Chunk ChunkServer::HandleClientReleaseSpirit() Releasing spirit for character: Drak
18:41:01.710 D Chunk Found altar at 40544.000000, -28676.000000, 36318.000000
18:41:01.712 D Chunk Found altar at -18057.000000, 16018.000000, 41583.000000
18:41:01.713 D Chunk Found altar at 29975.000000, 68372.000000, 42301.000000
18:41:01.715 D Chunk Nearest altar at 40544.000000, -28676.000000, 36318.000000
18:41:02.264 E Chunk Unhandled opcode 0x000003E5 (997) from 24.207.18.29 in ChunkServer::ProcessPackets
0000: 00 09 0E 09 02 00 E5 03 - 00 00 04 00 00 00 00 00 ................
0010: 00 41 7E D1 .A~.
18:43:04.325 D Char Saved successful for character 'Drak' (695)
18:48:04.417 D Char Saved successful for character 'Drak' (695)
18:50:50.249 E Unreal Could not find unreal channel list for account id 0!
18:51:20.356 W Chunk In ChunkServer::HandleClientUnstuck: character==null
18:51:24.282 W Chunk In ChunkServer::HandleClientUnstuck: character==null
18:51:28.338 E Item ClientUseItem could not obtain character!
18:51:28.979 E Unreal Could not find unreal channel list for account id 0!
18:51:29.165 E Item ClientUseItem could not obtain character!
18:51:30.273 E Item ClientUseItem could not obtain character!
18:51:30.284 E Item ClientUseItem could not obtain character!
18:51:30.295 E Item ClientUseItem could not obtain character!
18:51:30.306 E Item ClientUseItem could not obtain character!
18:51:30.317 E Item ClientUseItem could not obtain character!
18:51:30.403 E Item ClientUseItem could not obtain character!
18:51:30.409 E Item ClientUseItem could not obtain character!
18:51:30.605 E Item ClientUseItem could not obtain character!
18:51:32.641 W Chunk ClientMountRoa requested from client with character==null
18:51:33.642 E Unreal Could not find unreal channel list for account id 0!
18:51:33.833 E Unreal Could not find unreal channel list for account id 0!
18:51:35.349 W Chunk ClientMountRoa requested from client with character==null
18:51:35.790 E Unreal Could not find unreal channel list for account id 0!
18:51:35.926 E Unreal Could not find unreal channel list for account id 0!
18:51:36.137 E Unreal Could not find unreal channel list for account id 0!
18:51:36.308 E Unreal Could not find unreal channel list for account id 0!
18:51:36.784 E Item ClientUseItem could not obtain character!
18:51:36.895 E Item ClientUseItem could not obtain character!
18:51:37.126 E Item ClientUseItem could not obtain character!
18:51:37.367 E Item ClientUseItem could not obtain character!
18:51:37.489 E Item ClientUseItem could not obtain character!
18:51:37.730 E Item ClientUseItem could not obtain character!
18:51:37.886 E Item ClientUseItem could not obtain character!
18:51:38.067 E Item ClientUseItem could not obtain character!
18:51:38.213 E Item ClientUseItem could not obtain character!
18:51:38.389 E Item ClientUseItem could not obtain character!
18:51:41.495 E Item ClientUseItem could not obtain character!
18:51:42.269 E Item ClientUseItem could not obtain character!
18:51:45.515 E Unreal Could not find unreal channel list for account id 0!
18:51:45.856 E Unreal Could not find unreal channel list for account id 0!
18:51:47.322 E Unreal Could not find unreal channel list for account id 0!
18:51:47.468 E Unreal Could not find unreal channel list for account id 0!
18:51:47.679 E Unreal Could not find unreal channel list for account id 0!
18:52:35.371 E Item ClientUseItem could not obtain character![/quote]
While fixing the auto's is important, it wouldn't have failed if we handled the disconnect better.
Re: World Crash: null Character
As we have said before (including very recently), there must always be a check for a valid pointer before accessing pointer functions and variables. We should eventually be able to hunt all these instances down, but doing it one crash at a time is not the best way.
Once we have a null pointer to a character it would be nice to stop running procedures altogether on a character that is no longer valid and avoid any of these functions, but we still need safety in every function to prevent any possibility of this. It is a sure-fire way to crash the server. In fact, nearly every time I crash my server in testing, it is due to this. Maybe it would be best to kick the client from the world if something wrecks their character pointer so they can start fresh.
GetLocation() is not actually returning null, because there is no valid call to the function, because the character pointer was null. That's what causes these crashes (the actual call to a function that has no location in memory). We are assuming we have a character, and then trying to manipulate it. The same goes for any class that we access through any function. There must be a check to handle the possibility that the class returned is a null instance.
For the chain of events before the crash, how did this character manage to stay in the world attempting so many things (use item, stuck, etc.) without a valid character pointer. That is a particular mystery.
Once we have a null pointer to a character it would be nice to stop running procedures altogether on a character that is no longer valid and avoid any of these functions, but we still need safety in every function to prevent any possibility of this. It is a sure-fire way to crash the server. In fact, nearly every time I crash my server in testing, it is due to this. Maybe it would be best to kick the client from the world if something wrecks their character pointer so they can start fresh.
GetLocation() is not actually returning null, because there is no valid call to the function, because the character pointer was null. That's what causes these crashes (the actual call to a function that has no location in memory). We are assuming we have a character, and then trying to manipulate it. The same goes for any class that we access through any function. There must be a check to handle the possibility that the class returned is a null instance.
For the chain of events before the crash, how did this character manage to stay in the world attempting so many things (use item, stuck, etc.) without a valid character pointer. That is a particular mystery.
Re: World Crash: null Character
I feel like a lot of these crashes lately have been tied to me, although I had hoped by now to be able to offer more than "I'm a jinx!!"
I was there when the world went down. Sile, Halgarad chunk. Ran around the city and noticed at some point that every building I went into was devoid of NPCs, although I was able to run back to where some NPCs had loaded in initially. Checked to see that I wasn't getting disconnected by testing commands; /stuckyes, spammed my mount keys (which I assume are the items being used), no response, New Telon fall down.
I was there when the world went down. Sile, Halgarad chunk. Ran around the city and noticed at some point that every building I went into was devoid of NPCs, although I was able to run back to where some NPCs had loaded in initially. Checked to see that I wasn't getting disconnected by testing commands; /stuckyes, spammed my mount keys (which I assume are the items being used), no response, New Telon fall down.
- John Adams
- Retired
- Posts: 4581
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: World Crash: null Character
Two thoughts;
[quote="zippyzee"]GetLocation() is not actually returning null, because there is no valid call to the function, because the character pointer was null.[/quote]
Yeah, that's what I meant by destroy and kill this guy before it even gets here. The problem was "up stream" from here.
[quote="zippyzee"]For the chain of events before the crash, how did this character manage to stay in the world attempting so many things (use item, stuck, etc.) without a valid character pointer. That is a particular mystery.[/quote]
I'm certain this is because our net code hasn't been touched in almost a year, except for a few stability issues Lokked fixed late 2014. We have a tendency to "hang onto" client connections, and I've been asking for a long, long time to just drop them. There is no recovery, there is no LD we need to worry about, if someone loses their way it will take them far less time to re-launch the client to get back in than running around for the 5 minutes it takes to drop the UDP connection.
PS: I'm convinced also that various attempts we've made to fix connections have exacerbated a root-cause issue, though nulls and crashes related to them are fewer. Zippy is still right, we need all pointer references checked after assigning them and a global Search on "auto" will be exhaustive - as Xinux is aware.
[quote="zippyzee"]GetLocation() is not actually returning null, because there is no valid call to the function, because the character pointer was null.[/quote]
Yeah, that's what I meant by destroy and kill this guy before it even gets here. The problem was "up stream" from here.
[quote="zippyzee"]For the chain of events before the crash, how did this character manage to stay in the world attempting so many things (use item, stuck, etc.) without a valid character pointer. That is a particular mystery.[/quote]
I'm certain this is because our net code hasn't been touched in almost a year, except for a few stability issues Lokked fixed late 2014. We have a tendency to "hang onto" client connections, and I've been asking for a long, long time to just drop them. There is no recovery, there is no LD we need to worry about, if someone loses their way it will take them far less time to re-launch the client to get back in than running around for the 5 minutes it takes to drop the UDP connection.
PS: I'm convinced also that various attempts we've made to fix connections have exacerbated a root-cause issue, though nulls and crashes related to them are fewer. Zippy is still right, we need all pointer references checked after assigning them and a global Search on "auto" will be exhaustive - as Xinux is aware.