GNU bug report logs - #41234
27.0.91; Synchronous network requests are failing with “Name or service not known”

Previous Next

Package: emacs;

Reported by: Dmitry Alexandrov <dag <at> gnui.org>

Date: Wed, 13 May 2020 15:01:02 UTC

Severity: normal

Merged with 40748

Found in versions 27.0.91, 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 41234 in the body.
You can then email your comments to 41234 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#41234; Package emacs. (Wed, 13 May 2020 15:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dmitry Alexandrov <dag <at> gnui.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 13 May 2020 15:01:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Alexandrov <dag <at> gnui.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.91; Synchronous network requests are failing with
 “Name or service not known”
Date: Wed, 13 May 2020 15:42:04 +0300
[Message part 1 (text/plain, inline)]
Dear maintainers,

Iʼm not sure whether that a bugreport or a support request, I hope you will excuse me for opting for the former.

Basically, I have an instance of Emacs 27 — rev. aea1b4db72 — a head of emacs-27 from about two weeks ago, which, have been running for that time, is failing to resolve any remote hostname synchronously (which, for instance, Gnus normally does), while asynchronous requests (as in ‘url-retrieve’) are still working fine.

A newly started instance of the same Emacs does not demonstrate the issue.  And alas, despite being almost convinced, that I had already met this problem before, I cannot say how exactly to reproduce it.

However, I suppose, the fact, that this is by no means a pristine configuration is not much relevant, since the error goes down to C sources, namely to ‘make-network-process’:

	(make-network-process :name " *net-test*"
						  :buffer (get-buffer-create " *net-test*")
						  :host "gnu.org" :service 80
						  :nowait nil)
	;; Debugger entered--Lisp error: (error "gnu.org/80 Name or service not known")

More specifically, a call to getaddrinfo() in ‘network_lookup_address_info_1’ returns EAI_NONAME.

Could it be a problem in GNU Emacs, or have I broken my system somehow?

-- 
In GNU Emacs 27.0.91 (build 2, x86_64-pc-linux-gnu)
 of 2020-04-30 built on nora
Repository revision: aea1b4db72df92595a3f642d18bf57254d74772b
Repository branch: emacs-27-nightly
System Description: Debian GNU/Linux 10 (buster)

Configured using:
 'configure --with-x-toolkit=no'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB OLDXMENU X11 XDBE XIM MODULES THREADS LIBSYSTEMD PDUMPER LCMS2 GMP
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41234; Package emacs. (Fri, 15 May 2020 13:16:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Alexandrov <dag <at> gnui.org>
To: 41234 <at> debbugs.gnu.org
Subject: Re: bug#41234: 27.0.91; Synchronous network requests are failing
 with “Name or service not known”
Date: Fri, 15 May 2020 16:05:01 +0300
[Message part 1 (text/plain, inline)]
FWIW, strace suggests, that the problematic Emacs process is trying to connect to an outdated nameserver (from a LAN this machine was connected once):

	…
	openat(AT_FDCWD, "/etc/hosts", O_RDONLY|O_CLOEXEC) = 12
	lseek(12, 0, SEEK_CUR)                  = 0
	fstat(12, {st_mode=S_IFREG|0644, st_size=184, ...}) = 0
	read(12, "127.0.0.1\tlocalhost\n127.0.1.1\tno"..., 4096) = 184
	lseek(12, 0, SEEK_CUR)                  = 184
	read(12, "", 4096)                      = 0
	close(12)                               = 0
	socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 12
	connect(12, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, 16) = 0
	gettimeofday({tv_sec=1589546464, tv_usec=72520}, NULL) = 0
	poll([{fd=12, events=POLLOUT}], 1, 0)   = 1 ([{fd=12, revents=POLLOUT}])
	sendto(12, "`\t\1\0\0\1\0\0\0\0\0\0\3gnu\3org\0\0\1\0\1", 25, MSG_NOSIGNAL, NULL, 0) = 25
	…

That is, that /etc/resolv.conf had not been reread (there is nothing about it in the skipped output above), while the instance that is working fine do check whether /etc/resolv.conf is updated:

	…
	stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=56, ...}) = 0
	openat(AT_FDCWD, "/etc/hosts", O_RDONLY|O_CLOEXEC) = 11
	lseek(11, 0, SEEK_CUR)                  = 0
	fstat(11, {st_mode=S_IFREG|0644, st_size=184, ...}) = 0
	read(11, "127.0.0.1\tlocalhost\n127.0.1.1\tno"..., 4096) = 184
	lseek(11, 0, SEEK_CUR)                  = 184
	read(11, "", 4096)                      = 0
	close(11)                               = 0
	socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 11
	connect(11, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.43.223")}, 16) = 0
	gettimeofday({tv_sec=1589546877, tv_usec=860209}, NULL) = 0
	poll([{fd=11, events=POLLOUT}], 1, 0)   = 1 ([{fd=11, revents=POLLOUT}])
	sendmmsg(11, [{msg_hdr={msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\314\255\1\0\0\1\0\0\0\0\0\0\3gnu\3org\0\0\1\0\1", iov_len=25}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, msg_len=25}, {msg_hdr={msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\10\270\1\0\0\1\0\0\0\0\0\0\3gnu\3org\0\0\34\0\1", iov_len=25}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, msg_len=25}], 2, MSG_NOSIGNAL) = 2
	…

How should I interpret this?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41234; Package emacs. (Thu, 02 Jul 2020 20:52:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Alexandrov <dag <at> gnui.org>
To: 41234 <at> debbugs.gnu.org
Subject: Re: bug#41234: 27.0.91; Synchronous network requests are failing
 with “Name or service not known”
Date: Thu, 02 Jul 2020 23:50:39 +0300
[Message part 1 (text/plain, inline)]
found 41234 28.0.50
thanks

Dmitry Alexandrov <dag <at> gnui.org> wrote:
> FWIW, strace suggests, that the problematic Emacs process is trying to connect to an outdated nameserver (from a LAN this machine was connected once):

> That is, that /etc/resolv.conf had not been reread...

Heh.  Emacs is able to lost running nscd(8) and fall back to outdated nameserver as well:

        …
	openat(AT_FDCWD, "/etc/hosts", O_RDONLY|O_CLOEXEC) = 7
	lseek(7, 0, SEEK_CUR)                   = 0
	fstat(7, {st_mode=S_IFREG|0644, st_size=184, ...}) = 0
	read(7, "127.0.0.1\tlocalhost\n127.0.1.1\tno"..., 4096) = 184
	lseek(7, 0, SEEK_CUR)                   = 184
	read(7, "", 4096)                       = 0
	close(7)                                = 0
	socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 7
	connect(7, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.43.245")}, 16) = 0
	gettimeofday({tv_sec=1593704775, tv_usec=183050}, NULL) = 0
	poll([{fd=7, events=POLLOUT}], 1, 0)    = 1 ([{fd=7, revents=POLLOUT}])
	sendto(7, "\254o\1\0\0\1\0\0\0\0\0\0\3gnu\3org\0\0\1\0\1", 25, MSG_NOSIGNAL, NULL, 0) = 25
        …

— thatʼs instead of:

        …
	socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 10
	connect(10, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = 0
	sendto(10, "\2\0\0\0\16\0\0\0\t\0\0\0gnus.org\0", 21, MSG_NOSIGNAL, NULL, 0) = 21
        …

in a freshly started Emacs instance.

Perhaps, I have to try another workaround.
[signature.asc (application/pgp-signature, inline)]

bug Marked as found in versions 28.0.50. Request was from Dmitry Alexandrov <dag <at> gnui.org> to control <at> debbugs.gnu.org. (Thu, 02 Jul 2020 20:52:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41234; Package emacs. (Mon, 20 Jul 2020 10:54:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dmitry Alexandrov <dag <at> gnui.org>
Cc: 41234 <at> debbugs.gnu.org
Subject: Re: bug#41234: 27.0.91; Synchronous network requests are failing
 with “Name or service not known”
Date: Mon, 20 Jul 2020 12:53:12 +0200
Dmitry Alexandrov <dag <at> gnui.org> writes:

> 	(make-network-process :name " *net-test*"
> 						  :buffer (get-buffer-create " *net-test*")
> 						  :host "gnu.org" :service 80
> 						  :nowait nil)
> 	;; Debugger entered--Lisp error: (error "gnu.org/80 Name or service not known")
>
> More specifically, a call to getaddrinfo() in ‘network_lookup_address_info_1’ returns EAI_NONAME.
>
> Could it be a problem in GNU Emacs, or have I broken my system somehow?

Dmitry Alexandrov <dag <at> gnui.org> writes:

> FWIW, strace suggests, that the problematic Emacs process is trying to
> connect to an outdated nameserver (from a LAN this machine was
> connected once):

[...]

> That is, that /etc/resolv.conf had not been reread (there is nothing
> about it in the skipped output above), while the instance that is
> working fine do check whether /etc/resolv.conf is updated:

Hm...   since the async lookups work, I guess this means that
getaddrinfo_a works, but getaddrinfo doesn't?  Which is very odd -- both
functions are supposed to update the name server etc in the same way, I
think?

So I'm not sure how this can be an Emacs bug -- as far as I know,
there's no way for libc clients to say "update all the DNS stuff now";
it's supposed to happen automatically when you call getaddrinfo.  (If
I'm wrong, somebody please correct me.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Forcibly Merged 40748 41234. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 29 Jul 2020 05:38:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41234; Package emacs. (Mon, 14 Jun 2021 14:03:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dmitry Alexandrov <dag <at> gnui.org>
Cc: 40748 <at> debbugs.gnu.org, 41234 <at> debbugs.gnu.org
Subject: Re: bug#40748: 28.0.50; Switching wifi networks hangs dns lookups
Date: Mon, 14 Jun 2021 16:02:02 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> So I'm not sure how this can be an Emacs bug -- as far as I know,
> there's no way for libc clients to say "update all the DNS stuff now";
> it's supposed to happen automatically when you call getaddrinfo.  (If
> I'm wrong, somebody please correct me.)

This was almost a year ago -- does anybody have any further input here?
If not, I'm not sure there's anything we can do from the Emacs side
here...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41234; Package emacs. (Thu, 23 Dec 2021 22:10:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 40748 <at> debbugs.gnu.org, Dmitry Alexandrov <dag <at> gnui.org>,
 41234 <at> debbugs.gnu.org
Subject: Re: bug#40748: 28.0.50; Switching wifi networks hangs dns lookups
Date: Thu, 23 Dec 2021 14:09:48 -0800
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> So I'm not sure how this can be an Emacs bug -- as far as I know,
>> there's no way for libc clients to say "update all the DNS stuff now";
>> it's supposed to happen automatically when you call getaddrinfo.  (If
>> I'm wrong, somebody please correct me.)
>
> This was almost a year ago -- does anybody have any further input here?
> If not, I'm not sure there's anything we can do from the Emacs side
> here...

I do not, and it doesn't seem to be happening any more! My bug can be
closed, but I'm not sure about 41234, which it's been merged with.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41234; Package emacs. (Fri, 24 Dec 2021 09:13:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 40748 <at> debbugs.gnu.org, Dmitry Alexandrov <dag <at> gnui.org>,
 41234 <at> debbugs.gnu.org
Subject: Re: bug#40748: 28.0.50; Switching wifi networks hangs dns lookups
Date: Fri, 24 Dec 2021 10:11:54 +0100
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> I do not, and it doesn't seem to be happening any more! My bug can be
> closed, but I'm not sure about 41234, which it's been merged with.

I think that bug report points to a problem somewhere else in the OS and
not in Emacs, so I'm closing this bug report.  If this is wrong, please
respond to the debbugs address and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 40748 <at> debbugs.gnu.org and Eric Abrahamsen <eric <at> ericabrahamsen.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 24 Dec 2021 09:13: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. (Fri, 21 Jan 2022 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 95 days ago.

Previous Next


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