* bug#18914: 2.0.11 REPL server listens on 127.0.0.1 but not "localhost"
@ 2014-10-30 13:52 "Taylan Ulrich Bayırlı/Kammer"
2014-10-31 22:33 ` dsmich
2021-05-17 20:43 ` Taylan Kammer
0 siblings, 2 replies; 8+ messages in thread
From: "Taylan Ulrich Bayırlı/Kammer" @ 2014-10-30 13:52 UTC (permalink / raw)
To: 18914
After starting 'guile --listen', I can connect to it via 127.0.0.1 but
not "localhost": "Ncat: Connection refused." I don't know if
listening on "localhost" by default has any security implications?
Shell 1:
tub@taylan:~$ guile --listen
GNU Guile 2.0.11
Copyright (C) 1995-2014 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
scheme@(guile-user)>
Shell 2:
tub@taylan:~$ ncat localhost 37146
Ncat: Connection refused.
tub@taylan:~$ ncat 127.0.0.1 37146
GNU Guile 2.0.11
Copyright (C) 1995-2014 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
scheme@(guile-user)>
Taylan
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#18914: 2.0.11 REPL server listens on 127.0.0.1 but not "localhost"
2014-10-30 13:52 bug#18914: 2.0.11 REPL server listens on 127.0.0.1 but not "localhost" "Taylan Ulrich Bayırlı/Kammer"
@ 2014-10-31 22:33 ` dsmich
2014-10-31 22:49 ` Taylan Ulrich Bayırlı/Kammer
2021-05-17 20:43 ` Taylan Kammer
1 sibling, 1 reply; 8+ messages in thread
From: dsmich @ 2014-10-31 22:33 UTC (permalink / raw)
To: 18914, Taylan Ulrich Bayırlı/Kammer
---- "Taylan Ulrich
Bayırlı/Kammer" <taylanbayirli@gmail.com> wrote:
> After starting 'guile --listen', I can connect to it via 127.0.0.1 but
> not "localhost": "Ncat: Connection refused." I don't know if
> listening on "localhost" by default has any security implications?
I wonder, could localhost be resolving to your ethernet IP address? Or maybe resolving to an IPv6 address?
What does /etc/hosts say?
-Dale
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#18914: 2.0.11 REPL server listens on 127.0.0.1 but not "localhost"
2014-10-31 22:33 ` dsmich
@ 2014-10-31 22:49 ` Taylan Ulrich Bayırlı/Kammer
2014-11-01 20:56 ` dsmich
0 siblings, 1 reply; 8+ messages in thread
From: Taylan Ulrich Bayırlı/Kammer @ 2014-10-31 22:49 UTC (permalink / raw)
To: dsmich; +Cc: 18914
<dsmich@roadrunner.com> writes:
> I wonder, could localhost be resolving to your ethernet IP address?
> Or maybe resolving to an IPv6 address?
tub@taylan:~$ nslookup localhost
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: localhost
Address: 127.0.0.1
tub@taylan:~$
The local DNS server is dnsmasq.
> What does /etc/hosts say?
tub@taylan:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 taylan.uni.cx taylan
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
tub@taylan:~$
This is on Debian and I don't remember manually mucking with the file.
Were you not able to reproduce the bug?
Taylan
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#18914: 2.0.11 REPL server listens on 127.0.0.1 but not "localhost"
2014-10-31 22:49 ` Taylan Ulrich Bayırlı/Kammer
@ 2014-11-01 20:56 ` dsmich
2014-11-02 13:23 ` Taylan Ulrich Bayırlı/Kammer
0 siblings, 1 reply; 8+ messages in thread
From: dsmich @ 2014-11-01 20:56 UTC (permalink / raw)
To: Taylan Ulrich Bayırlı/Kammer; +Cc: 18914
---- "Taylan Ulrich Bayırlı/Kammer" <taylanbayirli@gmail.com> wrote:
> <dsmich@roadrunner.com> writes:
> > What does /etc/hosts say?
>
> tub@taylan:~$ cat /etc/hosts
> 127.0.0.1 localhost
> 127.0.1.1 taylan.uni.cx taylan
>
> # The following lines are desirable for IPv6 capable hosts
> ::1 localhost ip6-localhost ip6-loopback
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters
> tub@taylan:~$
>
> This is on Debian and I don't remember manually mucking with the file.
>
> Were you not able to reproduce the bug?
Seems to work fine on master
dsmith@stumpy:~$ ncat localhost 37146
GNU Guile 2.1.0.1583-7dba1
Copyright (C) 1995-2014 Free Software Foundation, Inc.
...
Maybe try strace, possibly limiting it with -e connect, to reveal what it's actually doing.
-Dale
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#18914: 2.0.11 REPL server listens on 127.0.0.1 but not "localhost"
2014-11-01 20:56 ` dsmich
@ 2014-11-02 13:23 ` Taylan Ulrich Bayırlı/Kammer
2016-06-22 8:32 ` Andy Wingo
0 siblings, 1 reply; 8+ messages in thread
From: Taylan Ulrich Bayırlı/Kammer @ 2014-11-02 13:23 UTC (permalink / raw)
To: dsmich; +Cc: 18914
<dsmich@roadrunner.com> writes:
> Seems to work fine on master
I just built from the master branch to be sure and can still reproduce.
> Maybe try strace, possibly limiting it with -e connect, to reveal what
> it's actually doing.
Not sure what I should be looking for, but there is no connect() call,
no occurrence of "localhost" in the whole output, but the following
snippet at some point:
...
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 8
fcntl(8, F_GETFL) = 0x2 (flags O_RDWR)
lseek(8, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
setsockopt(8, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(8, {sa_family=AF_INET, sin_port=htons(37146), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
mmap(NULL, 8720384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f35aaf81000
mprotect(0x7f35aaf81000, 4096, PROT_NONE) = 0
clone(child_stack=0x7f35ab7d0ff0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f35ab7d19d0, tls=0x7f35ab7d1700, child_tidptr=0x7f35ab7d19d0) = 2099
futex(0x7fffd27a33fc, FUTEX_WAIT_PRIVATE, 1, NULL) = 0
...
which is also the sole occurrence of '127.0.0.1'. Seems to come from
`make-tcp-server-socket' in module/system/repl/server.scm where it
passes INADDR_LOOPBACK, an integer whose value is 127.0.0.1 as a uint32,
to bind(). I don't know at what point it's normally supposed to make
the association with "localhost".
Any further help in how to debug this is appreciated. I have little
knowledge of the POSIX networking API.
Taylan
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#18914: 2.0.11 REPL server listens on 127.0.0.1 but not "localhost"
2014-11-02 13:23 ` Taylan Ulrich Bayırlı/Kammer
@ 2016-06-22 8:32 ` Andy Wingo
2016-07-12 7:17 ` Andy Wingo
0 siblings, 1 reply; 8+ messages in thread
From: Andy Wingo @ 2016-06-22 8:32 UTC (permalink / raw)
To: Taylan Ulrich "Bayırlı/Kammer"; +Cc: 18914
Hi,
Works for me, with Guile 2.0.11 also. Could it be that "nc" is trying
to connect to an IPv6 address?
Andy
On Sun 02 Nov 2014 14:23, taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") writes:
> <dsmich@roadrunner.com> writes:
>
>> Seems to work fine on master
>
> I just built from the master branch to be sure and can still reproduce.
>
>> Maybe try strace, possibly limiting it with -e connect, to reveal what
>> it's actually doing.
>
> Not sure what I should be looking for, but there is no connect() call,
> no occurrence of "localhost" in the whole output, but the following
> snippet at some point:
>
> ...
> socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 8
> fcntl(8, F_GETFL) = 0x2 (flags O_RDWR)
> lseek(8, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
> setsockopt(8, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
> bind(8, {sa_family=AF_INET, sin_port=htons(37146), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
> mmap(NULL, 8720384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f35aaf81000
> mprotect(0x7f35aaf81000, 4096, PROT_NONE) = 0
> clone(child_stack=0x7f35ab7d0ff0,
> flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID,
> parent_tidptr=0x7f35ab7d19d0, tls=0x7f35ab7d1700,
> child_tidptr=0x7f35ab7d19d0) = 2099
> futex(0x7fffd27a33fc, FUTEX_WAIT_PRIVATE, 1, NULL) = 0
> ...
>
> which is also the sole occurrence of '127.0.0.1'. Seems to come from
> `make-tcp-server-socket' in module/system/repl/server.scm where it
> passes INADDR_LOOPBACK, an integer whose value is 127.0.0.1 as a uint32,
> to bind(). I don't know at what point it's normally supposed to make
> the association with "localhost".
>
> Any further help in how to debug this is appreciated. I have little
> knowledge of the POSIX networking API.
>
> Taylan
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#18914: 2.0.11 REPL server listens on 127.0.0.1 but not "localhost"
2016-06-22 8:32 ` Andy Wingo
@ 2016-07-12 7:17 ` Andy Wingo
0 siblings, 0 replies; 8+ messages in thread
From: Andy Wingo @ 2016-07-12 7:17 UTC (permalink / raw)
To: Taylan Ulrich "Bayırlı/Kammer"; +Cc: 18914
On Wed 22 Jun 2016 10:32, Andy Wingo <wingo@pobox.com> writes:
> Works for me, with Guile 2.0.11 also. Could it be that "nc" is trying
> to connect to an IPv6 address?
Pretty sure that's what's going on here. When Guile makes server
sockets, it assumes it should listen on a single family/address/port
triple. Specifically for INADDR_LOOPBACK that's going to be IPv4
127.0.0.1 and not IPv6 at all. Probably we should use getaddrinfo if
the user supplies a "host", and use that to plumb through a list of
addresses on which to bind (and/or connect).
Andy
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#18914: 2.0.11 REPL server listens on 127.0.0.1 but not "localhost"
2014-10-30 13:52 bug#18914: 2.0.11 REPL server listens on 127.0.0.1 but not "localhost" "Taylan Ulrich Bayırlı/Kammer"
2014-10-31 22:33 ` dsmich
@ 2021-05-17 20:43 ` Taylan Kammer
1 sibling, 0 replies; 8+ messages in thread
From: Taylan Kammer @ 2021-05-17 20:43 UTC (permalink / raw)
To: 18914-done
I don't have access to the exact system anymore since it's been more than
6 years, but on a Debian with the exact same /etc/hosts I can't reproduce
the issue anymore. Since I was apparently the only one who could repro it
in the first place, I'm closing it now. :-)
Andy wrote:
> Could it be that "nc" is trying to connect to an IPv6 address?
Maybe that was the case on that system for some reason, despite the IPv4
address being on top in /etc/hosts and nslookup giving 127.0.0.1.
Maybe it was even a bug with the ncat I had installed, who knows.
--
Taylan
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-05-17 20:43 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-30 13:52 bug#18914: 2.0.11 REPL server listens on 127.0.0.1 but not "localhost" "Taylan Ulrich Bayırlı/Kammer"
2014-10-31 22:33 ` dsmich
2014-10-31 22:49 ` Taylan Ulrich Bayırlı/Kammer
2014-11-01 20:56 ` dsmich
2014-11-02 13:23 ` Taylan Ulrich Bayırlı/Kammer
2016-06-22 8:32 ` Andy Wingo
2016-07-12 7:17 ` Andy Wingo
2021-05-17 20:43 ` Taylan Kammer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).