GNU bug report logs -
#23606
25.1.50; "localhost" vs. "127.0.0.1"
Previous Next
Reported by: Ken Brown <kbrown <at> cornell.edu>
Date: Mon, 23 May 2016 20:35:01 UTC
Severity: normal
Found in version 25.1.50
Done: Ken Brown <kbrown <at> cornell.edu>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23606 in the body.
You can then email your comments to 23606 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23606
; Package
emacs
.
(Mon, 23 May 2016 20:35:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ken Brown <kbrown <at> cornell.edu>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 23 May 2016 20:35:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
The test echo-server-nowait in test/lisp/net/network-stream-tests.el
fails on Cygwin, but it passes if I create the client process using
"127.0.0.1" instead of "localhost":
diff --git a/test/lisp/net/network-stream-tests.el b/test/lisp/net/network-stream-tests.el
index c9b7cc7..80f6b9c 100644
--- a/test/lisp/net/network-stream-tests.el
+++ b/test/lisp/net/network-stream-tests.el
@@ -143,7 +143,7 @@ server-process-filter
(port (aref (process-contact server :local) 4))
(proc (make-network-process :name "foo"
:buffer (generate-new-buffer "*foo*")
- :host "localhost"
+ :host "127.0.0.1"
:nowait t
:service port)))
(should (eq (process-status proc) 'connect))
Further investigation shows that if "localhost" is used, then the
connection fails with ECONNREFUSED when the first addrinfo returned by
getaddrinfo is used, but it succeeds with the second. Since the client
socket is nonblocking in the test under discussion, the loop through the
addrinfos never gets to try the second one.
I notice that there are a couple of places in process.c where the code
makes a point of using "127.0.0.1" instead of "localhost", so I wonder
if we should just patch the test to do the same. Or do experts think
it's worth pursuing this further to find out why it makes a difference
on Cygwin?
In GNU Emacs 25.1.50.23 (x86_64-unknown-cygwin, GTK+ Version 3.18.9)
of 2016-05-23 built on desktop-new
Repository revision: d5f42ab6f06e1d468c6b92f2c1ef7b4d5f97ff84
Windowing system distributor 'The Cygwin/X Project', version 11.0.11802000
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Configured using:
'configure --with-modules 'CFLAGS=-g3 -O0''
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY
ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 MODULES
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message puny seq byte-opt gv bytecomp
byte-compile cl-extra help-mode cconv cl-loaddefs pcase cl-lib dired
dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache
epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev
obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face
macroexp files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23606
; Package
emacs
.
(Mon, 23 May 2016 20:58:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 23606 <at> debbugs.gnu.org (full text, mbox):
Ken Brown wrote:
> The test echo-server-nowait in test/lisp/net/network-stream-tests.el
> fails on Cygwin, but it passes if I create the client process using
> "127.0.0.1" instead of "localhost":
I see the same thing on RHEL 7.2, so this isn't Cygwin-specific.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23606
; Package
emacs
.
(Mon, 23 May 2016 21:07:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 23606 <at> debbugs.gnu.org (full text, mbox):
Ken Brown <kbrown <at> cornell.edu> writes:
> The test echo-server-nowait in test/lisp/net/network-stream-tests.el
> fails on Cygwin, but it passes if I create the client process using
> "127.0.0.1" instead of "localhost":
If it doesn't work on Cygwin, then perhaps the test should just be
disabled there.
> - :host "localhost"
> + :host "127.0.0.1"
There's one test for "localhost" and one for "127.0.0.1", and the point
of those tests are to test whether name resolution works, and to test
that connecting with an IP address works.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23606
; Package
emacs
.
(Mon, 23 May 2016 22:31:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 23606 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen wrote:
> If it doesn't work on Cygwin, then perhaps the test should just be
> disabled there.
It's not just Cygwin.
> There's one test for "localhost" and one for "127.0.0.1", and the point
> of those tests are to test whether name resolution works, and to test
> that connecting with an IP address works.
I think you mean echo-server-with-localhost and echo-server-with-ip?
Both those tests pass for me on RHEL 7.2.
This report is about echo-server-nowait, which fails if "localhost" is
used, for reasons that seem to be unrelated to what the test is actually
supposed to be for.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23606
; Package
emacs
.
(Tue, 24 May 2016 15:48:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 23606 <at> debbugs.gnu.org (full text, mbox):
Glenn Morris <rgm <at> gnu.org> writes:
> I think you mean echo-server-with-localhost and echo-server-with-ip?
> Both those tests pass for me on RHEL 7.2.
Ah, then it's probably OK to use the IP address in this test:
> This report is about echo-server-nowait, which fails if "localhost" is
> used, for reasons that seem to be unrelated to what the test is actually
> supposed to be for.
It does sound like a bug that it doesn't work, though, but that should
perhaps be a separate bug report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23606
; Package
emacs
.
(Tue, 24 May 2016 17:21:01 GMT)
Full text and
rfc822 format available.
Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):
Ken Brown writes:
> The test echo-server-nowait in test/lisp/net/network-stream-tests.el
> fails on Cygwin, but it passes if I create the client process using
> "127.0.0.1" instead of "localhost":
This could be a case where it makes a difference if the IPv6 (::1) or
IPv4 address is returned (first) for localhost. IIRC, Windows and
up-to-date Linux prefer IPv6 by default. If so, it would likely be
better to fix the parts of the code that assumes return of IPv4
addresses only.
Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23606
; Package
emacs
.
(Tue, 24 May 2016 18:36:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 23606 <at> debbugs.gnu.org (full text, mbox):
On 5/24/2016 1:20 PM, Achim Gratz wrote:
> Ken Brown writes:
>> The test echo-server-nowait in test/lisp/net/network-stream-tests.el
>> fails on Cygwin, but it passes if I create the client process using
>> "127.0.0.1" instead of "localhost":
>
> This could be a case where it makes a difference if the IPv6 (::1) or
> IPv4 address is returned (first) for localhost. IIRC, Windows and
> up-to-date Linux prefer IPv6 by default. If so, it would likely be
> better to fix the parts of the code that assumes return of IPv4
> addresses only.
You're right. In the test in question, IPv4 is specified for the server but not for the client. The test passes on Cygwin if I specify IPv4 for the client also:
diff --git a/test/lisp/net/network-stream-tests.el b/test/lisp/net/network-stream-tests.el
index c9b7cc7..f30c92a 100644
--- a/test/lisp/net/network-stream-tests.el
+++ b/test/lisp/net/network-stream-tests.el
@@ -145,6 +145,7 @@ server-process-filter
:buffer (generate-new-buffer "*foo*")
:host "localhost"
:nowait t
+ :family 'ipv4
:service port)))
(should (eq (process-status proc) 'connect))
(while (eq (process-status proc) 'connect)
Glenn, does this also fix the problem on RHEL 7.2?
Ken
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23606
; Package
emacs
.
(Tue, 24 May 2016 19:20:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 23606 <at> debbugs.gnu.org (full text, mbox):
Ken Brown wrote:
> Glenn, does this also fix the problem on RHEL 7.2?
Yes, thanks.
Reply sent
to
Ken Brown <kbrown <at> cornell.edu>
:
You have taken responsibility.
(Tue, 24 May 2016 19:58:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Ken Brown <kbrown <at> cornell.edu>
:
bug acknowledged by developer.
(Tue, 24 May 2016 19:58:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 23606-done <at> debbugs.gnu.org (full text, mbox):
On 5/24/2016 3:19 PM, Glenn Morris wrote:
> Ken Brown wrote:
>
>> Glenn, does this also fix the problem on RHEL 7.2?
>
> Yes, thanks.
I've installed this change and I'm closing the bug.
Ken
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 22 Jun 2016 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 9 years and 57 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.