Game Development Community

[BUG T3D1.1B1] Remote client crashes on disconnect() - LOGGED

by Guy Allard · in Torque 3D Professional · 04/26/2010 (1:38 am) · 6 replies

Here's a nasty one.
Stock, unmodified T3D1.1B.

The client is crashing when disconnecting from a server if projectiles/explosions (particles?) are active at the time of the disconnect.

This happens with both advanced and basic lighting. It does not occur for a 'single player' game.

Doing this on a debug build gives the following variety of errors:
SimManager::deleteObject: Object in the process of being removed
or
SimManager::deleteObject: Object has already been deleted
or sometimes
Error, could not find ClientMissionCleanup group

I can reproduce this 100%
1) Connect to a server - important.
2) Run around.
3) Fire a projectile, either at the ground or forwards. Quickly hit |ESC| to bring up the console then return to select the OK button.
4) Watch it die :(

#1
04/27/2010 (7:44 am)
Some more information -
This is a problem in all of the following situations for a remote client connected to either a dedicated or listen server, if there are active projectiles/explosions close to the player at the time of the disconnect event:

1) Client disconnects using [esc]

2) Server kicks the client

3) Clients connection to the server is dropped for some reason

when the crash occurs, a stale windows process often remains (on Vista at least).

Clearly, there's something amiss here with the sequence that things are being destroyed on the client.
#2
04/27/2010 (8:35 am)
Not certain this is related but ... try this fix for crashes when players are deleted (from the server). There's a previous problem with cleanup apparently.
#3
04/27/2010 (9:38 am)
Thx Steve, I'll take a look at that just in case.
#4
04/28/2010 (6:18 am)
OK, I think I've figured this one out.
It has nothing to do with explosions or particles, but it's all down to the weapon image trying to delete its sound source (shapeImage.cc line 755 - SFX_DELETE((*i));) when the sound source has already been marked for deletion by the disconnection process.

The SFX_DELETE macro does not check if the object it's trying to delete is already being deleted. To fix this, I changed the SFX_DELETE macro (at the bottom of sfxSource.h) to:
#define SFX_DELETE( source )     \
   if( source )                  \
   {                             \
      if(!source->isRemoved()) // GUY - sanity check!  \
      {                          \
         source->deleteObject(); \
         source = NULL;          \
      }                          \
   }                             \

and the crashes have vanished.
#5
05/04/2010 (3:47 pm)
I put your suggestion in last week and I haven't seen a crash on client disconnect since. Thanks for posting it.
#6
08/22/2010 (4:50 am)
Logged as TQA-902 for QA to verify