Discussion:
[Freeciv-Dev] [bug #23392] We cannot start server from here
anonymous
2015-03-15 18:47:13 UTC
Permalink
URL:
<http://gna.org/bugs/?23392>

Summary: We cannot start server from here
Project: Freeciv
Submitted by: None
Submitted on: So 15 Mär 2015 18:47:12 UTC
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Status: None
Assigned to: None
Originator Email: ***@cknoke.de
Open/Closed: Open
Release: 2.5.0
Discussion Lock: Any
Operating System: GNU/Linux
Planned Release:

_______________________________________________________

Details:

Server won't start from freeciv-gtk3 client version 2.5.0
Says, you have to do it manually, sorry.
I checked before and after, that ports 555* are free.
freeciv-server starts ok and I can connect to my game
There is an 2.3.2 Freeciv installed form Wheezy on the system.

Christian


3: in client_start_server() [connectdlg_common.c::278]: Arguments to spawned
server: -p 5557 --bind localhost -q 1 -e --saves ~/.freeciv/saves --sc
Encodings: Data=UTF-8, Local=ISO-8859-1, Internal=UTF-8
This is the server for Freeciv version 2.5.0
You can learn a lot about Freeciv at http://www.freeciv.org/
3: [T000 - 2015/03/15 19:26:40] in log_init() [log.c::231]: log started
3: [T000 - 2015/03/15 19:26:40] in server_open_socket() [sernet.c::1082]:
Server attempting to listen on localhost:5557
0: [T000 - 2015/03/15 19:26:40] in server_open_socket() [sernet.c::1175]: bind
failed: Address already in use
0: bind failed: Address already in use
2: [T000 - 2015/03/15 19:26:40] (null)Backtrace:
2: Backtrace:
2: [T000 - 2015/03/15 19:26:40] (null) 0: freeciv-server() [0x8296c32]
2: 0: freeciv-server() [0x8296c32]
2: [T000 - 2015/03/15 19:26:40] (null) 1: freeciv-server(vdo_log+0xa8)
[0x829a66b]
2: 1: freeciv-server(vdo_log+0xa8) [0x829a66b]
2: [T000 - 2015/03/15 19:26:40] (null) 2: freeciv-server(do_log+0x40)
[0x829a6b3]
2: 2: freeciv-server(do_log+0x40) [0x829a6b3]
2: [T000 - 2015/03/15 19:26:40] (null) 3:
freeciv-server(server_open_socket+0x374) [0x813b1c3]
2: 3: freeciv-server(server_open_socket+0x374) [0x813b1c3]
2: [T000 - 2015/03/15 19:26:40] (null) 4: freeciv-server(srv_main+0x66)
[0x808019d]
2: 4: freeciv-server(srv_main+0x66) [0x808019d]
2: [T000 - 2015/03/15 19:26:40] (null) 5: freeciv-server(main+0xec1)
[0x8078945]
2: 5: freeciv-server(main+0xec1) [0x8078945]
2: [T000 - 2015/03/15 19:26:40] (null) 6:
/lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0xb74a5e46]
2: 6: /lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_start_main+0xe6)
[0xb74a5e46]
2: [T000 - 2015/03/15 19:26:40] (null) 7: freeciv-server() [0x8077771]
2: 7: freeciv-server() [0x8077771]
4: in tileset_free_tiles() [tilespec.c::5270]: tileset_free_tiles()
4: in unload_sprite() [tilespec.c::2151]: freeing sprite 'unit.select0'.
4: in unload_sprite() [tilespec.c::2151]: freeing sprite 'unit.select1'.

3: Arguments to spawned server: -p 5557 --bind localhost -q 1 -e --saves
~/.freeciv/saves --scenarios ~/.freeciv/scenarios -A none

socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(3, {sa_family=AF_INET, sin_port=htons(5557),
sin_addr=inet_addr("127.0.0.1")}, 16) = 0
listen(3, 256) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 4
setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(4, {sa_family=AF_INET, sin_port=htons(5557),
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EADDRINUSE (Address already in
use)
close(4) = 0
close(3) = 0
open("log", O_WRONLY|O_CREAT|O_APPEND, 0666) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=942787, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7735000
fstat64(3, {st_mode=S_IFREG|0644, st_size=942787, ...}) = 0
_llseek(3, 942787, [942787], SEEK_SET) = 0
time(NULL) = 1426444000
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0
write(3, "0: [T000 - 2015/03/15 19:26:40] "..., 110) = 110
write(1, "0: bind failed: Address already "..., 39) = 39
close(3) = 0






_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?23392>

_______________________________________________
Nachricht gesendet von/durch Gna!
http://gna.org/
anonymous
2015-03-15 19:31:50 UTC
Permalink
Follow-up Comment #1, bug #23392 (project freeciv):

Problem is the --bind localhost
freeciv-server won't start
--bind 127.0.0.1 does start

I have compiled with ipv6=no

~$ grep localhost /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback

Christian

_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?23392>

_______________________________________________
Nachricht gesendet von/durch Gna!
http://gna.org/
anonymous
2015-03-15 19:42:23 UTC
Permalink
Follow-up Comment #2, bug #23392 (project freeciv):

More problems with --bind, related or not.
freeciv-server --bind 127.0.0.1 restricts the server on lo
freeciv-gtk3 can see the server but won't connect: connection refused

Without the --bind it can see the server AND connect.

--quitidle 1 won't quit the server in 1 second

Christian

_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?23392>

_______________________________________________
Nachricht gesendet von/durch Gna!
http://gna.org/
Jacob Nevins
2015-03-16 00:13:01 UTC
Permalink
Post by anonymous
bind(3, {sa_family=AF_INET, sin_port=htons(5557),
sin_addr=inet_addr("127.0.0.1")}, 16) = 0
Post by anonymous
...
bind(4, {sa_family=AF_INET, sin_port=htons(5557),
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EADDRINUSE (Address already in
use)
So it's trying to bind to the same address twice.
Post by anonymous
Problem is the --bind localhost
--bind 127.0.0.1 does start
I have compiled with ipv6=no
~$ grep localhost /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
I can reproduce on Ubuntu 14.04 with Freeciv 2.5.0 compiled with
"--enable-ipv6=no" (but HAVE_GETADDRINFO defined) with /etc/hosts having
entries for "localhost" mapping to both 127.0.0.1 and ::1, but not with my
standard /etc/hosts (where localhost only names 127.0.0.1).

What system/distribution are you running on?

_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?23392>

_______________________________________________
Message sent via/by Gna!
http://gna.org/
anonymous
2015-03-16 07:24:34 UTC
Permalink
Post by Jacob Nevins
What system/distribution are you running on?
plain wheezy

Christian


_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?23392>

_______________________________________________
Nachricht gesendet von/durch Gna!
http://gna.org/
anonymous
2015-03-16 10:11:42 UTC
Permalink
Follow-up Comment #5, bug #23392 (project freeciv):

I can positively confirm that, with a ripped-out hosts file, the bug does not
occur. That is,

->-- /etc/hosts ----
127.0.0.1 localhost
--<-----------------

Server trace in this case shows the second bind call
Post by anonymous
bind(4, {sa_family=AF_INET, sin_port=htons(5557),
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EADDRINUSE (Address already in use)


missing.

Christian


_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?23392>

_______________________________________________
Nachricht gesendet von/durch Gna!
http://gna.org/
Jacob Nevins
2015-12-30 15:57:02 UTC
Permalink
Follow-up Comment #6, bug #23392 (project freeciv):

See also bug #24249.

_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?23392>

_______________________________________________
Message sent via/by Gna!
http://gna.org/

Continue reading on narkive:
Loading...