1 (edited by markand 2010-06-18 22:32:21)

Topic: [HELP] Segmentation fault while running a server

Hi there,

I just wanted to start a server on my FreeBSD 8.0-RELEASE (i386) and it randomly segfault.

[4c1bebe2][register]: choosen 'master1.teeworlds.com' as master, sending heartbeats
[4c1bebe6][register]: no firewall/nat problems detected
[4c1bebe6][register]: server registered
[4c1bebe9][game]: start round type='DM' teamplay='0'
Segmentation fault

Sometimes it's sooner sometimes it's later. This is my config file :

sv_name Malikania's teeworlds server
sv_rcon_password blablabla
sv_port 8303
sv_gametype dm
sv_warmup 10
sv_map dm1
sv_maprotation dm1 dm2 dm6 dm7 dm8 dm9
sv_max_clients 12
sv_scorelimit 20
sv_tournament_mode 0
sv_motd Bienvenue sur le serveur Malikania
sv_powerups 1
sv_timelimit 0
sv_spectator_slots 0
sv_teamdamage 1

Do I have something wrong ? I'm running teeworlds-0.5.2.

Kind regards.

2

Re: [HELP] Segmentation fault while running a server

This is what happened (with gdb)

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 100144]
0x282e7773 in memcpy () from /lib/libc.so.7
(gdb) bt
#0  0x282e7773 in memcpy () from /lib/libc.so.7
#1  0x080580a7 in ?? ()
#2  0x284c9be8 in ?? ()
#3  0x284c9ffe in ?? ()
#4  0xfffffffd in ?? ()
#5  0x0006c73e in ?? ()
#6  0xbfbfe9ec in ?? ()
#7  0x00000010 in ?? ()
#8  0x00000003 in ?? ()
#9  0x4208715b in ?? ()
#10 0x00000000 in ?? ()
#11 0x00000000 in ?? ()
#12 0x043c5ab7 in ?? ()
#13 0x00000000 in ?? ()
#14 0x00000010 in ?? ()
#15 0x28479014 in ?? ()
#16 0xbfbfe968 in ?? ()
#17 0x0804e3d6 in ?? ()
#18 0x284c9ff8 in ?? ()
#19 0x00000003 in ?? ()
#20 0x284c9bd8 in ?? ()
#21 0x00000420 in ?? ()
#22 0x0817d358 in __stderrp ()
#23 0x080729a7 in ?? ()
#24 0x284c9ff8 in ?? ()
#25 0x284c9bb0 in ?? ()
#26 0xbfbfe9ec in ?? ()
#27 0x284c9bd8 in ?? ()
#28 0x4c1bf16b in ?? ()
#29 0x00000000 in ?? ()
#30 0x043c5ab7 in ?? ()
#31 0x00000014 in ?? ()
#32 0xbfbfe908 in ?? ()
#33 0x08059704 in ?? ()
#34 0xbfbfe8c8 in ?? ()
#35 0x00000000 in ?? ()
#36 0x000000c8 in ?? ()
#37 0x00000032 in ?? ()
#38 0x00000001 in ?? ()
#39 0x4208715b in ?? ()
#40 0x00000000 in ?? ()
#41 0x00000000 in ?? ()
#42 0x00000000 in ?? ()
#43 0x0000f5a4 in ?? ()
#44 0xbfbfe928 in ?? ()
#45 0x0804a61f in ?? ()
#46 0xbfbfe8f8 in ?? ()
#47 0x00000000 in ?? ()
#48 0xbfbfe908 in ?? ()
#49 0x0806b67c in ?? ()
#50 0x6085b7f4 in ?? ()
#51 0x28497660 in ?? ()
#52 0x6085b7fd in ?? ()
#53 0x00048955 in ?? ()
#54 0x28479014 in ?? ()
#55 0x00000010 in ?? ()
#56 0xbfbfe928 in ?? ()
#57 0x0805905c in ?? ()
#58 0x00000000 in ?? ()
#59 0x043c5ab7 in ?? ()
#60 0xf908b7c0 in ?? ()
#61 0x28479014 in ?? ()
#62 0x28497660 in ?? ()
#63 0x00000007 in ?? ()
#64 0xbfbfe968 in ?? ()
#65 0x0804ea57 in ?? ()
#66 0x28497660 in ?? ()
#67 0x00000003 in ?? ()
#68 0x4c1bf16b in ?? ()
#69 0x0006c735 in ?? ()
#70 0x043c5ab7 in ?? ()
#71 0x4c1bf16b in ?? ()
#72 0x00022bc0 in ?? ()
#73 0x0804c8ad in ?? ()
#74 0x08348300 in __stderrp ()
#75 0x043c5ab7 in ?? ()
#76 0x043c5ab7 in ?? ()
#77 0x00000000 in ?? ()
#78 0x00000010 in ?? ()
#79 0x001958c0 in ?? ()
#80 0xbfbfec98 in ?? ()
#81 0x0805c4c5 in ?? ()
#82 0x28479014 in ?? ()
#83 0xbfbfe9ec in ?? ()
#84 0x08072924 in ?? ()
#85 0x00000000 in ?? ()
#86 0x00000000 in ?? ()
#87 0x0000206f in ?? ()
#88 0x00000008 in ?? ()
#89 0x00000000 in ?? ()
#90 0x00000000 in ?? ()
#91 0x00000000 in ?? ()
#92 0x00000000 in ?? ()
#93 0x00000001 in ?? ()
#94 0x6085b7e6 in ?? ()
#95 0x00048955 in ?? ()
#96 0x609144e6 in ?? ()
#97 0x00048955 in ?? ()
#98 0x00000000 in ?? ()
#99 0xffffffff in ?? ()
#100 0x00000000 in ?? ()
#101 0x00000000 in ?? ()
#102 0x00000000 in ?? ()
#103 0x00000000 in ?? ()
#104 0x00000000 in ?? ()
#105 0x00000000 in ?? ()
#106 0x00000000 in ?? ()
#107 0x00000000 in ?? ()
#108 0x00000000 in ?? ()
#109 0x00000000 in ?? ()
#110 0x00000000 in ?? ()
#111 0x00000000 in ?? ()
#112 0x00000000 in ?? ()
#113 0xffffffff in ?? ()
#114 0x00000001 in ?? ()
#115 0x443a4258 in ?? ()
#116 0x00000000 in ?? ()
#117 0x00000000 in ?? ()
#118 0x00000000 in ?? ()
#119 0x0000c446 in ?? ()
#120 0x00000002 in ?? ()
#121 0x00000008 in ?? ()
#122 0x284c9be8 in ?? ()
#123 0x00000000 in ?? ()
#124 0x280789ac in _rtld_error () from /libexec/ld-elf.so.1
Previous frame inner to this frame (corrupt stack?)

3 (edited by ghost 2010-06-19 07:23:16)

Re: [HELP] Segmentation fault while running a server

Could you compile a debug version of the server so we know exatly what happenes? Just do a

bam debug_release

and start

teeworlds_srv_d

//Edit: Your config seems to be good, however even a bad config should never cause segmentation faults....

4 (edited by markand 2010-06-19 08:00:05)

Re: [HELP] Segmentation fault while running a server

Hi

I tried to add debug_release to the BAM_TARGET FreeBSD port and it does :

--- Auto Configuration ---
compiler: gcc
stackprotector: yes
zlib: (in system path)
sdl-config: not found
sdl: not found (required)
saving configuration to 'config.bam'
--- 
bam: no target named 'debug_release'
bam: error during build
*** Error code 1

Stop in /tmp.
*** Error code 1

Stop in /tmp.

It needs to install every X.org and SDL libs, since it's a headless server, is there a debug for the server only ?

King regards

5

Re: [HELP] Segmentation fault while running a server

Have you tried the 0.5.2 version or a newer version from here: http://www.teeworlds.com/builds/   
I think the 0.5.2 version is still vulnerable regarding the "too small connless packet bug" where someone can send a too small connless packet to your server and would crash it (without require to login at all). It was used often a few weeks ago and was the reason that many server was stopped. I wondered myself why my server was running at first and stopped after a while (sometimes after minutes sometimes it run a hole day or longer). The "random" timefactor in this case was just human made.



Greetings,
Mo(2)

6

Re: [HELP] Segmentation fault while running a server

Try to host in local (sv_register 0) your server for one day, so that nobody can access it / crash it, to see if it's really related to this bug.
But I doubt that's the problem, as the crashing invalid packets are sent to all the serverlist given from the masterserver, and my servers didn't receive any recently.

Not Luck, Just Magic.

7

Re: [HELP] Segmentation fault while running a server

@Mo2: try reading before posting, he is using 0.5.2. But other than that, you might be right.
@markand: yes there is the possibilty to compile only server debug binary:

bam server_debug

8

Re: [HELP] Segmentation fault while running a server

ghost91 wrote:

@Mo2: try reading before posting, he is using 0.5.2. But other than that, you might be right.

The official 0.5.2 server is still vulnerable to this attack. Try getting your facts right before posting roll

A newer server version would end these crashes, if they are indeed caused by this bug, like Mo2 suggested.

aka cheesy

9

Re: [HELP] Segmentation fault while running a server

Since I run the teeworlds_srv_d now it does not crashes... If something change I tell you.

10

Re: [HELP] Segmentation fault while running a server

does the release version crash when u compile it yourself?

bam server_release
uptee - a simple web interface for hosting and maintaining teeworlds servers
teerace - a website gathering results of trusted Race-mod servers providing global ranking and statistics
*gV* rox ^^

11 (edited by markand 2010-06-19 12:49:53)

Re: [HELP] Segmentation fault while running a server

It has crashed with debug version :

[New LWP 100191]

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 100191]
0x282e7773 in memcpy () from /lib/libc.so.7
(gdb) bt
#0  0x282e7773 in memcpy () from /lib/libc.so.7
#1  0x08058137 in unpack_packet (buffer=0x284c9be8 "\001\003\037?\213\002?\213\002(", 
    size=3, packet=0x284c9bd8) at src/engine/e_network.c:231
#2  0x0804e3d6 in netserver_recv (s=0x28479014, chunk=0xbfbfe92c)
    at src/engine/e_network_server.c:321
#3  0x0805c555 in main (argc=Error accessing memory address 0x3ffcd906: Bad address.
) at src/engine/server/es_server.c:957
(gdb) bt full
#0  0x282e7773 in memcpy () from /lib/libc.so.7
No symbol table info available.
#1  0x08058137 in unpack_packet (buffer=0x284c9be8 "\001\003\037?\213\002?\213\002(", 
    size=3, packet=0x284c9bd8) at src/engine/e_network.c:231
No locals.
#2  0x0804e3d6 in netserver_recv (s=0x28479014, chunk=0xbfbfe92c)
    at src/engine/e_network_server.c:321
        addr = {type = 1, ip = "?\027\"\226", '\0' <repeats 11 times>, port = 54776}
        i = 0
        bytes = Variable "bytes" is not available.

12

Re: [HELP] Segmentation fault while running a server

This is a known bug. Please use a later version for your server.
The latest source you can download here (you can compile it with this bam version).

Remember the 80s - good times smile

13

Re: [HELP] Segmentation fault while running a server

Okay, are you planning a new release soon ? (then I can update the FreeBSD port)

Cheers.

14

Re: [HELP] Segmentation fault while running a server

There is no official date, but if you subscribe to the mailing list and join the IRC channel (#teeworlds-dev / irc.quakenet.org) you can get a closer look to the development's status.

15 (edited by erd 2010-06-24 15:12:59)

Re: [HELP] Segmentation fault while running a server

Or you could fix the issue yourself if you want to stick with 0.5.2 for now, there are just a few lines which needs to be changed: http://www.teeworlds.com/track/teeworlds/changeset/2009

16

Re: [HELP] Segmentation fault while running a server

erd wrote:

Or you could fix the issue yourself if you want to stick with 0.5.3 for now, there are just a few lines which needs to be changed: http://www.teeworlds.com/track/teeworlds/changeset/2009

Can I apply this path to the current 0.5.2 version to the FreeBSD port ? (then everybody can live with it until 0.5.3 is released).

Kind regards.