Forum

> > CS2D > General > Segmentation fault when open serverlist
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Segmentation fault when open serverlist

7 replies
To the start Previous 1 Next To the start

old Segmentation fault when open serverlist

uaiek
User Off Offline

Quote
Hello,
I constantly get segmentation fault whenever I click "Find Servers".
The serverlist does appear, though. But then suddenly the game crashes.

I've tried this:
chmod 777 -R *

But no good at all.

Here is my linux box:
Linux resc 4.5.2-1-ARCH #1 SMP PREEMPT Thu Apr 21 18:21:27 CEST 2016 x86_64 GNU/Linux


And I've tried running with -opengl and -win and so on (though I know it won't work) and the problem still persists.

Running Windows executable with Wine works just fine.
But this bug still needs to be fixed.

Thanks.

old Re: Segmentation fault when open serverlist

GeoB99
Moderator Off Offline

Quote
Segmentation faults occur when the program tries to access a memory location which is not allowable to do so or it doesn't belong to it. The circumstances which lead to this may vary, some of them are the following:

• Faulty hardware / memory / driver;
• Wrong configured rights permission of a program (though it seems they're set up properly...);
• Missing libs (libraries) or they're outdated, corrupted;
• And so on...

Try to inspect the CS2D executable binary with strace command in the Terminal. The syntax of this command should be like this:
strace ./CounterStrike2D

It should give you lots of out-put and trace back the problem. Otherwise use another debugger such as gdb to get more information. The following syntax is:
gdb ./CounterStrike2D

Unlike strace, gdb also traces run-time errors or mistakes inside the program. Once you've did these steps write down here all the printed info from the Terminal. Oh, by the way you might want to run also ldd which checks what type of libs or DLLs a program is using. See if that helps.

old Re: Segmentation fault when open serverlist

uaiek
User Off Offline

Quote
Thanks, ZxC. I've followed your steps and my output are as follow :

Cut from strace :
Spoiler >


And from gdb : (DC didn't compile with -g so..)
Spoiler >


The ldd one didn't provide such informative information. There were just some graphics libraries...
Spoiler >


I don't think this approach is going to work since I don't have the source code.

Oh, I forgot to say that it used to work properly in the previous version. Only 1.0.0.2 has this problem.

old Re: Segmentation fault when open serverlist

Livia
User Off Offline

Quote
This is still an ongoing issue. Here's my backtrace on 4.7.2-1-ARCH:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#0  0xf79cb749 in inet_pton () from /usr/lib32/libc.so.6
#1  0xf79cbf34 in __res_vinit () from /usr/lib32/libc.so.6
#2  0xf79cc7ca in __res_ninit () from /usr/lib32/libc.so.6
#3  0xf79cef3d in __nss_hostname_digits_dots () from /usr/lib32/libc.so.6
#4  0xf79bf7ef in gethostbyname () from /usr/lib32/libc.so.6
#5  0x080c3bc9 in ?? ()
#6  0x081eace3 in ?? ()
#7  0x081e35be in ?? ()
#8  0x081aa28c in ?? ()
#9  0x0819156d in ?? ()
#10 0x0819bbd7 in ?? ()
#11 0x081356f4 in ?? ()
#12 0x080d5a1e in ?? ()
#13 0x080c9bf5 in ?? ()
#14 0x0804cd04 in ?? ()
#15 0xf78dd196 in __libc_start_main () from /usr/lib32/libc.so.6
#16 0x0804cc21 in ?? ()

Edit:
This only happens when I open the serverlist. All other parts of the game seem to work fine. It may be caused by some os library update rather than cs2d one. I managed to reproduce the issue on versions 1002, 1001, 0127 and 0126.

Edit 2:
I didn't post strace last time but it had segfaulted right after reading /etc/resolv.conf
I found out it will continue further if I remove ipv6 addresses from it and now it segfaults on /etc/hosts

Edit 3:
Guess what! After removing the offending ipv6 addresses from /etc/hosts the game doesn't crash anymore!

Edit 4:
Apparently if you pass an empty string to gethostbyname it will segfault.
edited 5×, last 13.09.16 02:21:24 pm

old Re: Segmentation fault when open serverlist

Nekomata
User Off Offline

Quote
It's working on Ubuntu(16.04) but seg. Issues on the VPS running debian(7.x). And this issue only rises with the version 1.0.0.2 dedicated, 1.0.0.1 works fine for me.
Thanks for the troubleshoot guide user Livia, will try it out.

old Re: Segmentation fault when open serverlist

Livia
User Off Offline

Quote
I made a small lib to patch gethostbyname() so the game doesn't segfault for me anymore. This is very strange behaviour and I'm suspecting some issues with libc rather than cs2d.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview