GNU bug report logs - #58520
Persistent failure to DNS-lookup hostname

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Stefan Monnier <monnier@HIDDEN>; dated Fri, 14 Oct 2022 16:22:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 58520 <at> debbugs.gnu.org:


Received: (at 58520) by debbugs.gnu.org; 18 Dec 2023 18:27:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 18 13:27:13 2023
Received: from localhost ([127.0.0.1]:33577 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rFIKe-0004tk-Pi
	for submit <at> debbugs.gnu.org; Mon, 18 Dec 2023 13:27:13 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:27092)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rFIKb-0004tJ-20
 for 58520 <at> debbugs.gnu.org; Mon, 18 Dec 2023 13:27:11 -0500
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 40C11444E42;
 Mon, 18 Dec 2023 13:27:01 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1702924020;
 bh=BWHlzyXB60I+zmlO5RbMxcZPMDhRedSe3vgY7UkAcqY=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=Mn1scBMKO1estoZFjIJD+X3UhwDKGIxk347JBy81f3SZmoiqH/dVjZaArazHaOCCJ
 QVNZb4QC3n4YgslbK2DVRrqeferuOtYv03FNLb5WCTS4XiElppQNfUm7p7APbfdsIA
 5LndFdJz7jj3WwTz3LJgrxymbrY5YsvmLnoCnv3zmd/DTt2F/6aFpV7oFF0DoR1fi6
 DsyuoueQSHg3W4xNg8g8eyMe85ptmHa7vS677yqAw7o35Tu+kWJuR6MvFIys3E9UQ4
 9g0NpeVjbf3jSN4+nRmN0WgoUiE/LDMamww6d2IQiDaORnAWySB6r6pg9L82wqo+49
 FGWlZSn0lqeEw==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0442A444E39;
 Mon, 18 Dec 2023 13:27:00 -0500 (EST)
Received: from pastel (65-110-221-238.cpe.pppoe.ca [65.110.221.238])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C8969120DC3;
 Mon, 18 Dec 2023 13:26:59 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#58520: Persistent failure to DNS-lookup hostname
In-Reply-To: <83r0jjiedz.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 18 Dec
 2023 19:55:52 +0200")
Message-ID: <jwvfrzztltk.fsf-monnier+emacs@HIDDEN>
References: <jwvwn92idgb.fsf@HIDDEN>
 <jwv1qfck120.fsf-monnier+emacs@HIDDEN> <875y2j9sm6.fsf@HIDDEN>
 <jwvjzqyq00t.fsf-monnier+emacs@HIDDEN> <87r0l6fzdv.fsf@HIDDEN>
 <jwvlebebj8y.fsf-monnier+emacs@HIDDEN> <87edh6fdvo.fsf@HIDDEN>
 <87fs09uf7z.fsf@HIDDEN> <jwvwmtccsxr.fsf-monnier+emacs@HIDDEN>
 <83v88vifju.fsf@HIDDEN> <jwvle9rtnpr.fsf-monnier+emacs@HIDDEN>
 <83r0jjiedz.fsf@HIDDEN>
Date: Mon, 18 Dec 2023 13:26:59 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.026 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 58520
Cc: 58520 <at> debbugs.gnu.org, eggert@HIDDEN, visuweshm@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> IOW, `res_init` only affects the running program.
> I didn't know that, sorry.  (I didn't know DNS can affect a single
> program.)

Basically, when the libc library parses the `/etc/resolv.conf` file to
figure out the IP address of the DNS server, it stores the result in
a local variable so as to speed up later DNS requests.
`res_init` forces it to reset that var.

It used to be indispensable to call it "all the time", but nowadays
glibc normally detects on its own when it needs to re-read
`/etc/resolv.conf`.

Except that in some weird corner case that Visuwesh and I are bumping
into, the "normally" fails to apply.  It's presumably a bug somewhere in
libc or in Emacs (or in some other library we use).

> If we want something like that in Emacs, we should probably find a
> more portable way of doing it.

I only used it to confirm the diagnostic, as well as as a crutch to
workaround the problem until it gets fixed.  So far I have not
considered including it in Emacs proper.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.

Message received at 58520 <at> debbugs.gnu.org:


Received: (at 58520) by debbugs.gnu.org; 18 Dec 2023 17:56:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 18 12:56:31 2023
Received: from localhost ([127.0.0.1]:33527 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rFHqw-0006o1-QV
	for submit <at> debbugs.gnu.org; Mon, 18 Dec 2023 12:56:31 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:52668)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rFHqr-0006nK-Jw
 for 58520 <at> debbugs.gnu.org; Mon, 18 Dec 2023 12:56:26 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rFHqg-0007XY-Ga; Mon, 18 Dec 2023 12:56:16 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=ekER5NkQI90MX2kEugvfcgnvTSL+1hStEayu3D1mP4A=; b=ml9NdW+iySSb
 ckv7IkNbKhZHCY66rhyzlKnIlRSHrxmysuncZg3DuBdYh5SRTdlp96KEI6A3mzcR7S88iNE33w5Gn
 qQ8mvWhlwq50ObG6InQZHYoncy2vdFbBDZ1Girsth/CMbhIlMZmNnGUhG9JcqNMWjunkcZ1+0qC5B
 eZNwz+EMkPouMxDn20OEYEL2U+9aS1oPNvTR9harQRG5CuEDE0GmuoyBuyEANudvjRUpf1ycnQ7WD
 5oo2ROQrtqWDdT+sDYIS+yjpn3PZHpietPGvn3u6uKNCI2MWrrAasvp3vKNONav24or6dL+ydvv9P
 tgpVI2ZKY5go4D3bLL1XsQ==;
Date: Mon, 18 Dec 2023 19:55:52 +0200
Message-Id: <83r0jjiedz.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <jwvle9rtnpr.fsf-monnier+emacs@HIDDEN> (message from Stefan
 Monnier on Mon, 18 Dec 2023 12:41:00 -0500)
Subject: Re: bug#58520: Persistent failure to DNS-lookup hostname
References: <jwvwn92idgb.fsf@HIDDEN>
 <jwv1qfck120.fsf-monnier+emacs@HIDDEN> <875y2j9sm6.fsf@HIDDEN>
 <jwvjzqyq00t.fsf-monnier+emacs@HIDDEN> <87r0l6fzdv.fsf@HIDDEN>
 <jwvlebebj8y.fsf-monnier+emacs@HIDDEN> <87edh6fdvo.fsf@HIDDEN>
 <87fs09uf7z.fsf@HIDDEN> <jwvwmtccsxr.fsf-monnier+emacs@HIDDEN>
 <83v88vifju.fsf@HIDDEN> <jwvle9rtnpr.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 58520
Cc: 58520 <at> debbugs.gnu.org, eggert@HIDDEN, visuweshm@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Stefan Monnier <monnier@HIDDEN>
> Cc: visuweshm@HIDDEN,  58520 <at> debbugs.gnu.org,  eggert@HIDDEN
> Date: Mon, 18 Dec 2023 12:41:00 -0500
> 
> IOW, `res_init` only affects the running program.

I didn't know that, sorry.  (I didn't know DNS can affect a single
program.)

If we want something like that in Emacs, we should probably find a
more portable way of doing it.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.

Message received at 58520 <at> debbugs.gnu.org:


Received: (at 58520) by debbugs.gnu.org; 18 Dec 2023 17:41:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 18 12:41:24 2023
Received: from localhost ([127.0.0.1]:33509 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rFHcJ-0003Us-6U
	for submit <at> debbugs.gnu.org; Mon, 18 Dec 2023 12:41:24 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:22561)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rFHc7-0003UA-6L
 for 58520 <at> debbugs.gnu.org; Mon, 18 Dec 2023 12:41:22 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 04D7280DAB;
 Mon, 18 Dec 2023 12:41:03 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1702921261;
 bh=jpi9v6z8YmTaYt0mqNISnUr3wkD970tzTjqKFQkW244=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=CJPNPJVJQYNNILj8vnHKpr7apmNl/1nYRoF65mVU9JsS0PHFw/ppw2tdVI+OaA9VS
 AmVxdqO/j5gjSbdSvsNH6GMgROvGIJjWiYV5mTZc37n10D8BIkecfEVO/NUzixdcn4
 dtt1eOK9MlJ9JDWpshOPBvjqm0fSNEKAgo9PUCI0VeWRI1ZZDy2eSLidIrNML2/etU
 Npb6dTUDK3dzmUS0Yv1+NPw4PapKSu3qXfCh7LyzJQzezEw0hpEXHMPRsTI9+Pap8v
 Jpc+mQrVGlk2iehO7+3PNehzD+1nI7AnTW6pH4aweeI0/c47U+kHnhcC/0bLr1Hkiz
 7sLhtuo2iFyyg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A8CC880C09;
 Mon, 18 Dec 2023 12:41:01 -0500 (EST)
Received: from pastel (65-110-221-238.cpe.pppoe.ca [65.110.221.238])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7D429120D8C;
 Mon, 18 Dec 2023 12:41:01 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#58520: Persistent failure to DNS-lookup hostname
In-Reply-To: <83v88vifju.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 18 Dec
 2023 19:30:45 +0200")
Message-ID: <jwvle9rtnpr.fsf-monnier+emacs@HIDDEN>
References: <jwvwn92idgb.fsf@HIDDEN>
 <jwv1qfck120.fsf-monnier+emacs@HIDDEN> <875y2j9sm6.fsf@HIDDEN>
 <jwvjzqyq00t.fsf-monnier+emacs@HIDDEN> <87r0l6fzdv.fsf@HIDDEN>
 <jwvlebebj8y.fsf-monnier+emacs@HIDDEN> <87edh6fdvo.fsf@HIDDEN>
 <87fs09uf7z.fsf@HIDDEN> <jwvwmtccsxr.fsf-monnier+emacs@HIDDEN>
 <83v88vifju.fsf@HIDDEN>
Date: Mon, 18 Dec 2023 12:41:00 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.066 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 58520
Cc: 58520 <at> debbugs.gnu.org, eggert@HIDDEN, visuweshm@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> Cc: 58520 <at> debbugs.gnu.org, Paul Eggert <eggert@HIDDEN>
>> Date: Sun, 17 Dec 2023 18:27:10 -0500
>> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
>> 
>> > P.S. It would be nice to have that patch that you mentioned that added a
>> >      function that fixes the broken requests.
>> 
>> I use the patch below.
>> When Emacs gets into this weird state, I do `M-: (res-init) RET` after
>> which I can connect again.
>
> Why do you need Emacs for that?  Write a small program that calls
> res_init, and that's it.

I don't understand what you mean.  The problem is in the running Emacs
session, not in the overall system.  I'd have to write a separate
program that goes and "pokes" inside my running Emacs process, which
sounds quite complicated.

IOW, `res_init` only affects the running program.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.

Message received at 58520 <at> debbugs.gnu.org:


Received: (at 58520) by debbugs.gnu.org; 18 Dec 2023 17:31:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 18 12:31:29 2023
Received: from localhost ([127.0.0.1]:33492 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rFHSj-00035S-Ln
	for submit <at> debbugs.gnu.org; Mon, 18 Dec 2023 12:31:29 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:32900)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rFHSh-000356-68
 for 58520 <at> debbugs.gnu.org; Mon, 18 Dec 2023 12:31:28 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rFHSY-00031F-5H; Mon, 18 Dec 2023 12:31:18 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=TNT6I86fmy1pMsV4zuCHBmYb2VUcezIm7HGX3phBOiw=; b=Dzd4v/vQpyjk
 YKGKhixWi9fZoFYX0POqiswxK2cOdyEiA9iHZs5d6wp4iFN+QbnOm6a5zBBt2mHTZSrRhHTmxVLVq
 Z5FbzmeV0wddFy+GVz8FkMYJcnxdEaMaV1YSw53EL5OvBH7wvm13++FIwn50NkhCqyjwHaY52i4hB
 eSH7hyi0eVL3Oz22G+nex9bPqZTw6jfGIMZclm+MKyfWgTUBayjzmp0BopNpv9tHeeLnUxQe+PiIv
 qWgGc4ZebwIHJj4//azasQWcVzXYB1o6HU7eFXSwxJo+9ZTGlEsuRDHkf3uXDqeWYiN778X5nh2h1
 r//loLO4bwnFlfmqdu0ZlA==;
Date: Mon, 18 Dec 2023 19:30:45 +0200
Message-Id: <83v88vifju.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <jwvwmtccsxr.fsf-monnier+emacs@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#58520: Persistent failure to DNS-lookup hostname
References: <jwvwn92idgb.fsf@HIDDEN>
 <jwv1qfck120.fsf-monnier+emacs@HIDDEN> <875y2j9sm6.fsf@HIDDEN>
 <jwvjzqyq00t.fsf-monnier+emacs@HIDDEN> <87r0l6fzdv.fsf@HIDDEN>
 <jwvlebebj8y.fsf-monnier+emacs@HIDDEN> <87edh6fdvo.fsf@HIDDEN>
 <87fs09uf7z.fsf@HIDDEN> <jwvwmtccsxr.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 58520
Cc: 58520 <at> debbugs.gnu.org, eggert@HIDDEN, visuweshm@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: 58520 <at> debbugs.gnu.org, Paul Eggert <eggert@HIDDEN>
> Date: Sun, 17 Dec 2023 18:27:10 -0500
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> > P.S. It would be nice to have that patch that you mentioned that added a
> >      function that fixes the broken requests.
> 
> I use the patch below.
> When Emacs gets into this weird state, I do `M-: (res-init) RET` after
> which I can connect again.

Why do you need Emacs for that?  Write a small program that calls
res_init, and that's it.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.

Message received at 58520 <at> debbugs.gnu.org:


Received: (at 58520) by debbugs.gnu.org; 17 Dec 2023 23:27:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 17 18:27:19 2023
Received: from localhost ([127.0.0.1]:59168 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rF0XX-0003o6-3Q
	for submit <at> debbugs.gnu.org; Sun, 17 Dec 2023 18:27:19 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:15073)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rF0XU-0003nt-HN
 for 58520 <at> debbugs.gnu.org; Sun, 17 Dec 2023 18:27:17 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7DEAB80D06;
 Sun, 17 Dec 2023 18:27:09 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1702855628;
 bh=NG2Ry5yBZBafGMWIaqUVPhLWPEqgmlc50f/RfuILK14=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=knKmhU134SZ8WZGzWmNfjAkw6NVmW4klrtGBJewH570Ki0YJ/FQppOfQwsF8SXPdD
 ijOVoFbapbzG0TmCraoxAvhHdYl+t4ka44rowRrGzJCbYEKqOVFKBwZIkIZ2VxRL9c
 q3BqYrGtj/a/n7GKVF2JVnYBLHYoRQ90x3O29G/8OhpD8RqCATtG248ZRBiE0+dImv
 yELzTZ0c1VEhKdxPwlMXKmFjw6cBiCoZxRpE4KulvTHJ986I8YX/2uzqBJZGLd+WzI
 +7t0MMLrOp53M9B4y1dratT2+RPd1ZQfgj15Uw7KuqoRxU/IWZW+9GjKrfIuT8xyLy
 gzQMNXWxL9C+w==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2625480CDE;
 Sun, 17 Dec 2023 18:27:08 -0500 (EST)
Received: from alfajor (65-110-221-238.cpe.pppoe.ca [65.110.221.238])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id EFF4D120DFD;
 Sun, 17 Dec 2023 18:27:07 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
Subject: Re: bug#58520: Persistent failure to DNS-lookup hostname
In-Reply-To: <87fs09uf7z.fsf@HIDDEN> (Visuwesh's message of "Mon, 11 Dec
 2023 17:24:24 +0530")
Message-ID: <jwvwmtccsxr.fsf-monnier+emacs@HIDDEN>
References: <jwvwn92idgb.fsf@HIDDEN>
 <jwv1qfck120.fsf-monnier+emacs@HIDDEN> <875y2j9sm6.fsf@HIDDEN>
 <jwvjzqyq00t.fsf-monnier+emacs@HIDDEN> <87r0l6fzdv.fsf@HIDDEN>
 <jwvlebebj8y.fsf-monnier+emacs@HIDDEN> <87edh6fdvo.fsf@HIDDEN>
 <87fs09uf7z.fsf@HIDDEN>
Date: Sun, 17 Dec 2023 18:27:10 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.047 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 58520
Cc: 58520 <at> debbugs.gnu.org, Paul Eggert <eggert@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> P.S. It would be nice to have that patch that you mentioned that added a
>      function that fixes the broken requests.

I use the patch below.
When Emacs gets into this weird state, I do `M-: (res-init) RET` after
which I can connect again.


        Stefan


diff --git a/src/process.c b/src/process.c
index 8bc922ab509..56773fe192e 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3770,6 +3769,33 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
   unbind_to (count, Qnil);
 }
 
+/* FIXME: Persistent DNS lookup errors!!
+ * Madhu <enometh@HIDDEN> suggests calling `res_init`, but that doesn't
+ * seem to exist any more in current glibc.
+ * Robert Pluim <rpluim@HIDDEN> suggests to use
+ *
+ *    tcpdump -i any -n udp and port 53
+ *
+ * to try and see what requests are being sent out (if any) to where.
+ * Eli suggests checking systemwide DNS caches, pointing to:
+ *
+ *   https://devconnected.com/how-to-flush-dns-cache-on-linux/
+ *   https://beebom.com/how-flush-dns-cache-linux/
+ *   https://linuxize.com/post/how-to-clear-the-dns-cache/
+ *
+ * Relevant:
+ * https://sourceware.org/bugzilla/show_bug.cgi?id=984
+ */
+
+#include <resolv.h>
+
+DEFUN ("res-init", Fres_init, Sres_init, 0, 0, 0, doc: /* Run `res_init`.  */)
+  (void)
+{
+  res_init ();
+  return Qnil;
+}
+
 /* Create a network stream/datagram client/server process.  Treated
    exactly like a normal process when reading and writing.  Primary
    differences are in status display and process deletion.  A network
@@ -8821,6 +8849,7 @@ syms_of_process (void)
   defsubr (&Sserial_process_configure);
   defsubr (&Smake_serial_process);
   defsubr (&Sset_network_process_option);
+  defsubr (&Sres_init);
   defsubr (&Smake_network_process);
   defsubr (&Sformat_network_address);
   defsubr (&Snetwork_lookup_address_info);





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.

Message received at 58520 <at> debbugs.gnu.org:


Received: (at 58520) by debbugs.gnu.org; 11 Dec 2023 11:54:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 11 06:54:53 2023
Received: from localhost ([127.0.0.1]:52787 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rCes9-0005iN-D6
	for submit <at> debbugs.gnu.org; Mon, 11 Dec 2023 06:54:53 -0500
Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:56658)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <visuweshm@HIDDEN>) id 1rCes4-0005i0-Uu
 for 58520 <at> debbugs.gnu.org; Mon, 11 Dec 2023 06:54:51 -0500
Received: by mail-pf1-x444.google.com with SMTP id
 d2e1a72fcca58-6ce934e9d51so2640631b3a.1
 for <58520 <at> debbugs.gnu.org>; Mon, 11 Dec 2023 03:54:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1702295668; x=1702900468; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=7WpQDDBXgP4gtUTIkBvTnTmk5zskCmbXALXU3wsGtcA=;
 b=ZJc9m9fsPNK7DsvLZ3k/vpS+xAJDUqjJfmzrR7veRGUU1BUmg8xLVzLDkz5YnoJomo
 tP5PikMg21O9SOh6YufNqAzBxnTaQh+F8vUcGLfzI1UH6e0/GvlCDuVmZOjV8ZtPDH4t
 Nd9LPwkA5oN5ylwUmIlDKqxtvDensrUMu3Q4dvZEUdVLV6m05HeVfsFKOXb/GGuan4Uk
 vB6nAz4zQPeObei9OTOX2AwudJqY2yESxeaGLP3SrI7wfWGb6qII9TKiLIamcWu+rfz8
 FYrlMtY/Ww+RMsWhnquSFCFuczSAab/HFW7U9Wt5mJcK+Jy72nqkK90urSLxef2uqvxQ
 RrwA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1702295668; x=1702900468;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=7WpQDDBXgP4gtUTIkBvTnTmk5zskCmbXALXU3wsGtcA=;
 b=cWPnuNL7OqrIMWlkwU+qioWHXembZYNaGXX/2P7TX/Wnvz8+Hcw+YbC4LODxLndIcy
 nepVcvlYnhX5gad4jJAbjvNp7A76HAQA0CGODE11fZXCyfucpCN2RyxoqxaK0Yd4BmW2
 +SIo1oRXrWMLN5utHtIQUm7ob1J/7K+wX8BgD8ey+kmImhuEKithZrZDgJw3WfmYtW7l
 1QQOpRUY6kJ+jnp5YO8ftDC2QXnKdpotqtFa8CVEEXRBIWq9KNS2vAAYTasj+eQPn4sY
 2ihGBDgKAoYu3sY2PPzPUL+Njz63qTyRh9pHGei+DNvRgPmzG8AOkhSdjVUBF/2VZN2W
 SCEg==
X-Gm-Message-State: AOJu0YzUmV9ddJqr0CneARHZVsDQ1FOG69jTQV7fmPAKLgzz1oxoHO8x
 ErcLUnyVoCGpk1fymBKucVs=
X-Google-Smtp-Source: AGHT+IEq8DJxW4oMN7MtXbH/k/fX6B730ZwlAURESgk7LxwbUUnzFIsNC8QHaF4m1Eld7zPowGARHA==
X-Received: by 2002:a05:6a20:9481:b0:18b:37b4:e6a7 with SMTP id
 hs1-20020a056a20948100b0018b37b4e6a7mr1578420pzb.7.1702295668215; 
 Mon, 11 Dec 2023 03:54:28 -0800 (PST)
Received: from localhost ([49.205.83.111]) by smtp.gmail.com with ESMTPSA id
 o26-20020a056a001b5a00b006ce70490445sm6087401pfv.85.2023.12.11.03.54.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 11 Dec 2023 03:54:27 -0800 (PST)
From: Visuwesh <visuweshm@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#58520: Persistent failure to DNS-lookup hostname
In-Reply-To: <87edh6fdvo.fsf@HIDDEN> (Visuwesh's message of "Sat, 04 Nov
 2023 08:01:23 +0530")
References: <jwvwn92idgb.fsf@HIDDEN>
 <jwv1qfck120.fsf-monnier+emacs@HIDDEN> <875y2j9sm6.fsf@HIDDEN>
 <jwvjzqyq00t.fsf-monnier+emacs@HIDDEN> <87r0l6fzdv.fsf@HIDDEN>
 <jwvlebebj8y.fsf-monnier+emacs@HIDDEN> <87edh6fdvo.fsf@HIDDEN>
Date: Mon, 11 Dec 2023 17:24:24 +0530
Message-ID: <87fs09uf7z.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 58520
Cc: 58520 <at> debbugs.gnu.org, Paul Eggert <eggert@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

[=E0=AE=9A=E0=AE=A9=E0=AE=BF =E0=AE=A8=E0=AE=B5=E0=AE=AE=E0=AF=8D=E0=AE=AA=
=E0=AE=B0=E0=AF=8D 04, 2023] Visuwesh wrote:

> [=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=A8=E0=AE=
=B5=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 03, 2023] Stefan Monnier v=
ia "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:
>
>>>      3 Contacting host: search.brave.com:443
>>>      4 search.brave.com/0 Temporary failure in name resolution
>>>      5 cdn.search.brave.com/0 Temporary failure in name resolution
>>>      6 cdn.search.brave.com/0 Temporary failure in name resolution
>> [...]
>>>     11 Contacting host: search.brave.com:443
>>>     12 cdn.search.brave.com/0 Temporary failure in name resolution
>>
>>> Line nos. 1 and 2 are from url.el requests.  3--6 and 11--12 is from(
>>> connection to search.brave.com from eww for an internet search.
>>
>> Seems like the accesses failed just as well, so my guess is that the
>> only thing different with EWW is that it falls back on a cache or
>> something like that.
>
> You might be right actually.  If I face this next time, I should search
> something other than "asd."  If only eww recorded the time at which the
> request was made...

And that fateful day arrived again.  AFAICT, eww does not seem to hold
any cache (at least that's what searching for the word "cache" leads me
to believe) but url.el does seem to have some caching mechanism.  I
evaluated the sexp

    (let ((url-cache-expire-time 0)) (url-cache-prune-cache))

and tried searching in eww again and it did that weird thing where the
request failed with the same error but still managed to render the page
in the end.

So far, I think that this issue has to do with the DNS changing and
Emacs somehow not being aware of it?  If I can trace the DNS server
being used in the end by Emacs that would help confirm this.  I will try
asking around to see if I can do this.

P.S. It would be nice to have that patch that you mentioned that added a
     function that fixes the broken requests.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.

Message received at 58520 <at> debbugs.gnu.org:


Received: (at 58520) by debbugs.gnu.org; 4 Nov 2023 02:32:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 03 22:32:11 2023
Received: from localhost ([127.0.0.1]:60157 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qz6SJ-0006Hh-7M
	for submit <at> debbugs.gnu.org; Fri, 03 Nov 2023 22:32:11 -0400
Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:48541)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <visuweshm@HIDDEN>) id 1qz6SG-0006HU-PA
 for 58520 <at> debbugs.gnu.org; Fri, 03 Nov 2023 22:32:09 -0400
Received: by mail-pl1-x642.google.com with SMTP id
 d9443c01a7336-1cc921a4632so19265505ad.1
 for <58520 <at> debbugs.gnu.org>; Fri, 03 Nov 2023 19:31:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1699065087; x=1699669887; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=oIFMUrg4hipH+Wd44jBs2v6ei7MajfRx27g5+JvoDZ0=;
 b=fKNTAR2wwouDJrYQU5mNCQQn938eYe57WgtNshTLHeuygWHajV50p9PZH//Np6ICR8
 66G14V0vrqhvdKrokl4rxoj+jt/cBmlqZTsuz+J5c9rM/mCtA6g0ld7DCk6qWnDkS8W4
 n/03WTkXlFQ0Mbfu48C+sBFN5r9cry/fBiYPtfHUCfirJnXLHnNthn7FzPqWCKbQNlK0
 Jx0UnyBROBMq6uWWJbjogSufOpZC12MYTx2F6LeEv0Y6UpVhWVOhxmMuVVMk9h/95VZj
 AE4nH4k2M8FOyP9Ju6FlKTkxJXbT8Svd+62EOLy4vYrI75U6D1v8k3Uix7ht9cEaqnJN
 XgBg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1699065087; x=1699669887;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=oIFMUrg4hipH+Wd44jBs2v6ei7MajfRx27g5+JvoDZ0=;
 b=pYGCUT147Mg7KAXMb1BcHaPMIYqZwzDmBx3RlDANUeW4Ww6anSKUD/JAyDzcwNP6Zs
 keSqS/UlR4Hj1owT43/zxwJwSC25kQR5mLCRMJGx60ttuDxdiLlqchPUJO308jXaD//w
 IMzUhQ+2/Mkw6imAaFDH61y0cv7A0nxv4qcpzoUr130zcFephzwsL7rgNT/p0qicEM73
 mtDmXbwWUZ7qbd1uqDCoOsv2/5jIskvc72p+End+gK3nAQJujOctIcXkwxhWc4NpyTTr
 NhlHTFTaHQpLfreaytQR88BK/E4QNhYi7skrJOY5EF5gVw/ZPeLzdcwps51IkNmB1wDF
 Zclw==
X-Gm-Message-State: AOJu0YylO1aJCg7/OkRVYXgij83fhuE2qMwVEOC2IsCZr51ZJM3WhJJt
 dB9nBd2W4PL/IWUsMTX9ugI=
X-Google-Smtp-Source: AGHT+IGn3jc77PXt+Ky4Pi27/MzV8Yn+7IYTf4tHd3m53nx4Yjit9/23i4ME7qc9DsjFmoocQhbzdg==
X-Received: by 2002:a17:903:2342:b0:1cc:4cf7:2cd with SMTP id
 c2-20020a170903234200b001cc4cf702cdmr19795915plh.33.1699065086791; 
 Fri, 03 Nov 2023 19:31:26 -0700 (PDT)
Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id
 b2-20020a170902bd4200b001cc0f6028b8sm1963980plx.106.2023.11.03.19.31.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 03 Nov 2023 19:31:26 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#58520: Persistent failure to DNS-lookup hostname
In-Reply-To: <jwvlebebj8y.fsf-monnier+emacs@HIDDEN> (Stefan Monnier via's
 message of "Fri, 03 Nov 2023 17:54:50 -0400")
References: <jwvwn92idgb.fsf@HIDDEN>
 <jwv1qfck120.fsf-monnier+emacs@HIDDEN> <875y2j9sm6.fsf@HIDDEN>
 <jwvjzqyq00t.fsf-monnier+emacs@HIDDEN> <87r0l6fzdv.fsf@HIDDEN>
 <jwvlebebj8y.fsf-monnier+emacs@HIDDEN>
Date: Sat, 04 Nov 2023 08:01:23 +0530
Message-ID: <87edh6fdvo.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 58520
Cc: 58520 <at> debbugs.gnu.org, Paul Eggert <eggert@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

[=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=A8=E0=AE=B5=
=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 03, 2023] Stefan Monnier via =
"Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

>>      3 Contacting host: search.brave.com:443
>>      4 search.brave.com/0 Temporary failure in name resolution
>>      5 cdn.search.brave.com/0 Temporary failure in name resolution
>>      6 cdn.search.brave.com/0 Temporary failure in name resolution
> [...]
>>     11 Contacting host: search.brave.com:443
>>     12 cdn.search.brave.com/0 Temporary failure in name resolution
>
>> Line nos. 1 and 2 are from url.el requests.  3--6 and 11--12 is from
>> connection to search.brave.com from eww for an internet search.
>
> Seems like the accesses failed just as well, so my guess is that the
> only thing different with EWW is that it falls back on a cache or
> something like that.

You might be right actually.  If I face this next time, I should search
something other than "asd."  If only eww recorded the time at which the
request was made...




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.

Message received at 58520 <at> debbugs.gnu.org:


Received: (at 58520) by debbugs.gnu.org; 3 Nov 2023 21:55:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 03 17:55:37 2023
Received: from localhost ([127.0.0.1]:59909 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qz28f-0002Hp-1K
	for submit <at> debbugs.gnu.org; Fri, 03 Nov 2023 17:55:37 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:9765)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1qz28d-0002HY-1H
 for 58520 <at> debbugs.gnu.org; Fri, 03 Nov 2023 17:55:36 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9B7EC100033;
 Fri,  3 Nov 2023 17:54:53 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1699048492;
 bh=eiRAxw9ZpuhUq74OMzONJOCcHvi16O7SCYY3z7gpRx8=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=piAKX0seDG7AfcgL0ol+604Yy0M2yUhKY0+zlNChq1XBuqV3pg1YAzSa70ppelTvr
 +CDT9pIuTStbG5GBHI/pLSe4conBC8XxuHXyA669eKj15f2ZlDllTKqNj2FOoECord
 vgyL375AKHhBUCaSwnLMMeX3zDyFtgN6JgP29fcV9D52ai+YAA3wOtrf+9GbXR40Ig
 nBLi5sJSpdivt5iq+Hzh0avZA478V7UA8otJ4Ek9i6ZXBa/BO9aWZsAscl/xjtbe0k
 xMrIqUv2JXyE4SslpdRTZ0aITuLZ4EOpt+SUyJ9AfnDUcc3yMCnOxivalisuh6cUQ+
 yZHzva/S+b7tA==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 65B1E100061;
 Fri,  3 Nov 2023 17:54:52 -0400 (EDT)
Received: from pastel (unknown [45.72.195.71])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3F08E120203;
 Fri,  3 Nov 2023 17:54:52 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
Subject: Re: bug#58520: Persistent failure to DNS-lookup hostname
In-Reply-To: <87r0l6fzdv.fsf@HIDDEN> (Visuwesh's message of "Sat, 04 Nov
 2023 00:16:52 +0530")
Message-ID: <jwvlebebj8y.fsf-monnier+emacs@HIDDEN>
References: <jwvwn92idgb.fsf@HIDDEN>
 <jwv1qfck120.fsf-monnier+emacs@HIDDEN> <875y2j9sm6.fsf@HIDDEN>
 <jwvjzqyq00t.fsf-monnier+emacs@HIDDEN> <87r0l6fzdv.fsf@HIDDEN>
Date: Fri, 03 Nov 2023 17:54:50 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.142 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 58520
Cc: 58520 <at> debbugs.gnu.org, Paul Eggert <eggert@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Unfortunately, I only experience this intermittently.

Same here :-(

> You may be right about that but I cannot exactly prove it because
> walking while carrying my laptop with its lid open for 2 km is not going
> to be fun.  :-)

Same here :-)

Tho I don't want to leave it ON during the night or those days where
I don't use it either.

>      3 Contacting host: search.brave.com:443
>      4 search.brave.com/0 Temporary failure in name resolution
>      5 cdn.search.brave.com/0 Temporary failure in name resolution
>      6 cdn.search.brave.com/0 Temporary failure in name resolution
[...]
>     11 Contacting host: search.brave.com:443
>     12 cdn.search.brave.com/0 Temporary failure in name resolution

> Line nos. 1 and 2 are from url.el requests.  3--6 and 11--12 is from
> connection to search.brave.com from eww for an internet search.

Seems like the accesses failed just as well, so my guess is that the
only thing different with EWW is that it falls back on a cache or
something like that.

> That sounds a bit too involved for me currently.

I don't think it's necessary either.  The circumstantial evidence is
strong enough to conclude that you're seeing the same symptoms as I and
that it comes from the same source.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.

Message received at 58520 <at> debbugs.gnu.org:


Received: (at 58520) by debbugs.gnu.org; 3 Nov 2023 18:47:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 03 14:47:45 2023
Received: from localhost ([127.0.0.1]:59741 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qyzCq-0005Yw-SC
	for submit <at> debbugs.gnu.org; Fri, 03 Nov 2023 14:47:45 -0400
Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:49654)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <visuweshm@HIDDEN>) id 1qyzCo-0005Yh-Su
 for 58520 <at> debbugs.gnu.org; Fri, 03 Nov 2023 14:47:43 -0400
Received: by mail-pj1-x1043.google.com with SMTP id
 98e67ed59e1d1-27ff83feb29so2280518a91.3
 for <58520 <at> debbugs.gnu.org>; Fri, 03 Nov 2023 11:47:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1699037221; x=1699642021; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=5O6Yc7anbRjcReMInoG9AV5l9R1uOtqgEv9fpFHcoK4=;
 b=fU6L++sZoFO0EyRBxuuqL/3aaYNYkJNQO1PKaD73sLuRS/xVKUISQ5QxEdqhfn7zWj
 SgZ297qYOhfOvCoubI+w82ywHel5fmEpnhYtna0inE50dz7NBYGBHgv+BWUZMV1sJO91
 2naxKuCRkIysjlwN+M5HvyMW4xbMiwaD81TVQO/OXG5yZ7LZEyKL0Eve/0vJnvxOdb4N
 GXNBMz0fWJ+gaqOYMctNHIfhfzP6WFb/bMufTBaIMw3FxcT0C0wi9z7+M0t2IHN/Ho7y
 qB0yXEpLVwiZo7VW4RxAYg51UIdPGsLbgtQr1ZS/D3SoNrmRE01FXWF+gy+p3Xn/v8Be
 y5GA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1699037221; x=1699642021;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=5O6Yc7anbRjcReMInoG9AV5l9R1uOtqgEv9fpFHcoK4=;
 b=A5oqgCg7sg8vN4yDei+r2XOkbOipgHUcNOFR3uXxNh7TPWyBlCv5wA9P+S6TRVOmOJ
 MsnHymOKBaF3XqOyTixj2yNiWwux3ongxEc2kHpLO/IN40FJyApRihNDN/lzTImd9yKd
 TVPvyuq2KHUDOuUuBcencmHkIOOmtIrVI8NOlmZ7wObGWI43/rCGBrBLxhWqg9Rv6C/w
 CdL+92JxKivnYACx5X9FOpcbhSUL0TZolmFWVQhI66u+b3MQ4OI5BaQJCsGcnvFnwuWu
 GZTVfyBqbZzTcLoWXBc8BjXGsGYN8gdjbh383pYAyy2uzH1rfUlFaBZ3CgxSlSWcfYo2
 NS7w==
X-Gm-Message-State: AOJu0YzZ789Rj4E/+a6nViG0jKrz4VWxFwgCvRYpBT8a6xb6Le2NLS2i
 Ug44QMaA+ox4v0y6DM0VbkI=
X-Google-Smtp-Source: AGHT+IHSvQkPuJ58zic1+jcUmoJJL9ktPpXn7yTT0+FkjvYcyvHiZ+XVgJF8gpvjwx5bhhii1TBVhw==
X-Received: by 2002:a17:90a:f2d4:b0:27c:f845:3e3f with SMTP id
 gt20-20020a17090af2d400b0027cf8453e3fmr22049573pjb.1.1699037220911; 
 Fri, 03 Nov 2023 11:47:00 -0700 (PDT)
Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id
 11-20020a170902c14b00b001c75a07f62esm1702112plj.34.2023.11.03.11.46.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 03 Nov 2023 11:47:00 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#58520: Persistent failure to DNS-lookup hostname
In-Reply-To: <jwvjzqyq00t.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Fri, 03 Nov 2023 12:38:03 -0400")
References: <jwvwn92idgb.fsf@HIDDEN>
 <jwv1qfck120.fsf-monnier+emacs@HIDDEN> <875y2j9sm6.fsf@HIDDEN>
 <jwvjzqyq00t.fsf-monnier+emacs@HIDDEN>
Date: Sat, 04 Nov 2023 00:16:52 +0530
Message-ID: <87r0l6fzdv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 58520
Cc: 58520 <at> debbugs.gnu.org, Paul Eggert <eggert@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

[=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=A8=E0=AE=B5=
=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 03, 2023] Stefan Monnier wrot=
e:

>> FWIW, I experience this sometimes when I change from an Ethernet
>> connection to a WiFi connection (I cannot remember if the inverse is
>> true too).  This change to another connection once I wake my laptop from
>> hibernation.  During this change, /etc/resolv.conf definitely changes
>> because I use resolvconf to set connection-specific and
>> interface-specific DNS nameserver setting.  [ I need to set the DNS
>> server manually for the Ethernet connection but I can use dhcp for the
>> Wifi one.  ]
>
> Sounds like the exact same problem, indeed.
> If you ever come up with some further hints about what it needs to
> reproduce it (or even better: an actual recipe), I'd be happy to hear the=
m.

Unfortunately, I only experience this intermittently.  This is the first
time I see this issue in months (but could also be because I haven't
been bringing my laptop as often to the WiFi-only building).

> Currently it seems that hibernate/suspend might be related, tho
> I suspect it's a red herring.

You may be right about that but I cannot exactly prove it because
walking while carrying my laptop with its lid open for 2 km is not going
to be fun.  :-)
I don't want to turn off suspend-on-lid-close and potentially overheat
my laptop either.

>> The other super weird part is that eww _can_ open debbugs.gnu.org just
>> fine, but if I use Gnus to fetch the bug report it doesn't...
>
> Hmm... any chance that you're using some package which makes `eww` use
> some external tool instead of `url.el`?

No, I don't use any nor do I know of such a package.  Actually, an even
stranger thing happened with eww that I neglected to mention: some
requests to search.brave.com clearly failed with the lookup failure but
eww made enough requests to render the webpage from Brave search just
fine.  This is what I see in the *Messages* buffer

     1 Contacting host: www.doi2bib.org:443
     2 Error: (error www.doi2bib.org/443 Temporary failure in name resoluti=
on)
     3 Contacting host: search.brave.com:443
     4 search.brave.com/0 Temporary failure in name resolution
     5 cdn.search.brave.com/0 Temporary failure in name resolution
     6 cdn.search.brave.com/0 Temporary failure in name resolution
     7 Contacting host: www.doi2bib.org:443
     8 Error: (error www.doi2bib.org/443 Temporary failure in name resoluti=
on)
     9 Contacting host: www.doi2bib.org:443
    10 open-network-stream: www.doi2bib.org/443 Temporary failure in name r=
esolution
    11 Contacting host: search.brave.com:443
    12 cdn.search.brave.com/0 Temporary failure in name resolution
    13 Contacting host: www.doi2bib.org:443
    14 open-network-stream: www.doi2bib.org/443 Temporary failure in name r=
esolution
    15 Contacting host: doi2bib.org:80

Line nos. 1 and 2 are from url.el requests.  3--6 and 11--12 is from
connection to search.brave.com from eww for an internet search.
I cannot say with confidence but 15 should be when I opened doi2bib.org
in eww once it became obvious that url.el will keep on failing...

>> I am not sure how long this failing Emacs instance will fail but if it
>> helps, I can try to do some debugging on my end as well.
>
> AFAICT once it happens it doesn't fix itself: the DNS server used by
> your Emacs process is "stuck" and doesn't pay attention to
> /etc/resolv.conf, so it "gets fixed" if you happen to be connected on
> a network where the DNS server that Emacs tries to contact is available.

Your analysis seems to be correct.  Now that I'm back on the Ethernet
connection, Emacs can happily make all the network requests its heart
desires.=20=20

But I seem to recall a similar failure back when you initially spoke of
this issue (even before opening this bug report) and I think I solved it
by opening the failing webpage in eww, which is why I tried this again
today for doi2bib.org.  It seemed to have worked once i.e., eww opened
the website but failed again when I tried a second time.
So for all I know, it could have been sheer luck.

>> I tried to use tcpdump but the manpage seems to suggest that there is
>> no way to filter network requests made by a particular process, and
>> I see too many junk requests to isolate the traffic that matters.
>
> I used a filter which only kept packets sent to a DNS port (port 53) and
> that was sufficient to see requests to the "wrong" DNS server (e.g. the
> one you use when your machine is connected via Ethernet, even though
> the machine is currently connected via wifi) and to confirm that those
> requests are correlated with the operation I perform in Emacs.

That sounds a bit too involved for me currently.  If I get more time
(this might not happen until January) and if the bug shows its face
itself again, I will try to look into this in greater detail to help
squash this bug.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.

Message received at 58520 <at> debbugs.gnu.org:


Received: (at 58520) by debbugs.gnu.org; 3 Nov 2023 16:38:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 03 12:38:51 2023
Received: from localhost ([127.0.0.1]:59649 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qyxC7-0002CD-8X
	for submit <at> debbugs.gnu.org; Fri, 03 Nov 2023 12:38:51 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:51134)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1qyxC4-0002Bz-Ot
 for 58520 <at> debbugs.gnu.org; Fri, 03 Nov 2023 12:38:49 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2E16C442E72;
 Fri,  3 Nov 2023 12:38:07 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1699029484;
 bh=BMPMhy2j3mV64Zy1MFWhk3LScJ3vOJhTqEn5FAUH1QU=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=EFNbGYhZvXlKUVP5UGFHg+alGC9SOntvMIt4rMEAzGsS8oygcUOJnej9f2WfAM+PY
 WHhkzlkHNj++xed8DeSyLh5FI9uMgMtG2CEHt/1utTI1qMk0WXOrBczZQD1Z1J93Pd
 +KlubEtPPNzwjTLrM5nejNKnJqeM024BIj2HyQmyu+WcWhkEQY7wVw6Zg3oUAQ2VTH
 xMMVKLjv7xIdW+BLfcPWwyJ7nQfAAT2F212vdYBP2x+36x7qek7xF5QBfl53Mbr/b8
 8EVu5APnC/Mq3dSbtq/GTpTl3NnNR9RoG3mNfRP5s+UAQF+sFyOB4mv9kUAxFZm22Y
 pXWsmMB7+n1Eg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id AE6C3442E6C;
 Fri,  3 Nov 2023 12:38:04 -0400 (EDT)
Received: from alfajor (unknown [23.233.149.155])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 900221202E0;
 Fri,  3 Nov 2023 12:38:04 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
Subject: Re: bug#58520: Persistent failure to DNS-lookup hostname
In-Reply-To: <875y2j9sm6.fsf@HIDDEN> (Visuwesh's message of "Fri, 03 Nov
 2023 13:27:21 +0530")
Message-ID: <jwvjzqyq00t.fsf-monnier+emacs@HIDDEN>
References: <jwvwn92idgb.fsf@HIDDEN>
 <jwv1qfck120.fsf-monnier+emacs@HIDDEN> <875y2j9sm6.fsf@HIDDEN>
Date: Fri, 03 Nov 2023 12:38:03 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.010 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 58520
Cc: 58520 <at> debbugs.gnu.org, Paul Eggert <eggert@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> FWIW, I experience this sometimes when I change from an Ethernet
> connection to a WiFi connection (I cannot remember if the inverse is
> true too).  This change to another connection once I wake my laptop from
> hibernation.  During this change, /etc/resolv.conf definitely changes
> because I use resolvconf to set connection-specific and
> interface-specific DNS nameserver setting.  [ I need to set the DNS
> server manually for the Ethernet connection but I can use dhcp for the
> Wifi one.  ]

Sounds like the exact same problem, indeed.
If you ever come up with some further hints about what it needs to
reproduce it (or even better: an actual recipe), I'd be happy to hear them.

Currently it seems that hibernate/suspend might be related, tho
I suspect it's a red herring.

> The other super weird part is that eww _can_ open debbugs.gnu.org just
> fine, but if I use Gnus to fetch the bug report it doesn't...

Hmm... any chance that you're using some package which makes `eww` use
some external tool instead of `url.el`?

> I am not sure how long this failing Emacs instance will fail but if it
> helps, I can try to do some debugging on my end as well.

AFAICT once it happens it doesn't fix itself: the DNS server used by
your Emacs process is "stuck" and doesn't pay attention to
/etc/resolv.conf, so it "gets fixed" if you happen to be connected on
a network where the DNS server that Emacs tries to contact is available.

> I tried to use tcpdump but the manpage seems to suggest that there is
> no way to filter network requests made by a particular process, and
> I see too many junk requests to isolate the traffic that matters.

I used a filter which only kept packets sent to a DNS port (port 53) and
that was sufficient to see requests to the "wrong" DNS server (e.g. the
one you use when your machine is connected via Ethernet, even though
the machine is currently connected via wifi) and to confirm that those
requests are correlated with the operation I perform in Emacs.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.

Message received at 58520 <at> debbugs.gnu.org:


Received: (at 58520) by debbugs.gnu.org; 3 Nov 2023 07:58:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 03 03:58:17 2023
Received: from localhost ([127.0.0.1]:56690 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qyp4H-0004sy-3i
	for submit <at> debbugs.gnu.org; Fri, 03 Nov 2023 03:58:17 -0400
Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:60649)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <visuweshm@HIDDEN>) id 1qyp4B-0004sN-Fi
 for 58520 <at> debbugs.gnu.org; Fri, 03 Nov 2023 03:58:11 -0400
Received: by mail-pf1-x442.google.com with SMTP id
 d2e1a72fcca58-6c3077984e8so1737536b3a.0
 for <58520 <at> debbugs.gnu.org>; Fri, 03 Nov 2023 00:57:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1698998245; x=1699603045; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=G9guz7XmBhJvBjbI0NwZBjHXitEISjQnR0S95YftfF0=;
 b=OAyHLxsXf0mLpKAXuR1mTJYzB5OMhBnAV2EpC9QY1KhbOdEZWRqcNEPUXZjOgDV2Z1
 6b9p3LLNWMvHMlTdmIR50dCZJ2wOvbi1Ve28bI5CvLIL88N7xU2XG79C4Wc9dBuK9/sz
 LYwlyFvNDZDoeZgHbvTZ00pZ0pqQCnzaOnCgK6MMJHS/zwocon9h3bdifTGhgvgfV+Wx
 TYk7D4OuWAbnkhPDXSR6lXweOTVIWSNcn2GjCl6o1G23u2rE6MI4DkMEy8sAEY39hPX8
 b/Yjhyw7sxWzfD+pXtTLGsQfu0HxQigzXP4E8f8xjiIr9mr+JeLWS3k+UiKPdgb4Eo6V
 MPEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1698998245; x=1699603045;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=G9guz7XmBhJvBjbI0NwZBjHXitEISjQnR0S95YftfF0=;
 b=h9T9QnOEYLho2Ljo4+tD9JmNkO7ZDA/w6ZTL22dZE9YfeXTiuQU1LCNf2eKETSfd1H
 kTZsV4poW9xsowBOyvK3Hr5gD07WeFduza7LTBdzItY62Tt4UurFdC4h3V0vLnLX/kDE
 bGiha8XDvFMcWgxlUyKdYkPjHBQD4S4ID5+R+sfL8DLUKrDIhFFkrK57qhTSRES3Rr6M
 pEtPEnLhIrpmnvTs/NhaBaaerUwwuOHNujdEZQENDbL4Disw7Q1C/vFjLkg2Qa7eNZJP
 ubWP0dOK64kB7xilrNunwJ1PnrerC0756WMu00b/XWtTEDyo4RhmPc+Ef4mEHtJAMkpx
 /QWg==
X-Gm-Message-State: AOJu0YwXQFtfFSzudTcOUmznCBrP8vwd4aGAkPU0ZBK6hryMk6BWiSki
 EalnKbYcfUsFxf/AESyrTsY=
X-Google-Smtp-Source: AGHT+IHaT6LSopoTyZ7R3bCkyGKIYCjO040x2ro1hB5vAUonTxp6OQn6V2+3dxQVyYKoUbU0Z+O7+g==
X-Received: by 2002:a05:6a21:71c6:b0:181:b044:44a4 with SMTP id
 ay6-20020a056a2171c600b00181b04444a4mr4252093pzc.56.1698998245469; 
 Fri, 03 Nov 2023 00:57:25 -0700 (PDT)
Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id
 a7-20020a17090a688700b0027df6ff00eesm797679pjd.19.2023.11.03.00.57.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 03 Nov 2023 00:57:24 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#58520: Persistent failure to DNS-lookup hostname
In-Reply-To: <jwv1qfck120.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Tue, 05 Sep 2023 13:06:11 -0400")
References: <jwvwn92idgb.fsf@HIDDEN>
 <jwv1qfck120.fsf-monnier+emacs@HIDDEN>
Date: Fri, 03 Nov 2023 13:27:21 +0530
Message-ID: <875y2j9sm6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 58520
Cc: 58520 <at> debbugs.gnu.org, Paul Eggert <eggert@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

[Tuesday September 05, 2023] Stefan Monnier wrote:

> FWIW, I've seen this bug on a somewhat regular basis.  I have not been
> able to reproduce it: it seems to show up only after Emacs has been in
> use for several days.
>
> I did confirm that calling `M-: (res-init) RET` does work around the
> problem in the sense that the Emacs session can then successfully
> perform DNS lookups again.
> [ `res-init` is a little DEFUN I added which just calls `res_init`.  ]
>
> So, as far as I can tell, the problem is that glibc or Emacs somehow get
> into a state where the automatic decision to refresh the info about the
> address of the DNS server doesn't work any more.
>

FWIW, I experience this sometimes when I change from an Ethernet
connection to a WiFi connection (I cannot remember if the inverse is
true too).  This change to another connection once I wake my laptop from
hibernation.  During this change, /etc/resolv.conf definitely changes
because I use resolvconf to set connection-specific and
interface-specific DNS nameserver setting.  [ I need to set the DNS
server manually for the Ethernet connection but I can use dhcp for the
Wifi one.  ]

Emacs throws me `443 Temporary failure in name resolution' even though I
can open the same address in Firefox, or a fresh new Emacs instance just
fine.  In fact, I couldn't use gnus-read-ephemeral-emacs-bug-group from
the failing Emacs instance but I can in this fresh one I opened just to
send this mail.

The other super weird part is that eww _can_ open debbugs.gnu.org just
fine, but if I use Gnus to fetch the bug report it doesn't...
More generally, eww seems to be able to open these webpages just fine
but if I do a HTTP request to same address using url.el it fails with
the aforementioned 443 error.  I can sometimes stop this error once and
for all by visiting the failing address in eww but clearly this time it
hasn't helped (since Gnus still fails to make a connection to
debbugs.gnu.org after visiting debbugs.gnu.org in eww).

I am not sure how long this failing Emacs instance will fail but if it
helps, I can try to do some debugging on my end as well.  I tried to use
tcpdump but the manpage seems to suggest that there is no way to filter
network requests made by a particular process, and I see too many junk
requests to isolate the traffic that matters.

>         Stefan
>
>
> Stefan Monnier [2022-10-14 12:20:52] wrote:
>
>> Package: Emacs
>>
>>
>> [ I see that my original email was sent to emacs-devel, but I think
>>   bug-gnu-emacs is a better place for that.  ]
>>
>> My Gnus session (a separate Emacs session I use specifically to run
>> Gnus) occasionally gets into a state where it insists that my mail
>> server's DNS name isn't found.  All(?) other processes on the machine
>> keep happily resolving hostname, so the problem is specific to
>> this process.
>>
>> The problem just reappeared today and thanks to the help I got last time
>> I managed to diagnose it a bit better:
>>
>> - Lars asked if it only affect IMAP: nope, it affects more than just
>>   IMAP.  Simple tests suggest it affects all DNS lookups performed by
>>   that Emacs process.
>> - Madhu suggested the problem was related to commit 93bf7d52841c60ff and
>>   might be linked to a lack of call to `res_init`.  For some stupid
>>   reason I wasn't able to add an ELisp primitive that lets me call
>>   `res_init` manually to verify this hypothesis, but I now figured what
>>   was my mistake, so I should be able to try `M-: (res-init) RET` next time
>>   to confirm that it works around the problem.
>> - Robert's suggestion to use `tcpdump` showed that the reason this Emacs
>>   process gets DNS lookup failures is simply that it queries the DNS
>>   server at 192.168.1.1 which is the server I was using yesterday (and
>>   to which I currently don't have access) rather than the one I'm using
>>   now.  IOW, it strongly suggests that the problem would be solved by
>>   calling `res_init`.
>>
>> [Glibc bug 984](https://sourceware.org/bugzilla/show_bug.cgi?id=984)
>> seems relevant.  According to this, calling `res_init` should not be
>> necessary any more.  Indeed, if I start Emacs, use
>> `make-network-process`, then change `/etc/resolv.conf`, then call
>> `make-network-process` again, tcpdump shows clearly that the Emacs
>> session has noticed the change in `/etc/resolv.conf`.  I tried this same
>> test from a fresh new Gnus session, and that also works fine.
>>
>> So it's still a mystery why my Gnus session sometimes gets into a state
>> where it apparently stops paying attention to changes in
>> `/etc/resolv.conf`.  The above bug 984 mentions that glibc's "auto
>> reload" of `/etc/resolv.conf` is prevented in case the application has
>> modified `_res` manually, but I can't see any place where we do that.
>> Could it be that some of the libraries we link with can sometimes
>> manually modify `_res`?
>>
>>
>>         Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.

Message received at 58520 <at> debbugs.gnu.org:


Received: (at 58520) by debbugs.gnu.org; 5 Sep 2023 17:06:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 05 13:06:24 2023
Received: from localhost ([127.0.0.1]:58775 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdZVQ-0003oq-9V
	for submit <at> debbugs.gnu.org; Tue, 05 Sep 2023 13:06:24 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4118)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1qdZVM-0003ob-SU
 for 58520 <at> debbugs.gnu.org; Tue, 05 Sep 2023 13:06:23 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3677A444676;
 Tue,  5 Sep 2023 13:06:14 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1693933572;
 bh=p25nyfTEidxb3RpdPMwW+uO0Qh0XKMvaR3s3XELpJNs=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=HF2JvOA47i0V5ggZLIgv37KZRr8g/CVdcJ1F+G6+ljlYTH+VXL8c78j2OPSKyoNxL
 qTysSyCciMf6oY9FMQ2bkcJwBSHwXBlkKsMqasEqQCBWCSS7SVwtUiBsgtW21bBdi2
 RYP4+CI1TV/Q2z5rgtpmsENLXM8Q56E/hwRLHpMxq4IPkHHsI3YDDTuPbz6mPeEIVy
 XvzeJVnLFJ9VVcNzITUyMwGeqZZT/4RIys80yr5Tl3j81l4MWLxN+VECCaEflTCb5t
 giLVLUAKHyaYvfpMDKlzdrcvYM64qvjf9CIx03O+/JVKzZBx4rMbpcWImzMwZJIG7S
 xqlMBt2dRj6xA==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4445244466F;
 Tue,  5 Sep 2023 13:06:12 -0400 (EDT)
Received: from pastel (69-165-136-223.dsl.teksavvy.com [69.165.136.223])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 21CE812023C;
 Tue,  5 Sep 2023 13:06:12 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: 58520 <at> debbugs.gnu.org
Subject: Re: bug#58520: Persistent failure to DNS-lookup hostname
In-Reply-To: <jwvwn92idgb.fsf@HIDDEN> (Stefan Monnier's message of
 "Fri, 14 Oct 2022 12:20:52 -0400")
Message-ID: <jwv1qfck120.fsf-monnier+emacs@HIDDEN>
References: <jwvwn92idgb.fsf@HIDDEN>
Date: Tue, 05 Sep 2023 13:06:11 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.110 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 58520
Cc: Paul Eggert <eggert@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

FWIW, I've seen this bug on a somewhat regular basis.  I have not been
able to reproduce it: it seems to show up only after Emacs has been in
use for several days.

I did confirm that calling `M-: (res-init) RET` does work around the
problem in the sense that the Emacs session can then successfully
perform DNS lookups again.
[ `res-init` is a little DEFUN I added which just calls `res_init`.  ]

So, as far as I can tell, the problem is that glibc or Emacs somehow get
into a state where the automatic decision to refresh the info about the
address of the DNS server doesn't work any more.


        Stefan


Stefan Monnier [2022-10-14 12:20:52] wrote:

> Package: Emacs
>
>
> [ I see that my original email was sent to emacs-devel, but I think
>   bug-gnu-emacs is a better place for that.  ]
>
> My Gnus session (a separate Emacs session I use specifically to run
> Gnus) occasionally gets into a state where it insists that my mail
> server's DNS name isn't found.  All(?) other processes on the machine
> keep happily resolving hostname, so the problem is specific to
> this process.
>
> The problem just reappeared today and thanks to the help I got last time
> I managed to diagnose it a bit better:
>
> - Lars asked if it only affect IMAP: nope, it affects more than just
>   IMAP.  Simple tests suggest it affects all DNS lookups performed by
>   that Emacs process.
> - Madhu suggested the problem was related to commit 93bf7d52841c60ff and
>   might be linked to a lack of call to `res_init`.  For some stupid
>   reason I wasn't able to add an ELisp primitive that lets me call
>   `res_init` manually to verify this hypothesis, but I now figured what
>   was my mistake, so I should be able to try `M-: (res-init) RET` next time
>   to confirm that it works around the problem.
> - Robert's suggestion to use `tcpdump` showed that the reason this Emacs
>   process gets DNS lookup failures is simply that it queries the DNS
>   server at 192.168.1.1 which is the server I was using yesterday (and
>   to which I currently don't have access) rather than the one I'm using
>   now.  IOW, it strongly suggests that the problem would be solved by
>   calling `res_init`.
>
> [Glibc bug 984](https://sourceware.org/bugzilla/show_bug.cgi?id=984)
> seems relevant.  According to this, calling `res_init` should not be
> necessary any more.  Indeed, if I start Emacs, use
> `make-network-process`, then change `/etc/resolv.conf`, then call
> `make-network-process` again, tcpdump shows clearly that the Emacs
> session has noticed the change in `/etc/resolv.conf`.  I tried this same
> test from a fresh new Gnus session, and that also works fine.
>
> So it's still a mystery why my Gnus session sometimes gets into a state
> where it apparently stops paying attention to changes in
> `/etc/resolv.conf`.  The above bug 984 mentions that glibc's "auto
> reload" of `/etc/resolv.conf` is prevented in case the application has
> modified `_res` manually, but I can't see any place where we do that.
> Could it be that some of the libraries we link with can sometimes
> manually modify `_res`?
>
>
>         Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.

Message received at 58520 <at> debbugs.gnu.org:


Received: (at 58520) by debbugs.gnu.org; 14 Oct 2022 17:17:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 14 13:17:46 2022
Received: from localhost ([127.0.0.1]:38508 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ojOJe-0001fa-JT
	for submit <at> debbugs.gnu.org; Fri, 14 Oct 2022 13:17:46 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2814)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1ojOJc-0001fM-Sb
 for 58520 <at> debbugs.gnu.org; Fri, 14 Oct 2022 13:17:45 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0A8F310012E;
 Fri, 14 Oct 2022 13:17:39 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0A460100098;
 Fri, 14 Oct 2022 13:17:37 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1665767857;
 bh=Qntdf5iNuFjkY4LZ0mGlJD715bwiqVaUbN/OUa1/mfA=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=JY3eqBx58oMasg+ZwolHyO7jPmirIrOrYGoK1ZqMEn0X5AHdoHBpEAd2HxNutBw8c
 Yg2GraxjfSuEKXzaM3MKw9buVd8py1V2kPj9Lz1GE4uj2AUxrLT20zhj5636FiGZsk
 hxT97dJfruwJKcP/otDVG1mzgz3Pmgg34j+4DDoLWZiqta8BHj1KuDT8isaWZ1h64m
 RXBjhaAMGK8t2rOC95qHvrde0pc2GDts2GTRYIxKP1ck3c1ZnB5RpsTQUjHP4qfOyS
 FksMWmRYpsWLHogPVd/NjeOtqIXIsv7o8rHBkHXlz7w+KiPEJwW/TczHJs0c80eYyR
 tCfRtx729DKWA==
Received: from alfajor (unknown [45.44.229.252])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B9B7A1205E5;
 Fri, 14 Oct 2022 13:17:36 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#58520: Persistent failure to DNS-lookup hostname
In-Reply-To: <146833c0-a01c-531c-c321-7adb24680f2e@HIDDEN> (Paul Eggert's
 message of "Fri, 14 Oct 2022 09:55:12 -0700")
Message-ID: <jwvilkme3bp.fsf-monnier+emacs@HIDDEN>
References: <jwvwn92idgb.fsf@HIDDEN>
 <146833c0-a01c-531c-c321-7adb24680f2e@HIDDEN>
Date: Fri, 14 Oct 2022 13:17:34 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.080 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 58520
Cc: 58520 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Paul Eggert [2022-10-14 09:55:12] wrote:
> Also see this informative thread by the Go folks, who see a similar bug and
>  have some good worries about thread safety and who are still seeing
>  problems as of August:
>
> https://github.com/golang/go/issues/21083

The beginning of the thread is all about an old version of glibc
(i.e. before glibc started auto-reloading the `/etc/resolv.conf` file).

The last comment does seem like it might be related (it's for a more
recent globc), admittedly, but that one is rather short on details.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.

Message received at 58520 <at> debbugs.gnu.org:


Received: (at 58520) by debbugs.gnu.org; 14 Oct 2022 16:55:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 14 12:55:21 2022
Received: from localhost ([127.0.0.1]:38486 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ojNxx-00013I-Fo
	for submit <at> debbugs.gnu.org; Fri, 14 Oct 2022 12:55:21 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:36280)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1ojNxv-000131-I1
 for 58520 <at> debbugs.gnu.org; Fri, 14 Oct 2022 12:55:20 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7D41E160086;
 Fri, 14 Oct 2022 09:55:13 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id y1oCDOwLly9v; Fri, 14 Oct 2022 09:55:12 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 9150E160088;
 Fri, 14 Oct 2022 09:55:12 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.9.2 zimbra.cs.ucla.edu 9150E160088
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu;
 s=78364E5A-2AF3-11ED-87FA-8298ECA2D365; t=1665766512;
 bh=AAWReAZvaa8q8PSA3WMlEdg2GDpDHkE6ITDdlsjDyVY=;
 h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type:
 Content-Transfer-Encoding;
 b=UDDmk/W1ZXlh4k3Y06ipzlvdGlyOgV2t95+bwDieUdj5N7rTxiCSqbhK1GRufjiSE
 b11JlE67WrFEcFpk13oKVqFJC77+g7YJhH0DjU9ymKk2iXpJgl1laVCjw0o+6jVeHX
 HjDjpQuNUUvD23MdM4/l5914yFVO6cnBrx7UhNdw=
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id X1B1qhYrsbW8; Fri, 14 Oct 2022 09:55:12 -0700 (PDT)
Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com
 [172.91.119.151])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 69A13160086;
 Fri, 14 Oct 2022 09:55:12 -0700 (PDT)
Message-ID: <146833c0-a01c-531c-c321-7adb24680f2e@HIDDEN>
Date: Fri, 14 Oct 2022 09:55:12 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.2.2
Subject: Re: bug#58520: Persistent failure to DNS-lookup hostname
Content-Language: en-US
To: Stefan Monnier <monnier@HIDDEN>
References: <jwvwn92idgb.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
In-Reply-To: <jwvwn92idgb.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -4.1 (----)
X-Debbugs-Envelope-To: 58520
Cc: 58520 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.1 (-----)

Also see this informative thread by the Go folks, who see a similar bug 
and have some good worries about thread safety and who are still seeing 
problems as of August:

https://github.com/golang/go/issues/21083






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Oct 2022 16:21:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 14 12:21:15 2022
Received: from localhost ([127.0.0.1]:38431 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ojNQx-0008WN-1V
	for submit <at> debbugs.gnu.org; Fri, 14 Oct 2022 12:21:15 -0400
Received: from lists.gnu.org ([209.51.188.17]:39508)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1ojNQt-0008WE-IO
 for submit <at> debbugs.gnu.org; Fri, 14 Oct 2022 12:21:13 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:46986)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
 id 1ojNQt-0008Ls-BY
 for bug-gnu-emacs@HIDDEN; Fri, 14 Oct 2022 12:21:11 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:35364)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
 id 1ojNQn-0004x2-JF
 for bug-gnu-emacs@HIDDEN; Fri, 14 Oct 2022 12:21:09 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DD403807C3
 for <bug-gnu-emacs@HIDDEN>; Fri, 14 Oct 2022 12:21:01 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 037B880539
 for <bug-gnu-emacs@HIDDEN>; Fri, 14 Oct 2022 12:21:00 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1665764460;
 bh=FdKHh5AsLXrZrF+H+RCUMFfxN+PzEOdgxB8xsOtSEwc=;
 h=From:To:Subject:Date:From;
 b=dRrlaO1p94HbMXjumbWcqdSeYEgZIqAB6QpQR9NV5rQ5H6kmd/YfCFnx6iUUvQIoh
 AzaE8tVc88BhaMcQBvJXuloac/3f1c15B5iXfS1y38gOWQvVKPP562+y3oDH9+nykP
 iOyldzOcRFU61GVdB/S5QlXo3oXhDjHilv4gUrqpPAsd5EB1ecjGQwV5RCz/lCR5Xi
 vHvmw1MYVSJC2nKt91vG1KdpC7+ZQJaQXDDfBG5KVNHgsZAE/NgTwZgj3fuFCKa7Yh
 KOZOFgO9ClhvM5xgK9Lh1xWv+/Qw7mJYTGvUzsUOxvj/M6SAT5/k+8expavy6Ok86i
 ZsEU4txUK5r7A==
Received: from alfajor (unknown [45.44.229.252])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AFF34120234
 for <bug-gnu-emacs@HIDDEN>; Fri, 14 Oct 2022 12:20:59 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Persistent failure to DNS-lookup hostname
X-Debbugs-Cc: Paul Eggert <eggert@HIDDEN>
Date: Fri, 14 Oct 2022 12:20:52 -0400
Message-ID: <jwvwn92idgb.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.060 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
Received-SPF: pass client-ip=132.204.25.50;
 envelope-from=monnier@HIDDEN; helo=mailscanner.iro.umontreal.ca
X-Spam_score_int: -42
X-Spam_score: -4.3
X-Spam_bar: ----
X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Package: Emacs


[ I see that my original email was sent to emacs-devel, but I think
  bug-gnu-emacs is a better place for that.  ]

My Gnus session (a separate Emacs session I use specifically to run
Gnus) occasionally gets into a state where it insists that my mail
server's DNS name isn't found.  All(?) other processes on the machine
keep happily resolving hostname, so the problem is specific to
this process.

The problem just reappeared today and thanks to the help I got last time
I managed to diagnose it a bit better:

- Lars asked if it only affect IMAP: nope, it affects more than just
  IMAP.  Simple tests suggest it affects all DNS lookups performed by
  that Emacs process.
- Madhu suggested the problem was related to commit 93bf7d52841c60ff and
  might be linked to a lack of call to `res_init`.  For some stupid
  reason I wasn't able to add an ELisp primitive that lets me call
  `res_init` manually to verify this hypothesis, but I now figured what
  was my mistake, so I should be able to try `M-: (res-init) RET` next time
  to confirm that it works around the problem.
- Robert's suggestion to use `tcpdump` showed that the reason this Emacs
  process gets DNS lookup failures is simply that it queries the DNS
  server at 192.168.1.1 which is the server I was using yesterday (and
  to which I currently don't have access) rather than the one I'm using
  now.  IOW, it strongly suggests that the problem would be solved by
  calling `res_init`.

[Glibc bug 984](https://sourceware.org/bugzilla/show_bug.cgi?id=984)
seems relevant.  According to this, calling `res_init` should not be
necessary any more.  Indeed, if I start Emacs, use
`make-network-process`, then change `/etc/resolv.conf`, then call
`make-network-process` again, tcpdump shows clearly that the Emacs
session has noticed the change in `/etc/resolv.conf`.  I tried this same
test from a fresh new Gnus session, and that also works fine.

So it's still a mystery why my Gnus session sometimes gets into a state
where it apparently stops paying attention to changes in
`/etc/resolv.conf`.  The above bug 984 mentions that glibc's "auto
reload" of `/etc/resolv.conf` is prevented in case the application has
modified `_res` manually, but I can't see any place where we do that.
Could it be that some of the libraries we link with can sometimes
manually modify `_res`?


        Stefan





Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
New bug report received and forwarded. Copy sent to eggert@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to eggert@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#58520; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 20 Jan 2024 12:30:02 UTC

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