ddnet / ddnet7

DDNet port to TW 0.7
Other
6 stars 7 forks source link

Crash on server start in network_server.cpp:287 (errornous client id) #68

Open ChillerDragon opened 4 years ago

ChillerDragon commented 4 years ago

It depends on some config option. I did not find out yet which exactly caused it.

[2020-02-11 12:56:02][engine]: running on unix-linux-amd64
[2020-02-11 12:56:02][engine]: arch is little endian
[2020-02-11 12:56:02][storage]: couldn't open storage.cfg
[2020-02-11 12:56:02][storage]: using standard paths
[2020-02-11 12:56:02][storage]: added path '$USERDIR' ('/home/chiller/.teeworlds')
[2020-02-11 12:56:02][storage]: added path '$DATADIR' ('/usr/share/games/teeworlds/data')
[2020-02-11 12:56:02][storage]: added path '$CURRENTDIR' ('/home/chiller/spamsrv-test')
[2020-02-11 12:56:02][storage]: added path '$APPDIR' ('./bin')
[2020-02-11 12:56:02][console]: executing 'autoexec.cfg'
[2020-02-11 12:56:02][console]: executing 'servers/8330.cfg'
[2020-02-11 12:56:02][console]: executing 'ddrace.cfg'
[2020-02-11 12:56:02][console]: No such command: sv_gametype.
[2020-02-11 12:56:02][assert]: /home/chiller/git/ddnet7/src/engine/shared/network_server.cpp(287): errornous client id

Seems like it is a auth issue since this appears in the logs when the assert is removed:

[2020-02-11 12:52:35][server]: ClientID=0 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=1 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=2 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=3 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=4 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=5 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=6 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=7 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=8 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=9 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=10 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=11 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=12 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=13 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=14 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=15 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=16 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=17 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=18 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=19 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=20 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=21 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=22 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=23 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=24 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=25 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=26 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=27 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=28 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=29 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=30 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=31 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=32 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=33 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=34 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=35 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=36 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=37 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=38 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=39 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=40 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=41 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=42 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=43 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=44 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=45 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=46 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=47 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=48 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=49 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=50 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=51 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=52 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=53 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=54 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=55 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=56 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=57 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=58 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=59 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=60 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=61 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=62 with key=(null) logged out by key removal
[2020-02-11 12:52:35][server]: ClientID=63 with key=(null) logged out by key removal

UPDATE:

The issue is caused by this config:

sv_rcon_password "foo"
sv_rcon_password "bar"
ChillerDragon commented 4 years ago

Changing the password in game also seems to make trouble.

[2020-03-08 13:09:36][register]: chose 'master1.teeworlds.com' as master, sending heartbeats
[2020-03-08 13:09:40][register]: no firewall/nat problems detected
[2020-03-08 13:09:40][register]: server registered
[2020-03-08 13:18:36][server]: player is ready. ClientID=0 addr=<{XXX.XXX.XXX.XXX:64637}>
[2020-03-08 13:18:36][server]: 'Admin' -> 'Admin'
[2020-03-08 13:18:36][server]: player has entered the game. ClientID=0 addr=<{XXX.XXX.XXX.XXX:64637}>
[2020-03-08 13:18:36][sql]: Getting best time done
[2020-03-08 13:18:37][server]: ClientID=0 authed with key=default_admin (admin)
[2020-03-08 13:18:38][server]: ClientID=0 rcon='sv_rcon_mod_password <password>'
[2020-03-08 13:18:38][assert]: /opt/twserver/git/ddnet7/src/engine/shared/network_server.cpp(299): errornous client id

#0  dbg_break () at /opt/twserver/git/ddnet7/src/base/system.c:89
#1  0x00005555556507ae in dbg_assert_imp (filename=0x5555556751f0 "/opt/twserver/git/ddnet7/src/engine/shared/network_server.cpp", line=299, test=0, msg=0x5555556751d6 "errornous client id") at /opt/twserver/git/ddnet7/src/base/system.c:83
#2  0x0000555555644aaf in CNetServer::Send (this=0x7ffff69efee8, pChunk=0x7fffffffa400, Token=4294967295) at /opt/twserver/git/ddnet7/src/engine/shared/network_server.cpp:299
#3  0x00005555555a72df in CServer::SendMsg (this=0x7ffff62e8010, pMsg=0x7fffffffa480, Flags=1, ClientID=1) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:574
#4  0x00005555555accd1 in CServer::LogoutClient (this=0x7ffff62e8010, ClientID=1, pReason=0x555555660c07 "key update") at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:1784
#5  0x00005555555acf83 in CServer::LogoutKey (this=0x7ffff62e8010, Key=1, pReason=0x555555660c07 "key update") at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:1814
#6  0x00005555555ae983 in CServer::ConchainRconPasswordChangeGeneric (this=0x7ffff62e8010, Level=2, pCurrent=0x5555556df9c8 <g_Config+4072> "5SpYsU0N", pResult=0x7fffffffae30) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:2209
#7  0x00005555555aea15 in CServer::ConchainRconModPasswordChange (pResult=0x7fffffffae30, pUserData=0x7ffff62e8010, pfnCallback=0x555555625f2e <StrVariableCommand(IConsole::IResult*, void*)>, pCallbackUserData=0x5555556b18a0 <CConsole::CConsole(int)::Data>) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:2223
#8  0x000055555562fa09 in CConsole::Con_Chain (pResult=0x7fffffffae30, pUserData=0x55555579dcf0) at /opt/twserver/git/ddnet7/src/engine/shared/console.cpp:1118
#9  0x0000555555624d75 in CConsole::ExecuteLineStroked (this=0x555555764790, Stroke=1, pStr=0x7ffff6c0c9f4 "sv_rcon_mod_password <password>", ClientID=0, InterpretSemicolons=true) at /opt/twserver/git/ddnet7/src/engine/shared/console.cpp:452
#10 0x00005555556250b1 in CConsole::ExecuteLine (this=0x555555764790, pStr=0x7ffff6c0c9f4 "sv_rcon_mod_password <password>", ClientID=0, InterpretSemicolons=true) at /opt/twserver/git/ddnet7/src/engine/shared/console.cpp:515
#11 0x0000555555625129 in CConsole::ExecuteLineFlag (this=0x555555764790, pStr=0x7ffff6c0c9f4 "sv_rcon_mod_password <password>", FlagMask=4, ClientID=0, InterpretSemicolons=true) at /opt/twserver/git/ddnet7/src/engine/shared/console.cpp:523
#12 0x00005555555a9fd1 in CServer::ProcessClientPacket (this=0x7ffff62e8010, pPacket=0x7fffffffd8d0) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:1118
#13 0x00005555555ab1ba in CServer::PumpNetwork (this=0x7ffff62e8010) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:1376
#14 0x00005555555ac1e2 in CServer::Run (this=0x7ffff62e8010) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:1614
#15 0x00005555555af89a in main (argc=2, argv=0x7fffffffe4d8) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:2405
def- commented 4 years ago
Core was generated by `./DDNet7-Server -f servers/9305.cfg'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  dbg_break () at /home/teeworlds/src7/master/src/base/system.c:89
89              *((volatile unsigned*)0) = 0x0;
[Current thread is 1 (Thread 0x7fe6a2271980 (LWP 26459))]
(gdb) bt
#0  dbg_break () at /home/teeworlds/src7/master/src/base/system.c:89
#1  dbg_assert_imp (filename=<optimized out>, line=<optimized out>, 
    msg=msg@entry=0x55909d2dc0f4 "errornous client id", test=0) at /home/teeworlds/src7/master/src/base/system.c:83
#2  0x000055909d2c0b3c in dbg_assert_imp (
    filename=filename@entry=0x55909d2dc330 "/home/teeworlds/src7/master/src/engine/shared/network_server.cpp", 
    line=line@entry=299, test=<optimized out>, msg=msg@entry=0x55909d2dc0f4 "errornous client id")
    at /home/teeworlds/src7/master/src/base/system.c:80
#3  0x000055909d2b5264 in CNetServer::Send (this=this@entry=0x7fe6a1fed2e8, pChunk=pChunk@entry=0x7ffff0d401b0, 
    Token=Token@entry=4294967295) at /home/teeworlds/src7/master/src/engine/shared/network.h:345
#4  0x000055909d23d075 in CServer::SendMsg (this=0x7fe6a18e2010, pMsg=0x7ffff0d40220, Flags=<optimized out>, 
    ClientID=0) at /home/teeworlds/src7/master/src/engine/server/server.cpp:574
#5  0x000055909d26db8b in IServer::SendPackMsg<CNetMsg_Sv_CommandInfo> (this=0x7fe6a18e2010, 
    pMsg=pMsg@entry=0x7ffff0d40a70, Flags=Flags@entry=1, ClientID=ClientID@entry=0)
    at /home/teeworlds/src7/master/src/engine/shared/packer.h:27
#6  0x000055909d2692e3 in CGameContext::SendChatCommand (ClientID=0, pCommand=<optimized out>, this=0x7fe6a10b0010)
    at /home/teeworlds/src7/master/src/game/server/gamecontext.h:117
#7  CGameContext::SendChatCommands (this=this@entry=0x7fe6a10b0010, ClientID=ClientID@entry=0)
    at /home/teeworlds/src7/master/src/game/server/gamecontext.cpp:447
#8  0x000055909d269350 in CGameContext::OnClientEnter (this=0x7fe6a10b0010, ClientID=0)
    at /home/teeworlds/src7/master/src/game/server/gamecontext.cpp:929
#9  0x000055909d241d60 in CServer::ProcessClientPacket (this=this@entry=0x7fe6a18e2010, 
    pPacket=pPacket@entry=0x7ffff0d42960) at /home/teeworlds/src7/master/src/engine/server/server.h:84
#10 0x000055909d24259b in CServer::PumpNetwork (this=this@entry=0x7fe6a18e2010)
    at /home/teeworlds/src7/master/src/engine/server/server.cpp:1398
#11 0x000055909d242aa1 in CServer::Run (this=0x7fe6a18e2010)
    at /home/teeworlds/src7/master/src/engine/server/server.cpp:1680
#12 0x000055909d239d9e in main (argc=3, argv=0x7ffff0d436d8)
    at /home/teeworlds/src7/master/src/engine/server/server.cpp:2501
ChillerDragon commented 4 years ago

Seems like a different non rcon issue resulting in the same assert to trigger. Im still not sure if this assert is a good idea because all sorts of issues seem to end there and a simple return could fix that.