Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash CServer::UpdateClientMapListEntries #66

Open
ChillerDragon opened this issue Feb 9, 2020 · 2 comments
Open

Crash CServer::UpdateClientMapListEntries #66

ChillerDragon opened this issue Feb 9, 2020 · 2 comments

Comments

@ChillerDragon
Copy link
Contributor

ChillerDragon commented Feb 9, 2020

Thread 1 "multimap_srv_d" received signal SIGSEGV, Segmentation fault.
0x00005555555a8cd1 in CServer::UpdateClientMapListEntries (this=0x7ffff62e9010) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:907
907					m_aClients[ClientID].m_pMapListEntryToSend = m_aClients[ClientID].m_pMapListEntryToSend->m_pNext;
#0  0x00005555555a8cd1 in CServer::UpdateClientMapListEntries (this=0x7ffff62e9010) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:907
#1  0x00005555555ac185 in CServer::Run (this=0x7ffff62e9010) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:1609
#2  0x00005555555af6fa in main (argc=2, argv=0x7fffffffe4e8) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:2386
Thread 1 "ddrace1_srv_d" received signal SIGSEGV, Segmentation fault.
0x00005555555a8cd1 in CServer::UpdateClientMapListEntries (this=0x7fff00000000) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:907
907					m_aClients[ClientID].m_pMapListEntryToSend = m_aClients[ClientID].m_pMapListEntryToSend->m_pNext;
#0  0x00005555555a8cd1 in CServer::UpdateClientMapListEntries (this=0x7fff00000000) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:907
#1  0x000cc2be5e442cf2 in ?? ()
#2  0x00007ffff62e9010 in ?? ()
#3  0x00000045f6c115e0 in ?? ()
#4  0x0000001200000005 in ?? ()
#5  0x00007fffffffe3a0 in ?? ()
#6  0x00005555555ac185 in CServer::Run (this=0x7fffffffdfe0) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:1609
#7  0x0000000000000000 in ?? ()
@ChillerDragon
Copy link
Contributor Author

It happend again these were the last log lines but I guess that is expected that it happend on rcon auth:

[2020-02-10 20:44:16][chat-command]: 10 used /emote happy 10
[2020-02-10 20:44:16][server]: ClientID=12 authed with key=default_mod (moderator)
[2020-02-10 20:44:18][server]: client dropped. cid=12 addr=<{unknown type 0}> reason='Error sending data'
[2020-02-10 20:44:18][game]: kill killer='12:0:XX' victim='12:0:XX' weapon=-3 special=0

@fokkonaut fokkonaut reopened this Feb 11, 2020
fokkonaut added a commit that referenced this issue Feb 11, 2020
@fokkonaut fokkonaut reopened this Feb 11, 2020
@ChillerDragon
Copy link
Contributor Author

ChillerDragon commented Feb 29, 2020

More gdb details:

(gdb) bt full
#0  0x00005555555a8d31 in CServer::UpdateClientMapListEntries (this=0x7ffff62e8010) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:907
        i = 24
        ClientID = 39
#1  0x00005555555ac1e9 in CServer::Run (this=0x7ffff62e8010) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:1609
        t = 1582987620935155
        NewTicks = 1
        ReportTime = 1582987622914926
        ReportInterval = 3
        Userdata = {m_pServer = 0x7ffff62e8010, m_aName = '\000' <repeats 31 times>}
        BindAddr = {type = 3, ip = '\000' <repeats 15 times>, port = 8302}
        aBuf = "version 0.7 802f1be60a05665f\000p_Less Server'\000\377\177\000\000\207\teUUU\000\000\000\060vUUU\000\000\220\343\377\377\377\177\000\000[wcUUU\000\000\060\002zU\003\000\000\000p.vUUU\000\000\276\000fUUU\000\000\000\070M@\377x\276H\000\343\377\377\377\177\000\000\025PbUUU\000\000\000ErUUU\000\000\020", '\000' <repeats 15 times>, ",\000\000\000\000\000\000\000ogs/multimap/logs/multimap_2020-02-27_16"...
#2  0x00005555555af75e in main (argc=2, argv=0x7fffffffe4f8) at /opt/twserver/git/ddnet7/src/engine/server/server.cpp:2386
        UseDefaultConfig = false
        pServer = 0x7ffff62e8010
        pKernel = 0x555555762550
        FlagMask = 36
        pEngine = 0x555555762e70
        pEngineMap = 0x5555557291a0
        pGameServer = 0x7ffff5ab7010
        pConsole = 0x555555763790
        pEngineMasterServer = 0x555555799740
        pStorage = 0x555555799d10
        pConfig = 0x55555579c530
        Ret = 32767
(gdb) info registers
rax            0x0                 0
rbx            0x8175ff            8484351
rcx            0x0                 0
rdx            0x7ffff62e8010      140737323630608
rsi            0x555555674204      93824993411588
rdi            0x7ffff6b394e0      140737332352224
rbp            0x7fffffffe170      0x7fffffffe170
rsp            0x7fffffffe150      0x7fffffffe150
r8             0xc3f               3135
r9             0x1                 1
r10            0x5e5a7964          1582987620
r11            0x7ffffffdcb20      140737488210720
r12            0x7ffff6c105e0      140737333233120
r13            0x7fffffffe4f0      140737488348400
r14            0x0                 0
r15            0x0                 0
rip            0x5555555a8d31      0x5555555a8d31 <CServer::UpdateClientMapListEntries()+281>
eflags         0x10202             [ IF RF ]
cs             0x33                51
ss             0x2b                43
ds             0x0                 0
es             0x0                 0
fs             0x0                 0
gs             0x0                 0

The code:

void CServer::UpdateClientMapListEntries()
{
	for(int ClientID = Tick() % MAX_RCONCMD_RATIO; ClientID < MAX_CLIENTS; ClientID += MAX_RCONCMD_RATIO)
	{
		if(m_aClients[ClientID].m_State != CClient::STATE_EMPTY && m_aClients[ClientID].m_Authed)
		{
			for(int i = 0; i < MAX_MAPLISTENTRY_SEND && m_aClients[ClientID].m_pMapListEntryToSend; ++i)
			{
				SendMapListEntryAdd(m_aClients[ClientID].m_pMapListEntryToSend, ClientID);
				m_aClients[ClientID].m_pMapListEntryToSend = m_aClients[ClientID].m_pMapListEntryToSend->m_pNext;
			}
		}
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants