From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#36017: 27.0.50; TLS 1.3 on macOS exhibits similar issue to #34341 Date: Mon, 7 Oct 2019 17:02:25 +0200 Message-ID: <489730AF-5AF8-43D6-BCBE-0B1008BC1DE4@acm.org> References: Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="157455"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Joseph Mingrone , Robert Pluim , Noam Postavsky , Aaron Jensen To: 36017@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 07 17:03:23 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iHUXi-000emy-L7 for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Oct 2019 17:03:22 +0200 Original-Received: from localhost ([::1]:45820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHUXh-00069Y-Bs for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Oct 2019 11:03:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44498) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHUXU-00069O-VR for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 11:03:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iHUXO-0001yV-OZ for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 11:03:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39999) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iHUXO-0001yP-CN for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 11:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iHUXN-000521-Up for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 11:03:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Oct 2019 15:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36017 X-GNU-PR-Package: emacs Original-Received: via spool by 36017-submit@debbugs.gnu.org id=B36017.157046056019312 (code B ref 36017); Mon, 07 Oct 2019 15:03:01 +0000 Original-Received: (at 36017) by debbugs.gnu.org; 7 Oct 2019 15:02:40 +0000 Original-Received: from localhost ([127.0.0.1]:48820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHUX0-00051P-Un for submit@debbugs.gnu.org; Mon, 07 Oct 2019 11:02:39 -0400 Original-Received: from mail1428c50.megamailservers.eu ([91.136.14.28]:54136 helo=mail118c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHUWx-0004vQ-UK for 36017@debbugs.gnu.org; Mon, 07 Oct 2019 11:02:37 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1570460548; bh=EPpGEg5996UPQvbGATpvs0O6ecDL7TWVJjqyL/bg+YY=; h=From:Subject:Date:Cc:To:From; b=U6bH/WAP/FxPDviXbBC0ENCr/fLgaQvVxT8lfXPAqE1UVZkUY7N5vaEEgx6Wv4ixv 2CPJFcwaUWyoAV8Mr8yg6ZrIFIE1h6YtRomuc3ErVHUdkTNn+a8udLCucaig0wiTH6 EvE1cdF57U+o93ACWIbmEODWy7ahZ5Uri4lmeokQ= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.1.65] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail118c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x97F2QVO012952; Mon, 7 Oct 2019 15:02:28 +0000 X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B0202.5D9B5384.0070, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=DaRpVclW c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=0ugRqEcObLYfnVVeLTMA:9 a=CjuIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=jd6J4Gguk5HxikPWLKER:22 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:168536 Archived-At: There seems to be a race of some kind. On macOS 10.14 and Emacs master, NS build, `list-packages' (with only = elpa.gnu.org configured) fails while fetching archive-contents = asynchronously. However, running (url-retrieve "https://elpa.gnu.org/packages/archive-contents" (lambda (status) (message "callback: status =3D %S" status)) nil 'silent) works (albeit slowly); this is (modulo the callback) what list-packages = does behind the curtains. The only difference is that list-packages then = immediately proceeds with some other work (package-menu--refresh). This = can be simulated with (progn (url-retrieve ...) ; like above (busy-wait 1.0)) ; busy-wait 1 s which fails in the same way. As reported by Joseph Mingrone, the process = sentinel, `url-http-async-sentinel', is called with a WHY argument of = "connect", which makes little sense; if the process is still trying to = connect, why is the sentinel called? In any case, `url-http-async-sentinel' interprets the "connect" status = as an error and fails, but this is just a symptom of something earlier; = changing the sentinel to ignore "connect" doesn't help. If run in a TTY (with -nw), everything works, further indicating that = it's may be a problem with handling of asynchronous processes in the NS = build. However, this seems insufficient by itself: is gnutls (or TLS 1.3) = really so brittle that it cannot cope with a mere delay of 1 s during = the initial handshake? More details: * In all runs, gnutls_handshake fails when called right after the = initial connect() in connect_network_socket; this is expected since the = socket is nonblocking and the TCP connection hasn't been set up yet. * In failed runs, gnutls_handshake succeeds immediately in = wait_reading_process_output. * In successful runs, gnutls_handshake initially fails (with = GNUTLS_E_AGAIN) in wait_reading_process_output. Only after several tries = does it return success. I didn't make much progress beyond this point. Could someone more = familiar with gnutls in Emacs help me debug it?