GNU bug report logs - #31903
26.1; make-network-process :server t signals error with :nowait t instead of ignoring it

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Tue, 19 Jun 2018 18:01:02 UTC

Severity: minor

Tags: confirmed, fixed, patch

Found in versions 27.0.50, 26.1

Fixed in version 26.2

Done: Noam Postavsky <npostavs <at> gmail.com>

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 31903 in the body.
You can then email your comments to 31903 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31903; Package emacs. (Tue, 19 Jun 2018 18:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Helmut Eller <eller.helmut <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 19 Jun 2018 18:01:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Helmut Eller <eller.helmut <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; Server sockets with :nowait no longer work
Date: Tue, 19 Jun 2018 20:00:14 +0200
With a file test.el containing this code:

  (make-network-process :name "*test*"
                        :server t
                        :nowait t
                        :host 'local
                        :service t
                        :family 'ipv4)

and starting Emacs with: emacs -Q -batch -l test.el
prints:
  make server process failed: Success, :name, *test*, :server, t, :nowait, t, :host, local, :service, t, :family, ipv4

I'm not sure whether :nowait is supposed to work with server sockets,
but this used to work in Emacs 25.  Either way, the error message looks
pretty wrong.

elnode calls make-network-process[1] in a similar way, so it's quite
annoying that this has changed (and obviously no one tested elnode).

[1] https://github.com/nicferrier/elnode/blob/master/elnode.el


In GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2018-06-19 built on caladan
Repository revision: a9b720ac5030a4ca84e8ebe8436027da0468624c
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description: Debian GNU/Linux 9 (stretch)

Configured using:
 'configure --with-xpm=no --with-gif=no --with-tiff=no --with-jpeg=no
 --without-pop'

Configured features:
PNG SOUND DBUS GSETTINGS NOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31903; Package emacs. (Sun, 01 Jul 2018 15:49:02 GMT) Full text and rfc822 format available.

Message #8 received at 31903 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 31903 <at> debbugs.gnu.org
Subject: Re: bug#31903: 27.0.50; Server sockets with :nowait no longer work
Date: Sun, 01 Jul 2018 11:48:45 -0400
retitle 31903 26.1; make-network-process :server t signals error with :nowait t instead of ignoring it
found 31903 26.1
tags 31903 + confirmed
severity 31903 minor
quit

Helmut Eller <eller.helmut <at> gmail.com> writes:

> I'm not sure whether :nowait is supposed to work with server sockets,
> but this used to work in Emacs 25.  Either way, the error message looks
> pretty wrong.

As far as I can tell, Emacs 25 just ignores :nowait when :server is
passed.  We could change Emacs 26 do that as well, or we just make the
error official but give a more a sensible error message when passed both
:nowait and :server.





Changed bug title to '26.1; make-network-process :server t signals error with :nowait t instead of ignoring it' from '27.0.50; Server sockets with :nowait no longer work' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 01 Jul 2018 15:49:02 GMT) Full text and rfc822 format available.

bug Marked as found in versions 26.1. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 01 Jul 2018 15:49:02 GMT) Full text and rfc822 format available.

Added tag(s) confirmed. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 01 Jul 2018 15:49:02 GMT) Full text and rfc822 format available.

Severity set to 'minor' from 'normal' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 01 Jul 2018 15:49:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31903; Package emacs. (Mon, 02 Jul 2018 15:26:01 GMT) Full text and rfc822 format available.

Message #19 received at 31903 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: larsi <at> gnus.org, eller.helmut <at> gmail.com, 31903 <at> debbugs.gnu.org
Subject: Re: bug#31903: 27.0.50; Server sockets with :nowait no longer work
Date: Mon, 02 Jul 2018 18:25:18 +0300
> From: Noam Postavsky <npostavs <at> gmail.com>
> Date: Sun, 01 Jul 2018 11:48:45 -0400
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 31903 <at> debbugs.gnu.org
> 
> Helmut Eller <eller.helmut <at> gmail.com> writes:
> 
> > I'm not sure whether :nowait is supposed to work with server sockets,
> > but this used to work in Emacs 25.  Either way, the error message looks
> > pretty wrong.
> 
> As far as I can tell, Emacs 25 just ignores :nowait when :server is
> passed.  We could change Emacs 26 do that as well, or we just make the
> error official but give a more a sensible error message when passed both
> :nowait and :server.

Unless someone protests within the next few days, I think I prefer the
latter alternative.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31903; Package emacs. (Fri, 06 Jul 2018 00:14:01 GMT) Full text and rfc822 format available.

Message #22 received at 31903 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, eller.helmut <at> gmail.com, 31903 <at> debbugs.gnu.org
Subject: Re: bug#31903: 27.0.50; Server sockets with :nowait no longer work
Date: Thu, 05 Jul 2018 20:13:14 -0400
[Message part 1 (text/plain, inline)]
tags 31903 + patch
quit

Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Noam Postavsky <npostavs <at> gmail.com>
>> Date: Sun, 01 Jul 2018 11:48:45 -0400
>> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 31903 <at> debbugs.gnu.org
>> 
>> Helmut Eller <eller.helmut <at> gmail.com> writes:
>> 
>> > I'm not sure whether :nowait is supposed to work with server sockets,
>> > but this used to work in Emacs 25.  Either way, the error message looks
>> > pretty wrong.
>> 
>> As far as I can tell, Emacs 25 just ignores :nowait when :server is
>> passed.  We could change Emacs 26 do that as well, or we just make the
>> error official but give a more a sensible error message when passed both
>> :nowait and :server.
>
> Unless someone protests within the next few days, I think I prefer the
> latter alternative.

Okay, here is the patch for that, I will push to emacs-26 in a few days.

[v1-0001-Explicitly-reject-server-and-nowait-Bug-31903.patch (text/x-diff, inline)]
From a2ec0e58ab979b0a64a097ff0880cb7509d8aced Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Thu, 5 Jul 2018 19:37:28 -0400
Subject: [PATCH v1] Explicitly reject :server and :nowait (Bug#31903)

* src/process.c (Fmake_network_process): Explicitly check for and
signal an error when passed both :server and :nowait non-nil.  In
Emacs 25, :nowait would be ignored in this case, but as of Emacs 26.1
this gives an error, albeit an unclear one.  Also remove obsolete
comment regarding configurations lacking non-blocking mode, the
corresponding code was removed in 2012-11-17 "Assume POSIX 1003.1-1988
or later for fcntl.h."
---
 src/process.c | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/src/process.c b/src/process.c
index 7f6ea1261e..4d7a735652 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3890,12 +3890,15 @@ failed) connections may be logged in the server process's buffer.
   filter = Fplist_get (contact, QCfilter);
   sentinel = Fplist_get (contact, QCsentinel);
   use_external_socket_p = Fplist_get (contact, QCuse_external_socket);
+  Lisp_Object server = Fplist_get (contact, QCserver);
+  bool nowait = !NILP (Fplist_get (contact, QCnowait));
 
+  if (!NILP (server) && nowait)
+    error ("`:server' is incompatible with `:nowait'");
   CHECK_STRING (name);
 
   /* :local ADDRESS or :remote ADDRESS */
-  tem = Fplist_get (contact, QCserver);
-  if (NILP (tem))
+  if (!NILP (server))
     address = Fplist_get (contact, QCremote);
   else
     address = Fplist_get (contact, QClocal);
@@ -4009,7 +4012,7 @@ failed) connections may be logged in the server process's buffer.
     }
 
 #ifdef HAVE_GETADDRINFO_A
-  if (!NILP (host) && !NILP (Fplist_get (contact, QCnowait)))
+  if (!NILP (host) && nowait)
     {
       ptrdiff_t hostlen = SBYTES (host);
       struct req
@@ -4154,20 +4157,13 @@ failed) connections may be logged in the server process's buffer.
 
   set_network_socket_coding_system (proc, host, service, name);
 
-  /* :server BOOL */
-  tem = Fplist_get (contact, QCserver);
-  if (!NILP (tem))
-    {
-      /* Don't support network sockets when non-blocking mode is
-	 not available, since a blocked Emacs is not useful.  */
-      p->is_server = true;
-      if (TYPE_RANGED_INTEGERP (int, tem))
-	p->backlog = XINT (tem);
-    }
+  /* :server QLEN */
+  p->is_server = !NILP (server);
+  if (TYPE_RANGED_INTEGERP (int, server))
+    p->backlog = XINT (server);
 
   /* :nowait BOOL */
-  if (!p->is_server && socktype != SOCK_DGRAM
-      && !NILP (Fplist_get (contact, QCnowait)))
+  if (!p->is_server && socktype != SOCK_DGRAM && nowait)
     p->is_non_blocking_client = true;
 
   bool postpone_connection = false;
-- 
2.11.0


Added tag(s) patch. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 06 Jul 2018 00:14:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31903; Package emacs. (Tue, 10 Jul 2018 00:47:02 GMT) Full text and rfc822 format available.

Message #27 received at 31903 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, eller.helmut <at> gmail.com, 31903 <at> debbugs.gnu.org
Subject: Re: bug#31903: 27.0.50; Server sockets with :nowait no longer work
Date: Mon, 09 Jul 2018 20:46:02 -0400
tags 31903 fixed
close 31903 26.2
quit

Noam Postavsky <npostavs <at> gmail.com> writes:


> Okay, here is the patch for that, I will push to emacs-26 in a few days.

Done.

[1: 90d95b000c]: 2018-07-09 19:39:03 -0400
  Explicitly reject :server and :nowait (Bug#31903)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=90d95b000c37f7e85096716db96c4a940436f387




Added tag(s) fixed. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 10 Jul 2018 00:47:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 26.2, send any further explanations to 31903 <at> debbugs.gnu.org and Helmut Eller <eller.helmut <at> gmail.com> Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 10 Jul 2018 00:47:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 07 Aug 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 235 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.