Server crashed - Floating point exception

Request help for teeworlds-related subjects (mapping, servers, ..).
For client issues, see our repositories (https://github.com/ddnet/ddnet/issues).
Post Reply
FlushA
Posts: 57
Joined: Mon Jul 13, 2015 1:43 pm
Location: IR
Player profile: http://ddnet.tw/players/Sv3N/
Mapper profile: http://ddnet.tw/mappers/FlushA/
Clan: I.R.T

Server crashed - Floating point exception

Post by FlushA »

Hello,
My server when runned and after some hours get crashed and show this print

Floating point exception (core dumped)

how fix this problem to stop server crash
✟Տ℣ʒN✟
User avatar
deen
TECHNICAL Team
Posts: 3575
Joined: Mon May 05, 2014 2:30 pm
Player profile: https://ddnet.org/players/deen/
Discord: deen#5910

Re: Server crashed - Floating point exception

Post by deen »

Two possibilities:
  1. Find out how to make it crash and post the instructions, then a developer can fix it
  2. Compile your server with bam server_debug. Then either run it with gdb DDNet-Server_d or run it normally and open the core file with gdb afterwards
FlushA
Posts: 57
Joined: Mon Jul 13, 2015 1:43 pm
Location: IR
Player profile: http://ddnet.tw/players/Sv3N/
Mapper profile: http://ddnet.tw/mappers/FlushA/
Clan: I.R.T

Re: Server crashed - Floating point exception

Post by FlushA »

I compiled with server_sql_debug and runned DDNet-Server_sql_d
after some hours server crashed and show this

Segmentation fault (core dumped)
✟Տ℣ʒN✟
User avatar
deen
TECHNICAL Team
Posts: 3575
Joined: Mon May 05, 2014 2:30 pm
Player profile: https://ddnet.org/players/deen/
Discord: deen#5910

Re: Server crashed - Floating point exception

Post by deen »

You have the core file? It depends on your distribution where it is. Then you can run gdb ./DDNet-Server_sql_d core and write bt to get a backtrace.
FlushA
Posts: 57
Joined: Mon Jul 13, 2015 1:43 pm
Location: IR
Player profile: http://ddnet.tw/players/Sv3N/
Mapper profile: http://ddnet.tw/mappers/FlushA/
Clan: I.R.T

Re: Server crashed - Floating point exception

Post by FlushA »

after crash I write bt and show this codes

Code: Select all

Program received signal SIGFPE, Arithmetic exception.
0x000000000044eeee in CServer::GetAnnouncementLine (this=0x7ffff4de0010,
    pFileName=0x75a0b8 <g_Config+11960> "announcement.txt")
    at src/engine/server/server.cpp:2263
2263                                    Rand = rand() % v.size();
(gdb) bt
#0  0x000000000044eeee in CServer::GetAnnouncementLine (this=0x7ffff4de0010,
    pFileName=0x75a0b8 <g_Config+11960> "announcement.txt")
    at src/engine/server/server.cpp:2263
#1  0x00000000004ac4c2 in CGameContext::OnTick (this=0x7ffff7fb2010)
    at src/game/server/gamecontext.cpp:756
#2  0x000000000044c419 in CServer::Run (this=0x7ffff4de0010)
    at src/engine/server/server.cpp:1700
#3  0x000000000044ebab in main (argc=1, argv=0x7fffffffe178)
    at src/engine/server/server.cpp:2211
(gdb)
✟Տ℣ʒN✟
User avatar
deen
TECHNICAL Team
Posts: 3575
Joined: Mon May 05, 2014 2:30 pm
Player profile: https://ddnet.org/players/deen/
Discord: deen#5910

Re: Server crashed - Floating point exception

Post by deen »

Makes no sense to me, have you modified the source code?
FlushA
Posts: 57
Joined: Mon Jul 13, 2015 1:43 pm
Location: IR
Player profile: http://ddnet.tw/players/Sv3N/
Mapper profile: http://ddnet.tw/mappers/FlushA/
Clan: I.R.T

Re: Server crashed - Floating point exception

Post by FlushA »

Send source to your private message inbox,
please check there.
✟Տ℣ʒN✟
User avatar
deen
TECHNICAL Team
Posts: 3575
Joined: Mon May 05, 2014 2:30 pm
Player profile: https://ddnet.org/players/deen/
Discord: deen#5910

Re: Server crashed - Floating point exception

Post by deen »

I'm not going to check your source code for bugs.
FlushA
Posts: 57
Joined: Mon Jul 13, 2015 1:43 pm
Location: IR
Player profile: http://ddnet.tw/players/Sv3N/
Mapper profile: http://ddnet.tw/mappers/FlushA/
Clan: I.R.T

Re: Server crashed - Floating point exception

Post by FlushA »

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff3239700 (LWP 31060)]
0x000000000046bacc in CGameContext::Console (this=0x0)
    at src/game/server/gamecontext.h:100
100     src/game/server/gamecontext.h: No such file or directory.

gamecontext.h

line 100:

class IConsole *Console() { return m_pConsole; }
✟Տ℣ʒN✟
Chairn
Posts: 400
Joined: Sat Apr 11, 2015 5:05 pm
Player profile: http://ddnet.tw/players/Chairn/
Clan: QuintessenZ

Re: Server crashed - Floating point exception

Post by Chairn »

First bug is probably because v.size() returns 0, which is a forbidden operation.

Then you have null pointer, you probably access something that does not exist yet(if it crashes when games open).
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest