Core was generated by
./DDRace64-Server_sql -f servers/block.cfg'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000055dd4e07e217 in CSqlConnector::ConnectSqlServer (this=this@entry=0x7fa8e60dcc50, ReadOnly=true)
at /home/teeworlds/src/master/src/engine/server/sql_connector.cpp:25
25 for (int i = ReachableServer, ID = ReachableServer; i < ReachableServer + NumServers && SqlServer(i % NumSe...
Core was generated by
./DDRace64-Server_sql -f servers/8314.cfg'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 std::shared_count::operator= (r=..., this=)
at /usr/include/c++/8/bits/shared_ptr_base.h:1078
1078 class shared_ptr
[Current thread is 1 (Thread 0x7ffaff2fcdc0 (LWP 11112))]
(gdb) bt
#0 std::shared_count::operator= (__r=..., this=)
at /usr/include/c++/8/bits/shared_ptr_ba...CNetMsg_Sv_ClientInfo
on the client side where m_Local is 1?*(unsigned int *)mem = 0xffffffff;
if the mem was signed char type-fsanitize=type
GameServer()->OnShutdown(true);
(which would wait on running threads to exit)
wasn't called if an error occured in the server init. Therefore CServer
was
freed before the init-thread finished executing, causing a use after free from
CSqlConnector::ms_ppSqlReadServers
pointing to CServer->m_apSqlReadServers
.
Fixes #2271
Note that the server exits when creating tables failed. Since the tables are created by default, it has to be disabled explicitly (e.g. `add_sqlserver r teewo...add_sqlserver r teeworlds record teeworlds PASSWORD "localhost" 3306 0
) if the servers should start even when the database connection fails.