Subject: bug#23606: closed (Re: bug#23606: 25.1.50; "localhost" vs. "127.0.0.1")

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 24 May 2016 19:58:02 +0000

Your bug report

#23606: 25.1.50; "localhost" vs. "127.0.0.1"

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
23606: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23606
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#23606: 25.1.50; "localhost" vs. "127.0.0.1"
From: Ken Brown <[email-masked]>
To: Glenn Morris <[email-masked]>
Cc: [email-masked], Lars Magne Ingebrigtsen <[email-masked]>, Achim Gratz <[email-masked]>
Date: Tue, 24 May 2016 15:57:12 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

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

Subject: 25.1.50; "localhost" vs. "127.0.0.1"
From: Ken Brown <[email-masked]>
To: [email-masked]
Date: Mon, 23 May 2016 16:34:07 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

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)