Author Topic: Buffer overflow / "unknown command connect" errors.  (Read 2174 times)

    My Realistic Space Mod server just crashed due to an unknown error originating in onClientLeaveGame - which was odd, because neither it nor any of the other mods packaging that function had shown any instability, apart or together, in the past several weeks that I've been running RSM. After disabling every mod other than RSM that was packaging onClientLeaveGame, I tried restarting the server again, but got a C++ buffer overflow error. Hmm.
    At this point I did an indiscriminate deactivation of every mod to get the server back to a vanilla state, but still got the same buffer overflow error. Stranger and stranger. So I deleted cache.db and replaced both Blockland.exe and BlocklandLauncher.exe. At this point, I got the following console error.

Code: [Select]
%
Starting server authentication...
base/server/mainServer.cs (2689): Unknown command connect.
  Object authTCPobj_Server(4291) authTCPobj_Server -> TCPObject -> SimObject
#
*** CREATING MISSION
*** Stage 1 create
160 environmental resource files found
Regenerating file manifest
Got 815 items in manifest, 430 files hashed
%
ERROR: WebCom_PostServer() - mission is not running
BackTrace: ->onStart->serverPart2->dedicatedKeyCheck->initDedicated->createServer->createMission->onMissionLoaded->WebCom_PostServer
%
Engine initialized...
Dedicated server is now running.

Once the server hits the final line, it hangs and fails to do anything else. At this point, I deleted the base/ folder wholesale to try to get a working copy, but the same error happens regardless.


These are the ten people who joined leading up to the event. Not sure if it's of any signifigance, but here they are nonetheless.


03/31/14 16:58:35: Zoltan (BL_ID: 14268, IP: [REDACTED]) joined the server with RSC r13.
03/31/14 17:54:29: Lethamos (BL_ID: 37171, IP: [REDACTED]) joined the server with RSC r13.
03/31/14 18:18:45: TreeAtmos (BL_ID: 28023, IP: [REDACTED]) joined the server with RSC r13.
03/31/14 18:53:18: DatPwnedGuy (BL_ID: 70032, IP: [REDACTED]) joined the server with RSC r13.
03/31/14 19:09:58: blocknaut (BL_ID: 42043, IP: [REDACTED]) joined the server with RSC r11.
03/31/14 19:10:28: Vlask (BL_ID: 50366, IP: [REDACTED]) joined the server with RSC r10.
03/31/14 19:16:22: blocknaut (BL_ID: 42043, IP: [REDACTED]) joined the server with RSC r11.
03/31/14 19:25:38: blocknaut (BL_ID: 42043, IP: [REDACTED]) joined the server with RSC r11.
03/31/14 20:31:33: The Black Ninja (BL_ID: 19074, IP: [REDACTED]) joined the server with RSC r10.
03/31/14 20:37:08: Bing! (BL_ID: 24447, IP: [REDACTED]) joined the server with RSC r10.

Is there anything you haven't deleted to try and get it working again?
Honest question here; it might just be that something got corrupted somehow. Though I'm not sure how it wouldn't be able to use the command connect on a TCPObject even after re-downloading the base folder, that's just plain odd.

Well, deleting literally every file fixed the problem, but now I don't know what the problem was. This is a problem.

Which group of files did you delete (that wasnt deleted before) that made everything work again?

Badspot

  • Administrator
Code: [Select]
%
Starting server authentication...
base/server/mainServer.cs (2689): Unknown command connect.
  Object authTCPobj_Server(4291) authTCPobj_Server -> TCPObject -> SimObject

Ok, so the line in question is this
Code: [Select]
authTCPobj_Server.connect(authTCPobj_Server.site @":"@ authTCPobj_Server.port);
"connect" is a c++ console method of TCPObject.  I am pretty sure it is not possible to overwrite or package this function in any way via script, and it certainly isn't possible to make it go away completely and cause the "unknown command error".  The backtrace however confirms that it found authTCPobj_Server and knows that it's a TCPObject - this makes no sense.  The backtrace with the arrows is done in c++ using the same object it just tried to call the function on, so there's no way there could be two authTCPobj_Server objects getting confused. 

Assuming the console is legit and there's not something echoing completely fake messages to the console, then the executable is completely broken by the time it gets to this error.  My guess would be some earlier error is causing memory corruption. 

Quote
After disabling every mod other than RSM that was packaging onClientLeaveGame, I tried restarting the server again, but got a C++ buffer overflow error.
Do you have a list of mods you were using at this point?  If you can consistently get a buffer overflow then this is a good lead. 

-brown townysis-

I wasn't actually checking back on this thread after I figured out the cause, but it turned out what caused the first crash was this same issue. I'd tested that issue dozens of times without a complete corruption of Blockland before, so I don't have any clue how that caused the authentication to break.

Were you recycling AiClients?