server doesn't appear in game browser if bound to ip by -ip

If you've had any problems with Nexuiz, or would like to report bugs, post here.

Moderators: Nexuiz Moderators, Moderators

server doesn't appear in game browser if bound to ip by -ip

Postby Fuddl » Mon Oct 02, 2006 6:50 pm

hi there!

a friend of mine noticed, that a nexuiz server cannot be found in the nexuiz server browser if the server was bound to an ip by the -ip command line parameter.
i checked this and also noticed, that the parameter -ip makes the nexuiz server segfault on amd64.

i didn't take any further steps to debug this behaviour, perhaps it's an already known bug?

cheers - fuddl
Fuddl
Member
 
Posts: 36
Joined: Sat May 06, 2006 8:59 pm
Location: Germany, Mfr

Re: server doesn't appear in game browser if bound to ip by

Postby LordHavoc » Tue Oct 03, 2006 5:04 am

Fuddl wrote:hi there!

a friend of mine noticed, that a nexuiz server cannot be found in the nexuiz server browser if the server was bound to an ip by the -ip command line parameter.
i checked this and also noticed, that the parameter -ip makes the nexuiz server segfault on amd64.

i didn't take any further steps to debug this behaviour, perhaps it's an already known bug?

cheers - fuddl


The networking never sends the IP address directly, so use of -ip has no effect on networking except which socket address is bound (to select a network card)...

So I really can't imagine how this would prevent it from showing up on the server browser unless it is failing to bind that address (in which case no networking would work, and consequently no one could manually connect to it).

Regarding a segfault on amd64, that's interesting, could you run in gdb or ddd (graphical gdb frontend that isn't a pain to use) or the emacs gdb frontend if you prefer, and tell me or div0 what place it crashes?
LordHavoc
Site Admin
 
Posts: 191
Joined: Wed Mar 29, 2006 7:39 am
Location: western Oregon, USA

Postby tChr » Tue Oct 03, 2006 12:59 pm

It mught be that you are using a non standard port.. IIRC you wont find local games running on other port than 26000 unless they are public to a mster server.
the spice extend life!
the spice expand conciousness!
the spice is vital to space travel!
sooooo.. tell me what you want, waht you really-really want
I will proceed directly to the intravenous injection of hard drugs, please.
tChr
Forum addon
 
Posts: 1501
Joined: Tue Feb 28, 2006 9:11 pm
Location: Trondheim, Norway

Postby Fuddl » Wed Oct 04, 2006 10:40 pm

k, i compiled a non-stripped nexuiz-dedicated server binary and ran gdb on it, but, the output wasn't helpful to me - i really hope it helps you! the segfault applies to binaries compiled with both, gcc 3.4 and gcc 4.1. the following output is from a binary compiled with gcc 4.1

Code: Select all
fuddl@tittchen:~/saugsaug/nexuiz-2.1$ gdb ./nexuiz-dedicated core
GNU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".


warning: core file may not match specified executable file.
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Core was generated by `./nexuiz-dedicated -ip 192.168.1.20'.
Program terminated with signal 11, Segmentation fault.
#0  0x00002b7ed0a435e0 in strlen () from /lib/libc.so.6
(gdb) run -ip 192.168.1.20
Starting program: /home/fuddl/saugsaug/nexuiz-2.1/nexuiz-dedicated -ip 192.168.1.20
Console initialized.
Nexuiz Linux 00:25:13 Oct  5 2006
Trying to load library... "libz.so.1" - loaded.
Compressed files support enabled
Added packfile data/common-spog.pk3 (26 files)
Added packfile data/data20060905.pk3 (2867 files)

Program received signal SIGSEGV, Segmentation fault.
0x00002ae03b2ad5e0 in strlen () from /lib/libc.so.6
(gdb) bt
#0  0x00002ae03b2ad5e0 in strlen () from /lib/libc.so.6
#1  0x00002ae03b27f46c in vfprintf () from /lib/libc.so.6
#2  0x0000000000000001 in ?? ()
#3  0x00007fff6fc09070 in ?? ()
#4  0x00007fff6fc09000 in ?? ()
#5  0x00000000004f7f48 in qfont_table ()
#6  0x00007fff6fc09030 in ?? ()
#7  0x00007fff6fc08b20 in ?? ()
#8  0x00007fff6fc0d1d0 in ?? ()
#9  0x000000000050d770 in vm_m_numbuiltins ()
#10 0x00007fff6fc09050 in ?? ()
#11 0x0000000000000000 in ?? ()
(gdb)


also, here's the output of strace:

Code: Select all
fuddl@tittchen:~/saugsaug/nexuiz-2.1$ strace ./nexuiz-dedicated -ip 192.168.1.20
execve("./nexuiz-dedicated", ["./nexuiz-dedicated", "-ip", "192.168.1.20"], [/* 27 vars */]) = 0
uname({sys="Linux", node="tittchen", ...}) = 0
brk(0)                                  = 0x3b30000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab124e7f000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=78059, ...}) = 0
mmap(NULL, 78059, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2ab124e81000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libm.so.6", O_RDONLY)        = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320=\0\0"..., 640) = 640
fstat(3, {st_mode=S_IFREG|0644, st_size=535696, ...}) = 0
mmap(NULL, 1581480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2ab124f80000
mprotect(0x2ab125002000, 1049000, PROT_NONE) = 0
mmap(0x2ab125101000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x81000) = 0x2ab125101000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libdl.so.2", O_RDONLY)       = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\20\0\0"..., 640) = 640
fstat(3, {st_mode=S_IFREG|0644, st_size=10392, ...}) = 0
mmap(NULL, 1057000, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2ab125103000
mprotect(0x2ab125105000, 1048808, PROT_NONE) = 0
mmap(0x2ab125204000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x2ab125204000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\305"..., 640) = 640
lseek(3, 624, SEEK_SET)                 = 624
read(3, "\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\6\0\0\0"..., 32) = 32
fstat(3, {st_mode=S_IFREG|0755, st_size=1290408, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab125206000
mmap(NULL, 2349000, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2ab125207000
mprotect(0x2ab125328000, 1165256, PROT_NONE) = 0
mmap(0x2ab125427000, 106496, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x120000) = 0x2ab125427000
mmap(0x2ab125441000, 14280, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2ab125441000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab125445000
mprotect(0x2ab125427000, 94208, PROT_READ) = 0
arch_prctl(ARCH_SET_FS, 0x2ab1254456d0) = 0
munmap(0x2ab124e81000, 78059)           = 0
rt_sigaction(SIGFPE, {SIG_IGN}, {SIG_DFL}, 8) = 0
fcntl(0, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)
fcntl(0, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
brk(0)                                  = 0x3b30000
brk(0x3b51000)                          = 0x3b51000
fcntl(1, F_GETFL)                       = 0x8802 (flags O_RDWR|O_NONBLOCK|O_LARGEFILE)
fcntl(1, F_SETFL, O_RDWR|O_LARGEFILE)   = 0
write(1, "Console initialized.\n", 21Console initialized.
)  = 21
fcntl(1, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
fcntl(1, F_GETFL)                       = 0x8802 (flags O_RDWR|O_NONBLOCK|O_LARGEFILE)
fcntl(1, F_SETFL, O_RDWR|O_LARGEFILE)   = 0
write(1, "Nexuiz Linux 00:25:13 Oct  5 200"..., 34Nexuiz Linux 00:25:13 Oct  5 2006
) = 34
fcntl(1, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=78059, ...}) = 0
mmap(NULL, 78059, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2ab124e81000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/libz.so.1", O_RDONLY)    = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P \0\0\0"..., 640) = 640
fstat(3, {st_mode=S_IFREG|0644, st_size=90024, ...}) = 0
mmap(NULL, 1136808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2ab125446000
mprotect(0x2ab12545c000, 1046696, PROT_NONE) = 0
mmap(0x2ab12555b000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x2ab12555b000
close(3)                                = 0
munmap(0x2ab124e81000, 78059)           = 0
fcntl(1, F_GETFL)                       = 0x8802 (flags O_RDWR|O_NONBLOCK|O_LARGEFILE)
fcntl(1, F_SETFL, O_RDWR|O_LARGEFILE)   = 0
write(1, "Trying to load library... \"libz."..., 48Trying to load library... "libz.so.1" - loaded.
) = 48
fcntl(1, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
fcntl(1, F_GETFL)                       = 0x8802 (flags O_RDWR|O_NONBLOCK|O_LARGEFILE)
fcntl(1, F_SETFL, O_RDWR|O_LARGEFILE)   = 0
write(1, "Compressed files support enabled"..., 33Compressed files support enabled
) = 33
fcntl(1, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
open("data/", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 3
fstat(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
getdents64(3, /* 6 entries */, 4096)    = 184
getdents64(3, /* 0 entries */, 4096)    = 0
close(3)                                = 0
open("data/common-spog.pk3", O_RDONLY)  = 3
lseek(3, 0, SEEK_END)                   = 28724
lseek(3, 0, SEEK_SET)                   = 0
read(3, "PK\3\4\n\0\0\0\0\0\223k-,\0\0\0\0\0\0\0\0\0\0\0\0\t\0\25"..., 28724) = 28724
lseek(3, 26219, SEEK_SET)               = 26219
read(3, "PK\1\2\27\3\n\0\0\0\0\0\223k-,\0\0\0\0\0\0\0\0\0\0\0\0"..., 2483) = 2483
fcntl(1, F_GETFL)                       = 0x8802 (flags O_RDWR|O_NONBLOCK|O_LARGEFILE)
fcntl(1, F_SETFL, O_RDWR|O_LARGEFILE)   = 0
write(1, "Added packfile data/common-spog."..., 47Added packfile data/common-spog.pk3 (26 files)
) = 47
fcntl(1, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
open("data/data20060905.pk3", O_RDONLY) = 4
lseek(4, 0, SEEK_END)                   = 186821992
lseek(4, 186756435, SEEK_SET)           = 186756435
read(4, ",\0\0.\0\0\0\0\0\0\0\0\0 \200\244\201\271\3\34\ttextur"..., 65557) = 65557
mmap(NULL, 483328, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab124e81000
mmap(NULL, 233472, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab124ef7000
lseek(4, 186589113, SEEK_SET)           = 186589113
read(4, "PK\1\2\24\0\24\0\0\0\10\0\353\266%5\320n\366\16\324\34"..., 232857) = 232857
munmap(0x2ab124ef7000, 233472)          = 0
fcntl(1, F_GETFL)                       = 0x8802 (flags O_RDWR|O_NONBLOCK|O_LARGEFILE)
fcntl(1, F_SETFL, O_RDWR|O_LARGEFILE)   = 0
write(1, "Added packfile data/data20060905"..., 50Added packfile data/data20060905.pk3 (2867 files)
) = 50
fcntl(1, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
open("/home/fuddl/.nexuiz/data/", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 5
fstat(5, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
fcntl(5, F_SETFD, FD_CLOEXEC)           = 0
getdents64(5, /* 9 entries */, 4096)    = 280
getdents64(5, /* 0 entries */, 4096)    = 0
close(5)                                = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV (core dumped) +++
Process 20404 detached
Fuddl
Member
 
Posts: 36
Joined: Sat May 06, 2006 8:59 pm
Location: Germany, Mfr

Postby divVerent » Thu Oct 05, 2006 5:47 am

This doesn't look like a binary with debug info.

Can you try to "make sv-debug" and then run the resulting darkplaces-dedicated in gdb like this:

(gdb) run -nexuiz -ip 192.168.1.20
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby esteel » Thu Oct 05, 2006 6:43 am

You can also try a 'make clean' first. I once had a problem that 'make debug' did not create a debug binary. Either i made some error or make did not recompile everything correctly.
esteel
Site admin and forum addon
 
Posts: 3924
Joined: Wed Mar 01, 2006 8:27 am

Postby Fuddl » Thu Oct 05, 2006 9:37 am

hmpf, yeah... i know, not stripping isn't enough *selfslap*

k, compiled it unstripped and with debugging symbols and tried again. the backtrace looks the same as the segfault happens in the libc, not nexuiz itself.

here's my gdb session, with debugging symbols:

Code: Select all
fuddl@tittchen:~/saugsaug/nexuiz-2.1$ gdb ./darkplaces-dedicated core
GNU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".


warning: core file may not match specified executable file.
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Core was generated by `./darkplaces-dedicated -ip 192.168.1.20'.
Program terminated with signal 11, Segmentation fault.
#0  0x00002b98f138a5e0 in strlen () from /lib/libc.so.6
(gdb) break main
Breakpoint 1 at 0x402169: file sys_linux.c, line 243.
(gdb) run -ip 192.168.1.20
Starting program: /home/fuddl/saugsaug/nexuiz-2.1/darkplaces-dedicated -ip 192.168.1.20

Breakpoint 1, main (argc=3, argv=0x7fff9c7bffd8) at sys_linux.c:243
243             signal(SIGFPE, SIG_IGN);
(gdb) n
245             com_argc = argc;
(gdb) n
246             com_argv = (const char **)argv;
(gdb) n
249             fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);
(gdb) n
252             Host_Main();
(gdb) n
Console initialized.
Nexuiz Linux 11:26:28 Oct  5 2006
Trying to load library... "libz.so.1" - loaded.
Compressed files support enabled
Added packfile data/common-spog.pk3 (26 files)
Added packfile data/data20060905.pk3 (2867 files)

Program received signal SIGSEGV, Segmentation fault.
0x00002b1c0e6f85e0 in strlen () from /lib/libc.so.6
(gdb) bt
#0  0x00002b1c0e6f85e0 in strlen () from /lib/libc.so.6
#1  0x00002b1c0e6ca46c in vfprintf () from /lib/libc.so.6
#2  0x00007fff9c7bbb20 in ?? ()
#3  0x00002b1c0e6eeeb5 in _IO_default_xsputn () from /lib/libc.so.6
#4  0x00007fff9c7bbb10 in ?? ()
#5  0x00007fff9c7bbb90 in ?? ()
#6  0x00000000005707ee in gamemode_info ()
#7  0x00007fff9c7bb630 in ?? ()
#8  0x00007fff9c7bfd20 in ?? ()
#9  0x0000000000581770 in vm_m_numbuiltins ()
#10 0x00007fff9c7bbb60 in ?? ()
#11 0x0000000000000000 in ?? ()
(gdb)


looks like a strlen() call gets a wrong pointer, which leads to the segfault in libc
Fuddl
Member
 
Posts: 36
Joined: Sat May 06, 2006 8:59 pm
Location: Germany, Mfr

Postby divVerent » Thu Oct 05, 2006 10:54 am

Can you trace further? I cannot reproduce it.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby Fuddl » Thu Oct 05, 2006 8:59 pm

as i didn't find much out by gdb, i tried some old-school printf() debugging.

the engine seems to fail in NetConn_Init();, called from host.c:933... that's all i found out this evening, i don't have time for more debugging atm, sorry
Fuddl
Member
 
Posts: 36
Joined: Sat May 06, 2006 8:59 pm
Location: Germany, Mfr

Postby LordHavoc » Sat Oct 07, 2006 12:59 am

Fuddl wrote:as i didn't find much out by gdb, i tried some old-school printf() debugging.

the engine seems to fail in NetConn_Init();, called from host.c:933... that's all i found out this evening, i don't have time for more debugging atm, sorry


I'd recommend installing a -debuginfo package for your libc, then you should get some proper function names...

I do wonder about that backtrace because most of those are libc functions, and extremely few libc functions involve a callback of any kind, so the idea that they are in the stack inbetween DP functions makes me think it is a recursive error handler of some kind.
LordHavoc
Site Admin
 
Posts: 191
Joined: Wed Mar 29, 2006 7:39 am
Location: western Oregon, USA


Return to Nexuiz - Support / Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron