GNU bug report logs - #40665
28.0.50; tls hang on local ssl

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: Derek Zhou <derek@HIDDEN>; dated Thu, 16 Apr 2020 16:01:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 40665) by debbugs.gnu.org; 24 Apr 2020 14:29:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 24 10:29:48 2020
Received: from localhost ([127.0.0.1]:57699 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jRzKu-0002MQ-Ek
	for submit <at> debbugs.gnu.org; Fri, 24 Apr 2020 10:29:48 -0400
Received: from mail-wr1-f42.google.com ([209.85.221.42]:43140)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1jRzKs-0002MD-2p
 for 40665 <at> debbugs.gnu.org; Fri, 24 Apr 2020 10:29:47 -0400
Received: by mail-wr1-f42.google.com with SMTP id i10so11083689wrv.10
 for <40665 <at> debbugs.gnu.org>; Fri, 24 Apr 2020 07:29:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :mime-version:content-transfer-encoding;
 bh=4EhjODWtyVl2NBinXgE/EeYd07YOg8eDWANB10BBFu0=;
 b=LnxSVFHcg24XOrtLgg66Ibm6FBRRct1kt7ojXIw2IvK/iXrJdb85UrGdqD1REF3PWo
 FshDkKo9l1emtUJpX9kTzwL+pENRXz5GcbmErS0zyvrWSIS9o6c+oaa0GcoFtz+s/buk
 TYPQne10iVE/j5c6UyqJyr+8e/AxMs0LqSz9T67FOyGa0ZUO2v7NxEVNve6NoEMmb4U5
 Zp7Yic2qpvi9/rQObLbtjZsVJ04db8ycMlAXJ7NfuNW/Rs+XQSm4SWyQVgICwOYTKh5O
 abwYVhcqzloCrTM6fYCqpC19fPWxhJ58CTkir4PeFiNh7x+zGnjDiXxWWOPcqQaaPXja
 ZMGA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:mime-version:content-transfer-encoding;
 bh=4EhjODWtyVl2NBinXgE/EeYd07YOg8eDWANB10BBFu0=;
 b=Uzf/lywEq1ld9Oqa7sEUnagItVhI/efDrtmwG83J80Z7OaFjjSv1wIZ2zkJcSF1hUO
 ya+F/3nL8Q2qsjH6vnBwI1lsl2KbGmTPqZca3Ypxx79KLoHAqyJE7YGMoz0OS+O7T73v
 6sTOFIzBGkueeWwZsJZmQDWnRihVuGN/SxKvCOcXK2d58/R3jKK8XSggx8LNDtvM76zz
 AvRYrmQn3mFCWXfBP+V06H7kwIC4uV1XoUuZcvXG8YojJODbsfHCwTVZPl+UICDOar1a
 UcTYHfZZw6WYO0Qm63WSWfzPMkGrbgHVUsS0zWAHlbOsaoCUqnyibHe7CRvEPKXraWy9
 b0Eg==
X-Gm-Message-State: AGi0PubL3uOBp85QYPDSJmwKm8f2SgbeCnkwP9Mv0K9HnYOXXcWrEvI5
 kjSVqUENR4rf9lHA3hcFnHL7asqaFlA=
X-Google-Smtp-Source: APiQypIhH1ELk6wkBlC6Bs5OcVCVqHAFfb3or0C/Tn9/SJpzlhha4/W/umCjVre+FAxceF69WvUeOQ==
X-Received: by 2002:a5d:4645:: with SMTP id j5mr11111285wrs.282.1587738579596; 
 Fri, 24 Apr 2020 07:29:39 -0700 (PDT)
Received: from rpluim-mac ([2a01:e34:ecfc:a860:bd9a:ec93:82f0:3a9a])
 by smtp.gmail.com with ESMTPSA id g74sm3103059wme.44.2020.04.24.07.29.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 24 Apr 2020 07:29:39 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
References: <86wo6fo78r.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
 <m2tv1dwan3.fsf@HIDDEN> <86zhb5q7sw.fsf@HIDDEN>
 <m28sipvstt.fsf@HIDDEN> <86y2qorj76.fsf@HIDDEN>
 <m2wo68vq08.fsf@HIDDEN> <86368w1tge.fsf@HIDDEN>
 <864ktcfpm5.fsf@HIDDEN> <86368wfp6d.fsf@HIDDEN>
 <m2ftcvvs31.fsf@HIDDEN> <86y2qniu5m.fsf@HIDDEN>
 <m2blnjvf3r.fsf@HIDDEN> <86wo67im9w.fsf@HIDDEN>
 <m2eesffqg7.fsf@HIDDEN> <86y2qnaqnv.fsf@HIDDEN>
 <86wo65arnu.fsf@HIDDEN>
Date: Fri, 24 Apr 2020 16:29:38 +0200
In-Reply-To: <86wo65arnu.fsf@HIDDEN> (Derek Zhou's message of "Fri, 24
 Apr 2020 14:23:50 +0000 (UTC)")
Message-ID: <m25zdpx8h9.fsf@HIDDEN>
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: 40665
Cc: 40665 <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: -1.0 (-)

>>>>> On Fri, 24 Apr 2020 14:23:50 +0000 (UTC), Derek Zhou <derek@HIDDEN> =
said:

    Derek> Derek Zhou writes:

    >> Robert Pluim writes:
    >>=20
    >>> OK, that does make sense, and might even be more correct, but it=CA=
=BCs a
    >>> bigger change. You'll need more than just me to agree with it.
    >>>=20
    >> Patch reworked:
    >>=20
    >> * before the select, check every interesting gnutls stream for
    >> available data in the buffer
    >> * if some of them hit, and either there is no wait_proc or the
    >> wait_proc is one of the gnutls streams with new data, set the select
    >> timeout to 0
    >> * after the select, merge the gnutls buffer status into the select
    >> returns
    >>=20
    >> The patch is not much longer than before, still a net reduction of c=
ode
    >> lines. I've done some light testing and haven't found any problem.=20

    Derek> Robert,

    Derek> did you get a chance to read and test this patch?

Not yet, unfortunately. Hopefully this weekend sometime.

Robert




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

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


Received: (at 40665) by debbugs.gnu.org; 24 Apr 2020 14:23:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 24 10:23:57 2020
Received: from localhost ([127.0.0.1]:57664 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jRzFF-0002BC-8m
	for submit <at> debbugs.gnu.org; Fri, 24 Apr 2020 10:23:57 -0400
Received: from xtrwkkxd.outbound-mail.sendgrid.net ([167.89.17.173]:15972)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jRzFD-0002Ax-Rp
 for 40665 <at> debbugs.gnu.org; Fri, 24 Apr 2020 10:23:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=k10Y20uXyIvcH3N9in8YToMYDf19DLUiORezltCjMuk=;
 b=utdMR4V59SH2OXF0A9XSIOxR5CbAR3Di0Be10SPr6vnemQ9qGxKFWUiwssIR4rtAL735
 5SbLPlgPS3Cm+PEZjDp1WndY/SE8RAtcfwm2BStWl925JKnHWXXBjE+r2YflNTrIGNbhTf
 l2lt0sRbymi5u5DkyAhCmfQY0V5Rrsb7E=
Received: by filterdrecv-p3mdw1-6dbfd75bfd-h68rz with SMTP id
 filterdrecv-p3mdw1-6dbfd75bfd-h68rz-18-5EA2F676-20
 2020-04-24 14:23:50.413874002 +0000 UTC m=+2553383.526141803
Received: from mail.3qin.us (unknown) by ismtpd0005p1sjc2.sendgrid.net (SG)
 with ESMTP id MxsruELuRf67PqFn3gflqQ
 Fri, 24 Apr 2020 14:23:50.064 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jRzF7-0000kW-Ae; Fri, 24 Apr 2020 10:23:49 -0400
References: <86wo6fo78r.fsf@HIDDEN> <86eeslecnf.fsf@HIDDEN>
 <m24kthgh28.fsf@HIDDEN> <86blnnebh3.fsf@HIDDEN>
 <m2y2qr5u9t.fsf@HIDDEN> <86zhb5hecx.fsf@HIDDEN>
 <86eeshpqdb.fsf@HIDDEN> <m2tv1dwan3.fsf@HIDDEN>
 <86zhb5q7sw.fsf@HIDDEN> <m28sipvstt.fsf@HIDDEN>
 <86y2qorj76.fsf@HIDDEN> <m2wo68vq08.fsf@HIDDEN>
 <86368w1tge.fsf@HIDDEN> <864ktcfpm5.fsf@HIDDEN>
 <86368wfp6d.fsf@HIDDEN> <m2ftcvvs31.fsf@HIDDEN>
 <86y2qniu5m.fsf@HIDDEN> <m2blnjvf3r.fsf@HIDDEN>
 <86wo67im9w.fsf@HIDDEN> <m2eesffqg7.fsf@HIDDEN>
 <86y2qnaqnv.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 27.0.91
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <86y2qnaqnv.fsf@HIDDEN>
Date: Fri, 24 Apr 2020 14:23:50 +0000 (UTC)
Message-ID: <86wo65arnu.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?AmbQROjJaCvVHlziHUMIHGn47nMIyALtXsXoDHx?=
 =?us-ascii?Q?a2u+Gjgt8zE3Zo1otp88seBhLBf56oWn6j2ALqo?=
 =?us-ascii?Q?2IwFAsE79HXXYUp54Y90TuQ7nCcDCv3MLBLJNbf?=
 =?us-ascii?Q?u5phlZZbPKBP5ueXBg1khSUhzLsLJGVsR6WezxR?=
 =?us-ascii?Q?mLlPoVlpfnjCXvkHbKHF=2FHvhyC2cslRgG85pcT?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: -1.0 (-)


Derek Zhou writes:

> Robert Pluim writes:
>
>> OK, that does make sense, and might even be more correct, but it=CA=BCs =
a
>> bigger change. You'll need more than just me to agree with it.
>>
> Patch reworked:
>
>  * before the select, check every interesting gnutls stream for
>    available data in the buffer
>  * if some of them hit, and either there is no wait_proc or the
>    wait_proc is one of the gnutls streams with new data, set the select
>    timeout to 0
>  * after the select, merge the gnutls buffer status into the select
>    returns
>
> The patch is not much longer than before, still a net reduction of code
> lines. I've done some light testing and haven't found any problem.=20

Robert,

did you get a chance to read and test this patch?

Derek




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

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


Received: (at 40665) by debbugs.gnu.org; 23 Apr 2020 02:21:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 22 22:21:00 2020
Received: from localhost ([127.0.0.1]:53706 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jRRU4-0007wB-9H
	for submit <at> debbugs.gnu.org; Wed, 22 Apr 2020 22:21:00 -0400
Received: from xtrwkvxq.outbound-mail.sendgrid.net ([167.89.24.164]:45462)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jRRU2-0007vy-UD
 for 40665 <at> debbugs.gnu.org; Wed, 22 Apr 2020 22:20:59 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type;
 s=s1; bh=YSBL356F4i3giDO3Xh5L22j6D89NEYjsYAh5aqgh5vg=;
 b=vdA8ZDY6G8S8/VTkzHnBRELRLzsV8dHDpOuBP7J7KrNaNcOwAeHd8aPMqDz0kJRrqgMV
 uQXgnI/4iJr4xvTbC31slldvRE7E3MpKmySc5vPTIYASVsCushWMZ4Rrmlhj4S9LMYnOpw
 k8Cd6Uz7pVscPXXfLRb+50ZGActSXi0pw=
Received: by filterdrecv-p3iad2-8ddf98858-z54vx with SMTP id
 filterdrecv-p3iad2-8ddf98858-z54vx-21-5EA0FB85-8
 2020-04-23 02:20:53.384376477 +0000 UTC m=+2423603.867016331
Received: from mail.3qin.us (unknown) by ismtpd0009p1sjc2.sendgrid.net (SG)
 with ESMTP id nvF7R327Qqy68X_ch1CH2w
 Thu, 23 Apr 2020 02:20:53.056 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jRRTw-0004Nr-9Y; Wed, 22 Apr 2020 22:20:52 -0400
References: <86wo6fo78r.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
 <m2tv1dwan3.fsf@HIDDEN> <86zhb5q7sw.fsf@HIDDEN>
 <m28sipvstt.fsf@HIDDEN> <86y2qorj76.fsf@HIDDEN>
 <m2wo68vq08.fsf@HIDDEN> <86368w1tge.fsf@HIDDEN>
 <864ktcfpm5.fsf@HIDDEN> <86368wfp6d.fsf@HIDDEN>
 <m2ftcvvs31.fsf@HIDDEN> <86y2qniu5m.fsf@HIDDEN>
 <m2blnjvf3r.fsf@HIDDEN> <86wo67im9w.fsf@HIDDEN>
 <m2eesffqg7.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 27.0.91
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <m2eesffqg7.fsf@HIDDEN>
Date: Thu, 23 Apr 2020 02:20:53 +0000 (UTC)
Message-ID: <86y2qnaqnv.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?AmosklGUdZx2QG0m7m2WRJ7oYA+nNCiV=2FBwDtID?=
 =?us-ascii?Q?7zPL0a+dXJ=2FExIZdVql7tI8iKEWyaFVyDOtInWx?=
 =?us-ascii?Q?xGDaznSETCvtX3grmhhoMNHT3YLb+ACJOKjrHqM?=
 =?us-ascii?Q?elPi6=2FXVlB7erXWXiUy8r+LUmpW6cCj4B4SI5X2?=
 =?us-ascii?Q?rj11PCirfb98DK5xZ9N8CCaFhX4dmj4syVTJbZ?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Robert Pluim writes: > OK, that does make sense, and might
    even be more correct, but itʼs a > bigger change. You'll need more than
   just me to agree with it. > Patch reworked: * before the select, check every
    interesting gnutls stream for available data in the buffer * if some of them
    hit, and either there is no wait_proc or the wait_proc is one of the gnutls
    streams with [...] 
 
 Content analysis details:   (1.2 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in
                             bl.spamcop.net
               [Blocked - see <https://www.spamcop.net/bl.shtml?167.89.24.164>]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [167.89.24.164 listed in wl.mailspike.net]
  0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
                             blocked.  See
                             http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
                              for more information.
                             [URIs: 3qin.us]
  0.0 UNPARSEABLE_RELAY      Informational: message has unparseable relay
                             lines
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: 0.2 (/)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


Robert Pluim writes:

> OK, that does make sense, and might even be more correct, but it=CA=BCs a
> bigger change. You'll need more than just me to agree with it.
>
Patch reworked:

 * before the select, check every interesting gnutls stream for
   available data in the buffer
 * if some of them hit, and either there is no wait_proc or the
   wait_proc is one of the gnutls streams with new data, set the select
   timeout to 0
 * after the select, merge the gnutls buffer status into the select
   returns

The patch is not much longer than before, still a net reduction of code
lines. I've done some light testing and haven't found any problem.=20


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=check_pending_before_select.patch

diff --git a/src/process.c b/src/process.c
index 91d426103d..783ce098b3 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5497,6 +5497,10 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 	}
       else
 	{
+#ifdef HAVE_GNUTLS
+	  int tls_nfds;
+	  fd_set tls_available;
+#endif
 	  /* Set the timeout for adaptive read buffering if any
 	     process has non-zero read_output_skip and non-zero
 	     read_output_delay, and we are not reading output for a
@@ -5566,6 +5570,36 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 	    }
 #endif
 
+#ifdef HAVE_GNUTLS
+          /* GnuTLS buffers data internally. We need to check if some
+	     data is available in the buffers manually before the select.
+	     And if so, we need to skip the select which could block */
+	  FD_ZERO (&tls_available);
+	  tls_nfds = 0;
+	  for (channel = 0; channel < FD_SETSIZE; ++channel)
+	    if (! NILP (chan_process[channel]) && FD_ISSET(channel, &Available))
+	      {
+		struct Lisp_Process *p =
+		  XPROCESS (chan_process[channel]);
+		if (p && p->gnutls_p && p->gnutls_state
+		    && ((emacs_gnutls_record_check_pending
+			 (p->gnutls_state))
+			> 0))
+		  {
+		    tls_nfds++;
+		    eassert (p->infd == channel);
+		    FD_SET (p->infd, &tls_available);
+		  }
+	      }
+	  /* if wait_proc is somebody else, we have to wait in select as usual.
+	     Otherwisr, clobber the timeout */
+	  if ((tls_nfds > 0) &&
+	      (!wait_proc ||
+	       (wait_proc->infd >= 0 &&
+		FD_ISSET(wait_proc->infd, &tls_available))))
+	    timeout = make_timespec (0, 0);
+#endif
+
 /* Non-macOS HAVE_GLIB builds call thread_select in xgselect.c.  */
 #if defined HAVE_GLIB && !defined HAVE_NS
 	  nfds = xg_select (max_desc + 1,
@@ -5584,60 +5618,22 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 #endif	/* !HAVE_GLIB */
 
 #ifdef HAVE_GNUTLS
-          /* GnuTLS buffers data internally.  In lowat mode it leaves
-             some data in the TCP buffers so that select works, but
-             with custom pull/push functions we need to check if some
-             data is available in the buffers manually.  */
-          if (nfds == 0)
+      /* merge tls_available into Available */
+      if (tls_nfds > 0)
+	{
+	  if (nfds == 0 || (nfds < 0 && errno == EINTR))
 	    {
-	      fd_set tls_available;
-	      int set = 0;
-
-	      FD_ZERO (&tls_available);
-	      if (! wait_proc)
-		{
-		  /* We're not waiting on a specific process, so loop
-		     through all the channels and check for data.
-		     This is a workaround needed for some versions of
-		     the gnutls library -- 2.12.14 has been confirmed
-		     to need it.  */
-		  for (channel = 0; channel < FD_SETSIZE; ++channel)
-		    if (! NILP (chan_process[channel]))
-		      {
-			struct Lisp_Process *p =
-			  XPROCESS (chan_process[channel]);
-			if (p && p->gnutls_p && p->gnutls_state
-			    && ((emacs_gnutls_record_check_pending
-				 (p->gnutls_state))
-				> 0))
-			  {
-			    nfds++;
-			    eassert (p->infd == channel);
-			    FD_SET (p->infd, &tls_available);
-			    set++;
-			  }
-		      }
-		}
-	      else
-		{
-		  /* Check this specific channel.  */
-		  if (wait_proc->gnutls_p /* Check for valid process.  */
-		      && wait_proc->gnutls_state
-		      /* Do we have pending data?  */
-		      && ((emacs_gnutls_record_check_pending
-			   (wait_proc->gnutls_state))
-			  > 0))
-		    {
-		      nfds = 1;
-		      eassert (0 <= wait_proc->infd);
-		      /* Set to Available.  */
-		      FD_SET (wait_proc->infd, &tls_available);
-		      set++;
-		    }
-		}
-	      if (set)
-		Available = tls_available;
+	      /* fast path, just copy */
+	      nfds = tls_nfds;
+	      Available = tls_available;
 	    }
+	  else if (nfds > 0)
+	    /* slow path, merge one by one.
+	       Note: nfds does not need to be accurate, just positive is enough */
+	    for (channel = 0; channel < FD_SETSIZE; ++channel)
+	      if (FD_ISSET(channel, &tls_available))
+		  FD_SET(channel, &Available);
+	}
 #endif
 	}
 

--=-=-=--




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

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


Received: (at 40665) by debbugs.gnu.org; 22 Apr 2020 16:57:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 22 12:57:15 2020
Received: from localhost ([127.0.0.1]:53070 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jRIgV-0008NC-FW
	for submit <at> debbugs.gnu.org; Wed, 22 Apr 2020 12:57:15 -0400
Received: from xtrwkvxq.outbound-mail.sendgrid.net ([167.89.24.164]:11544)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jRIgT-0008Mx-8V
 for 40665 <at> debbugs.gnu.org; Wed, 22 Apr 2020 12:57:14 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=Ji+cDuYhzMEhG6Ui37pk9vZ4Mcpx0+y10TYq6Jd6o8Y=;
 b=mThOVDfHdjrcpK/XGVgppbGow4kKsYhnVf9O5GLl2w7iRndgRMKNso/0RPlL9+QZQNHC
 Jgk1fWEzMQEsPgGxOPhsUouBHJ6nLR6V7NCmVuId1/sqfYv8KOTAX8qHLB8unCKYXOnDLR
 hHPbvCAfABV882BlTH3oV+piXM3rq6Ycc=
Received: by filter0072p3las1.sendgrid.net with SMTP id
 filter0072p3las1-6642-5EA07763-27
 2020-04-22 16:57:07.141620472 +0000 UTC m=+586511.280732613
Received: from mail.3qin.us (unknown) by ismtpd0006p1sjc2.sendgrid.net (SG)
 with ESMTP id Fhxh8NKzRNeCnsSHgiKTEg
 Wed, 22 Apr 2020 16:57:06.927 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jRIgM-0000cy-Au; Wed, 22 Apr 2020 12:57:06 -0400
References: <86wo6fo78r.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
 <m2tv1dwan3.fsf@HIDDEN> <86zhb5q7sw.fsf@HIDDEN>
 <m28sipvstt.fsf@HIDDEN> <86y2qorj76.fsf@HIDDEN>
 <m2wo68vq08.fsf@HIDDEN> <86368w1tge.fsf@HIDDEN>
 <864ktcfpm5.fsf@HIDDEN> <86368wfp6d.fsf@HIDDEN>
 <m2ftcvvs31.fsf@HIDDEN> <86y2qniu5m.fsf@HIDDEN>
 <m2blnjvf3r.fsf@HIDDEN> <86wo67im9w.fsf@HIDDEN>
 <m2eesffqg7.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 27.0.91
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <m2eesffqg7.fsf@HIDDEN>
Date: Wed, 22 Apr 2020 16:57:07 +0000 (UTC)
Message-ID: <86v9lrihlp.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?AmQpeOe7LuP41oLk2ULETDh0QNiFqNOQtMLQhBa?=
 =?us-ascii?Q?yQCTs+wa0eDr4RDBdNqTgiDl1L3iF+9OgJZOFQa?=
 =?us-ascii?Q?fc6yG5fY4Ab0a13pBVi72aYOPlIAmEUosZyrsjS?=
 =?us-ascii?Q?V+DvOMqXSdPFpNr4+O7DNAd8Vpn49Sfz0JLsnf=2F?=
 =?us-ascii?Q?5Ssmtp5n5rgQgFrbE=3D?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Robert Pluim writes: > Thatʼs not quite it. 'wait_reading_process_output'
    broadly does one of: > > 1. Read from some fds, give me what you have or
   timeout > 2. Read from some fds, wait until you have something for this >
   [...] 
 
 Content analysis details:   (1.2 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
  1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in
                             bl.spamcop.net
               [Blocked - see <https://www.spamcop.net/bl.shtml?167.89.24.164>]
  0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
                             blocked.  See
                             http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
                              for more information.
                             [URIs: 3qin.us]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [167.89.24.164 listed in wl.mailspike.net]
  0.0 UNPARSEABLE_RELAY      Informational: message has unparseable relay
                             lines
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: 0.2 (/)


Robert Pluim writes:

> That=CA=BCs not quite it. 'wait_reading_process_output' broadly does one =
of:
>
>     1. Read from some fds, give me what you have or timeout
>     2. Read from some fds, wait until you have something for this
>     specific process, or timeout
>     3. Read *only* for this process, wait until you have something, or
>     timeout
>
> [1] is very common, [3] is not. The case I=CA=BCm discussing is [2] (via
> accept-process-output), and as it stands you've transformed it into a
> form of [1] (and yes, in [3] the select is only done for the fd for a
> specific process).

Let me read the code more carefully to see what to do.
>
> OK, that does make sense, and might even be more correct, but it=CA=BCs a
> bigger change. You'll need more than just me to agree with it.

I'll get back to you with a patch addressing both points later, maybe
tonight.

Derek




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

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


Received: (at 40665) by debbugs.gnu.org; 22 Apr 2020 16:14:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 22 12:14:28 2020
Received: from localhost ([127.0.0.1]:53020 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jRI16-0005EE-3f
	for submit <at> debbugs.gnu.org; Wed, 22 Apr 2020 12:14:28 -0400
Received: from mail-wm1-f46.google.com ([209.85.128.46]:38879)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1jRI13-0005Dy-Sj
 for 40665 <at> debbugs.gnu.org; Wed, 22 Apr 2020 12:14:27 -0400
Received: by mail-wm1-f46.google.com with SMTP id g12so3067249wmh.3
 for <40665 <at> debbugs.gnu.org>; Wed, 22 Apr 2020 09:14:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :mime-version:content-transfer-encoding;
 bh=v9LgOUVN2Pqz56wAmhlWS624n68CK4QbmxMz9B2+i4s=;
 b=W7Dr1/j7KMEADku0TEA/Xy6gre95fHd8Ha44fGH8rMucrN/rSqFOEISHBsk6PLx3mV
 SG7kmzb0f8tXbSsvMz2EB+pEsbH3GyBGBqsJv8lhFYkN2WKOLi8YQ2u9dfSksuAkrZRH
 g6mjEwbY8WI8r6R2beevs8FmClbk8lcpdVs8TQeYyjIML9+gE07MksXGvWNoSoHonH2i
 KlLL1FSBPcbDN8/e1LhB+AdWv9sH9qFOFWfUeZKRTS7SAHFPWTnH0szeWZot+WTfMQ9w
 xkGUerBDvoDTQpm27Ev/ev+/HI8pX0cZEzfkzp++GQy3smogwelggvDSMLO0NO6MiC1V
 4zOA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:mime-version:content-transfer-encoding;
 bh=v9LgOUVN2Pqz56wAmhlWS624n68CK4QbmxMz9B2+i4s=;
 b=icSEOeU5LfWgaqArRPKG9YgWcOHL1ZcltXq6rB5gfTYh/yutH6KaxWOfk770hELGFn
 jYWRlY3jYnT8m5/SpfSdFNEEE3J+43O8bHiKxLIBjkkmNqAtxDp5ztiG6mMVw1PDhN8A
 l4WEFRE4xdg1/yZqrjRD28EoeQC2pP2A5W+F6bZD4K6dYoW/Mg/bVdP2Gvn3lVdoy/qq
 197jSpvEIuv+WnAtzVSKRBaYgZtNww5X5FZDd3OSMmY2hEvLkeWnyVsxjlZ14Tm8qjqb
 2QWbI9xbX/C+vWOsNl+tNHr8i/jcROkwuvvLuTdh+rmHYNgO5I8rSSa0brzGhoXVG2zC
 8FpQ==
X-Gm-Message-State: AGi0Puai0OyRb3Vot4CVirrmHf4S7h+GzfvLu+zkbEVjVaZ7nNNDo+j9
 qtrNq9BZDhb614now3pyxYyBzDDC
X-Google-Smtp-Source: APiQypKx3xuUwoPBxNBo46gUokUuung77qcJ8u/b4v0/Sjb4Cmqox1FewUbGN1vTojoRsBaJFK1enw==
X-Received: by 2002:a1c:a344:: with SMTP id m65mr11382066wme.20.1587572059357; 
 Wed, 22 Apr 2020 09:14:19 -0700 (PDT)
Received: from rpluim-mac ([2a01:e34:ecfc:a860:f038:efd9:aa5f:7833])
 by smtp.gmail.com with ESMTPSA id q10sm9234216wrv.95.2020.04.22.09.14.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 22 Apr 2020 09:14:18 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
References: <86wo6fo78r.fsf@HIDDEN> <86ftd35930.fsf@HIDDEN>
 <86d086dkgq.fsf@HIDDEN> <86eeslecnf.fsf@HIDDEN>
 <m24kthgh28.fsf@HIDDEN> <86blnnebh3.fsf@HIDDEN>
 <m2y2qr5u9t.fsf@HIDDEN> <86zhb5hecx.fsf@HIDDEN>
 <86eeshpqdb.fsf@HIDDEN> <m2tv1dwan3.fsf@HIDDEN>
 <86zhb5q7sw.fsf@HIDDEN> <m28sipvstt.fsf@HIDDEN>
 <86y2qorj76.fsf@HIDDEN> <m2wo68vq08.fsf@HIDDEN>
 <86368w1tge.fsf@HIDDEN> <864ktcfpm5.fsf@HIDDEN>
 <86368wfp6d.fsf@HIDDEN> <m2ftcvvs31.fsf@HIDDEN>
 <86y2qniu5m.fsf@HIDDEN> <m2blnjvf3r.fsf@HIDDEN>
 <86wo67im9w.fsf@HIDDEN>
Date: Wed, 22 Apr 2020 18:14:16 +0200
In-Reply-To: <86wo67im9w.fsf@HIDDEN> (Derek Zhou's message of "Wed, 22
 Apr 2020 15:16:12 +0000 (UTC)")
Message-ID: <m2eesffqg7.fsf@HIDDEN>
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: 40665
Cc: 40665 <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: -1.0 (-)

>>>>> On Wed, 22 Apr 2020 15:16:12 +0000 (UTC), Derek Zhou <derek@HIDDEN> =
said:
    >> The reason for checking wait_proc is to allow 'accept-process-output'
    >> to specify that emacs should return only when there is data for that
    >> specific process, with your patch it can return if there is any data
    >> in the TLS buffers for any connection, but none for wait_proc. That
    >> would make 'accept-process-output' return earlier than expected, or
    >> even return for the case where the timeout is infinite.
    >>=20
    >> A quick survey of the emacs sources shows almost every call to
    >> 'accept-process-output' passes in wait_proc, so I think that your
    >> change as it stands is too risky. With a check for wait_proc it might
    >> be OK.
    >>=20
    Derek> My counter argument is if we really only care about some of the =
the fds
    Derek> but not all the fds, the proper way is to let select know by pas=
sing in
    Derek> the proper narrower set of fds, maybe the code is already this w=
ay? It is very
    Derek> complicated so I am not sure. I am checking only those fds that =
are both
    Derek> 1, gnutls managed, and the 2 set in the input for readfds for the
    Derek> select, so I believe it is the right thing.

That=CA=BCs not quite it. 'wait_reading_process_output' broadly does one of:

    1. Read from some fds, give me what you have or timeout
    2. Read from some fds, wait until you have something for this
    specific process, or timeout
    3. Read *only* for this process, wait until you have something, or
    timeout

[1] is very common, [3] is not. The case I=CA=BCm discussing is [2] (via
accept-process-output), and as it stands you've transformed it into a
form of [1] (and yes, in [3] the select is only done for the fd for a
specific process).

    Derek> Another way is to still do a zero timeout select, and merge the =
gnutls
    Derek> ready set with the select ready set. It is more intrusive but pr=
obably
    Derek> closer to the original intent of the code. I can write the path =
that way
    Derek> if you want.
    >>=20
    >> I don=CA=BCt think we always do a zero timeout select. This sounds e=
ven
    >> riskier.

    Derek> I am proposing doing a zero timeout select ONLY if the gnutls bu=
ffer
    Derek> check already flags some of the channels. This way we can also s=
elect those
    Derek> FDs that are not gnutls managed, but already ready to read at th=
e same
    Derek> moment. It is closer to the origin intention of the select, I
    Derek> believe. If the gnutls buffer check does not flag anything of ca=
use we do
    Derek> the select with timeout exactly as before. My current patch may =
leave
    Derek> out some ready fd unchecked until the next round.

OK, that does make sense, and might even be more correct, but it=CA=BCs a
bigger change. You'll need more than just me to agree with it.

Robert




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

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


Received: (at 40665) by debbugs.gnu.org; 22 Apr 2020 15:16:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 22 11:16:21 2020
Received: from localhost ([127.0.0.1]:52896 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jRH6r-0001Ih-Dx
	for submit <at> debbugs.gnu.org; Wed, 22 Apr 2020 11:16:21 -0400
Received: from xtrwkvxq.outbound-mail.sendgrid.net ([167.89.24.164]:11511)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jRH6o-0001IS-4E
 for 40665 <at> debbugs.gnu.org; Wed, 22 Apr 2020 11:16:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=iI+rwtOhMmvUzAJunqs18UpM0yd37lPc3cScxF1dAZg=;
 b=LJuvUJhPvycgozDBG15aJzz8XM+ozjIPR8C2vr4l2BSAx8LA4mPp9pN8LTBRFDEUuSrP
 WaxzqxxzDbGjIdU7YQGQir0qG4P58jytDxuKeqZlgawxql9RpWGnN41vT8chcYzxqtL2Yz
 +gnIEwbNHrQ0mKjWaOg5Sps2bo+lRZOns=
Received: by filterdrecv-p3iad2-8ddf98858-szfkb with SMTP id
 filterdrecv-p3iad2-8ddf98858-szfkb-20-5EA05FBC-70
 2020-04-22 15:16:12.648618022 +0000 UTC m=+2383721.465741648
Received: from mail.3qin.us (unknown) by ismtpd0021p1las1.sendgrid.net (SG)
 with ESMTP id oYGtVo65T5aWgv-QqQVqQw
 Wed, 22 Apr 2020 15:16:12.217 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jRH6h-0000Vq-F4; Wed, 22 Apr 2020 11:16:11 -0400
References: <86wo6fo78r.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
 <m2tv1dwan3.fsf@HIDDEN> <86zhb5q7sw.fsf@HIDDEN>
 <m28sipvstt.fsf@HIDDEN> <86y2qorj76.fsf@HIDDEN>
 <m2wo68vq08.fsf@HIDDEN> <86368w1tge.fsf@HIDDEN>
 <864ktcfpm5.fsf@HIDDEN> <86368wfp6d.fsf@HIDDEN>
 <m2ftcvvs31.fsf@HIDDEN> <86y2qniu5m.fsf@HIDDEN>
 <m2blnjvf3r.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 27.0.91
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <m2blnjvf3r.fsf@HIDDEN>
Date: Wed, 22 Apr 2020 15:16:12 +0000 (UTC)
Message-ID: <86wo67im9w.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?Amw6Y86FzpbFMyBR+VjrOQeRUAwlUiCKnwAgHKJ?=
 =?us-ascii?Q?N0N=2FnneHsRFmUOcCdZf8LslpLIrcNfaGMHYwDUz?=
 =?us-ascii?Q?a9Pkwc8XXQpcAjX+=2FqmA2ZuWHQi8CrXKjmhYoJL?=
 =?us-ascii?Q?ta+7=2F0S=2F0p940dzveoEZvbUzRCpUN734Ni+jtI7?=
 =?us-ascii?Q?BsEuULO4SyoZfo1sLmevwhrNe5qs=2F1o0tMLHb5?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Robert Pluim writes: > Derek> I don't quite understand the
 wait_proc business. The idea of the patch > Derek> is to detect that out
 of all the fds that are going to be selected, how > Derek> many are gnutls
 managed and ar [...] 
 Content analysis details:   (1.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in
 bl.spamcop.net
 [Blocked - see <https://www.spamcop.net/bl.shtml?167.89.24.164>]
 0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
 blocked.  See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
 for more information. [URIs: 3qin.us]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [167.89.24.164 listed in wl.mailspike.net]
 0.0 UNPARSEABLE_RELAY      Informational: message has unparseable relay
 lines
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: 0.2 (/)


Robert Pluim writes:

>     Derek> I don't quite understand the wait_proc business. The idea of t=
he patch
>     Derek> is to detect that out of all the fds that are going to be sele=
cted, how
>     Derek> many are gnutls managed and are ready from the gnutls buffer? =
If the
>     Derek> answer is positive, we skip the select and pretend the select =
return
>     Derek> those fds only. I think this is safe; because it is one of the=
 possible
>     Derek> and legal return of the select, wait_proc or not.
>
> The reason for checking wait_proc is to allow 'accept-process-output'
> to specify that emacs should return only when there is data for that
> specific process, with your patch it can return if there is any data
> in the TLS buffers for any connection, but none for wait_proc. That
> would make 'accept-process-output' return earlier than expected, or
> even return for the case where the timeout is infinite.
>
> A quick survey of the emacs sources shows almost every call to
> 'accept-process-output' passes in wait_proc, so I think that your
> change as it stands is too risky. With a check for wait_proc it might
> be OK.
>
My counter argument is if we really only care about some of the the fds
but not all the fds, the proper way is to let select know by passing in
the proper narrower set of fds, maybe the code is already this way? It is v=
ery
complicated so I am not sure. I am checking only those fds that are both
1, gnutls managed, and the 2 set in the input for readfds for the
select, so I believe it is the right thing.

>     Derek> Another way is to still do a zero timeout select, and merge th=
e gnutls
>     Derek> ready set with the select ready set. It is more intrusive but =
probably
>     Derek> closer to the original intent of the code. I can write the pat=
h that way
>     Derek> if you want.
>
> I don=CA=BCt think we always do a zero timeout select. This sounds even
> riskier.

I am proposing doing a zero timeout select ONLY if the gnutls buffer
check already flags some of the channels. This way we can also select those
FDs that are not gnutls managed, but already ready to read at the same
moment. It is closer to the origin intention of the select, I
believe. If the gnutls buffer check does not flag anything of cause we do
the select with timeout exactly as before. My current patch may leave
out some ready fd unchecked until the next round.

Derek




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

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


Received: (at 40665) by debbugs.gnu.org; 22 Apr 2020 13:12:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 22 09:12:53 2020
Received: from localhost ([127.0.0.1]:51548 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jRFBN-0008Rf-De
	for submit <at> debbugs.gnu.org; Wed, 22 Apr 2020 09:12:53 -0400
Received: from mail-wm1-f45.google.com ([209.85.128.45]:54208)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1jRFBL-0008RR-AI
 for 40665 <at> debbugs.gnu.org; Wed, 22 Apr 2020 09:12:51 -0400
Received: by mail-wm1-f45.google.com with SMTP id t63so2258720wmt.3
 for <40665 <at> debbugs.gnu.org>; Wed, 22 Apr 2020 06:12:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :mime-version:content-transfer-encoding;
 bh=7XqklI4Z/ZQLLa1DzjNuq7HUXGJlCoDP24QCDJyqAdo=;
 b=e1wqZdFE2U4jPB3/KEV4Zh4xwcitIsQ4egSr5jJcLIfvn7E2uK+aPslbXMUbfdMCLg
 A14Hmol7y45MFH6dtxvMrV9Zt6aaZakAXks1WIxIELFBlArKb8gFaksftOo4TRNK4gPy
 Lxx+1puvzJCXrzlqoD1q1Pbai/otzggYLVCquQsnkDO50U9b1hh+jaFJtmkB+ERIyKOy
 gD3hYNsG3NGP6lE3Bdffk+zbN8hCgDkxaQUYT1xTqLYY8Qo/b702qVCe1T+wMQkGllOB
 TZsyXjPkJ754GEQijdGWUDUFS3BLCYQkftCT+uNkz7IJeGxguz0JW1GZj5F8NosIs8uj
 3hJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:mime-version:content-transfer-encoding;
 bh=7XqklI4Z/ZQLLa1DzjNuq7HUXGJlCoDP24QCDJyqAdo=;
 b=ECIJsFSW9keTK3ZqqX8XGK3kNONqUCN9gya4nLJCuPWL9vAB71cOV0iF0lt+BgfQDK
 RCVNz0FVsTN1h+P+9pzX3lcNRuvmUkbHYLEgURsecU8ek2PGKmCcA4bejcTEBeeE+9Xr
 CkFVTlhqC+QLHW5dmvXguyrX+vTZswNEoMGyf4FNKL6auQ5bP0tZhbJKwPopVfmMZX3B
 zptM/TKgr+AagBiXEbd7XPsKNPnqHyYdv+i4eFg+Kv+dR60+pxJbG+f7Ris0+xq4GVLT
 660qJMqQjWyQHdDT234irl9n735k/0rlV859rxog+UmFa6E3k006Th9aAKIFAisiATkB
 xrPA==
X-Gm-Message-State: AGi0Pua8wC78m79gk20ktKqNqFcevLyspXXLKdiFyASqyQtabFlRK9Fx
 SK0tB71p82LF0Q3RuZMr5RLBI4Ia
X-Google-Smtp-Source: APiQypLpxZFFtdRm60eNesrdYsK1QOfqM9CIfRCGzeMM5xjEGtCQh94UdnkUnkl7FL9boXwtfEtmeA==
X-Received: by 2002:a7b:c147:: with SMTP id z7mr11247260wmi.52.1587561164959; 
 Wed, 22 Apr 2020 06:12:44 -0700 (PDT)
Received: from rpluim-mac ([2a01:e34:ecfc:a860:f038:efd9:aa5f:7833])
 by smtp.gmail.com with ESMTPSA id h13sm7835558wrs.22.2020.04.22.06.12.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 22 Apr 2020 06:12:44 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
References: <86wo6fo78r.fsf@HIDDEN> <86imhz5m0f.fsf@HIDDEN>
 <86h7xj5fae.fsf@HIDDEN> <86ftd35930.fsf@HIDDEN>
 <86d086dkgq.fsf@HIDDEN> <86eeslecnf.fsf@HIDDEN>
 <m24kthgh28.fsf@HIDDEN> <86blnnebh3.fsf@HIDDEN>
 <m2y2qr5u9t.fsf@HIDDEN> <86zhb5hecx.fsf@HIDDEN>
 <86eeshpqdb.fsf@HIDDEN> <m2tv1dwan3.fsf@HIDDEN>
 <86zhb5q7sw.fsf@HIDDEN> <m28sipvstt.fsf@HIDDEN>
 <86y2qorj76.fsf@HIDDEN> <m2wo68vq08.fsf@HIDDEN>
 <86368w1tge.fsf@HIDDEN> <864ktcfpm5.fsf@HIDDEN>
 <86368wfp6d.fsf@HIDDEN> <m2ftcvvs31.fsf@HIDDEN>
 <86y2qniu5m.fsf@HIDDEN>
Date: Wed, 22 Apr 2020 15:12:40 +0200
In-Reply-To: <86y2qniu5m.fsf@HIDDEN> (Derek Zhou's message of "Wed, 22
 Apr 2020 12:25:59 +0000 (UTC)")
Message-ID: <m2blnjvf3r.fsf@HIDDEN>
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: 40665
Cc: 40665 <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: -1.0 (-)

>>>>> On Wed, 22 Apr 2020 12:25:59 +0000 (UTC), Derek Zhou <derek@HIDDEN> =
said:

    Derek> Robert Pluim writes:

    >>>>>>> On Tue, 21 Apr 2020 22:29:30 +0000 (UTC), Derek Zhou <derek@3qi=
n.us> said:
    >>=20
    Derek> Version 3, add safty guard for tls read detection. Please use th=
is one.
    Derek> You may want to review this carefully.
    >>=20
    >> I haven't tested it yet, but what about wait_proc?
    >>

I=CA=BCve tested it lightly and it fixes <https://www.opensource.com>

    Derek> I don't quite understand the wait_proc business. The idea of the=
 patch
    Derek> is to detect that out of all the fds that are going to be select=
ed, how
    Derek> many are gnutls managed and are ready from the gnutls buffer? If=
 the
    Derek> answer is positive, we skip the select and pretend the select re=
turn
    Derek> those fds only. I think this is safe; because it is one of the p=
ossible
    Derek> and legal return of the select, wait_proc or not.

The reason for checking wait_proc is to allow 'accept-process-output'
to specify that emacs should return only when there is data for that
specific process, with your patch it can return if there is any data
in the TLS buffers for any connection, but none for wait_proc. That
would make 'accept-process-output' return earlier than expected, or
even return for the case where the timeout is infinite.

A quick survey of the emacs sources shows almost every call to
'accept-process-output' passes in wait_proc, so I think that your
change as it stands is too risky. With a check for wait_proc it might
be OK.

    Derek> Another way is to still do a zero timeout select, and merge the =
gnutls
    Derek> ready set with the select ready set. It is more intrusive but pr=
obably
    Derek> closer to the original intent of the code. I can write the path =
that way
    Derek> if you want.

I don=CA=BCt think we always do a zero timeout select. This sounds even
riskier.

Robert




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

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


Received: (at 40665) by debbugs.gnu.org; 22 Apr 2020 12:26:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 22 08:26:07 2020
Received: from localhost ([127.0.0.1]:51470 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jRES6-0007Fe-Qp
	for submit <at> debbugs.gnu.org; Wed, 22 Apr 2020 08:26:07 -0400
Received: from xtrwkvxq.outbound-mail.sendgrid.net ([167.89.24.164]:3427)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jRES4-0007F8-TI
 for 40665 <at> debbugs.gnu.org; Wed, 22 Apr 2020 08:26:05 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=bIyvad8wqeliIg08Wzi1yirwl7PPgxuWfh9HjDgd8t4=;
 b=YBiBT/ORXdt25eHrwIJ2wWgZtBD6SuNMBYsfNrGuYgDD59B/5JGABHVbq7IaIl8vvpHG
 TWoQpQaHTz7NEwfGpXIh/M3MIXeq9tx/fCXU0vrwDHsKzNOCKX1GOLnN7Kp9sYxPvph2Ww
 R+TcHl++dlTJxq/E59NTMAjbzOar+CNro=
Received: by filter0135p3las1.sendgrid.net with SMTP id
 filter0135p3las1-28320-5EA037D6-14D
 2020-04-22 12:25:58.992856376 +0000 UTC m=+570214.911809927
Received: from mail.3qin.us (unknown) by ismtpd0033p1las1.sendgrid.net (SG)
 with ESMTP id OfrgLck9TmKZqGMGF3Q81Q
 Wed, 22 Apr 2020 12:25:58.870 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jRERx-0000Ia-Si; Wed, 22 Apr 2020 08:25:57 -0400
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
 <m2tv1dwan3.fsf@HIDDEN> <86zhb5q7sw.fsf@HIDDEN>
 <m28sipvstt.fsf@HIDDEN> <86y2qorj76.fsf@HIDDEN>
 <m2wo68vq08.fsf@HIDDEN> <86368w1tge.fsf@HIDDEN>
 <864ktcfpm5.fsf@HIDDEN> <86368wfp6d.fsf@HIDDEN>
 <m2ftcvvs31.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 27.0.91
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <m2ftcvvs31.fsf@HIDDEN>
Date: Wed, 22 Apr 2020 12:25:59 +0000 (UTC)
Message-ID: <86y2qniu5m.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?Am+BSms51Xv14p=2Fy6kRXYzWEiwUjfzGcLIaan5F?=
 =?us-ascii?Q?p3fI5+kfdBqad5e7q8FRY9hjrTWxBl8vOiN1q2Y?=
 =?us-ascii?Q?7AHvRCdrDBvuzPholqTktQtIoGkSnhtAfUgKEMK?=
 =?us-ascii?Q?MRtgqeuJ+3xytlLNzk9BGduPwAZQKEZmp8iTdUd?=
 =?us-ascii?Q?RF6TtGk2U3pnUGg6w=3D?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: -1.0 (-)


Robert Pluim writes:

>>>>>> On Tue, 21 Apr 2020 22:29:30 +0000 (UTC), Derek Zhou <derek@HIDDEN> said:
>
>     Derek> Version 3, add safty guard for tls read detection. Please use this one.
>     Derek> You may want to review this carefully.
>
> I haven't tested it yet, but what about wait_proc?
>
I don't quite understand the wait_proc business. The idea of the patch
is to detect that out of all the fds that are going to be selected, how
many are gnutls managed and are ready from the gnutls buffer? If the
answer is positive, we skip the select and pretend the select return
those fds only. I think this is safe; because it is one of the possible
and legal return of the select, wait_proc or not.

Another way is to still do a zero timeout select, and merge the gnutls
ready set with the select ready set. It is more intrusive but probably
closer to the original intent of the code. I can write the path that way
if you want.

Derek




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

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


Received: (at 40665) by debbugs.gnu.org; 22 Apr 2020 08:32:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 22 04:32:29 2020
Received: from localhost ([127.0.0.1]:51227 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jRAo1-0005GF-0l
	for submit <at> debbugs.gnu.org; Wed, 22 Apr 2020 04:32:29 -0400
Received: from mail-wr1-f42.google.com ([209.85.221.42]:44822)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1jRAnz-0005G0-An
 for 40665 <at> debbugs.gnu.org; Wed, 22 Apr 2020 04:32:27 -0400
Received: by mail-wr1-f42.google.com with SMTP id d17so1301759wrg.11
 for <40665 <at> debbugs.gnu.org>; Wed, 22 Apr 2020 01:32:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :mime-version; bh=X/1+5BXeYHcTJFRrX+2KOAxc+WI5aJ/96FTjhRu9XAU=;
 b=VRpG5nBGh5/jpo8lqmBL+pniK269L2rT48SiaSKpaWFxECSAhbBwcM5yRMQTnOohHl
 gAqv9CE76M1U+/IhnBLoNLoDk9j5bnQoqQgA6koaRnVGqQNFowSURH2EXUJVnFxmqzeW
 jglvsGBtdxDrgLK44w0tJn5P+h1cuFEPnuNA8cCJTB5AomsGaaEgragbJm2ODe2q2Oz2
 D6Mb8XEq+MyCQud+oq5sLLE1DLes+v5Vg86q7B6poym5z87tgjw2tJm3eQ35kc70Jpjn
 ttSllTh7IIFQYaBkyBMDjVfJzKZhZMvloPLwTYKy/hH7uYo2sv1Lls0F19zZ0PlRYfbl
 AXng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:mime-version;
 bh=X/1+5BXeYHcTJFRrX+2KOAxc+WI5aJ/96FTjhRu9XAU=;
 b=Ew7ZRPDZ0XMq6GxmTM5fQB9SmB00mVjXyHyBwulluvtqc3/s4qzLuqLZ6D9tay6qv6
 s2RHt+co1eBx9l2q9k6ETuA53cAcbXGHf7vXaChuCYBvTlHXg8D9RQ5T5EaVQEVz6foX
 e6+Rrk1Xb/LNAnwEQzL/fiovaMOp01yYq1iVM3fZjfuikubL9SmlkV/vTo8uVFPIj7dp
 yOJFHrF0tLzjz0KxZlnv1xF4pGNNYh1FV7FLcyiLLTSHNvzy7rN3e81e81Xq8SSqveX7
 us+fX+HfNyuJu9uf+WNyh4/3EMJI6d1ButfZ0oXIfVQKhghC1Zzk5MEw8zRLlC2zsU46
 ospA==
X-Gm-Message-State: AGi0PuYZrrEUGBOuFE3j92ucPLMUzbshOv0Tnkld5jtNqqpXIeqhVhqV
 Pawk4w/80KDqN7mP+R8oeORj0Ifn
X-Google-Smtp-Source: APiQypL7KBGM6uE85M6TXUnQ02WxM7dElqFhDzWMnpj06r9bxv6CnUFe26nCAHRdxuUghnDRyeXGcg==
X-Received: by 2002:adf:dbce:: with SMTP id e14mr26624834wrj.337.1587544340922; 
 Wed, 22 Apr 2020 01:32:20 -0700 (PDT)
Received: from rpluim-mac ([2a01:e34:ecfc:a860:f038:efd9:aa5f:7833])
 by smtp.gmail.com with ESMTPSA id z1sm6713767wmf.15.2020.04.22.01.32.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 22 Apr 2020 01:32:20 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
 <m2tv1dwan3.fsf@HIDDEN> <86zhb5q7sw.fsf@HIDDEN>
 <m28sipvstt.fsf@HIDDEN> <86y2qorj76.fsf@HIDDEN>
 <m2wo68vq08.fsf@HIDDEN> <86368w1tge.fsf@HIDDEN>
 <864ktcfpm5.fsf@HIDDEN> <86368wfp6d.fsf@HIDDEN>
Date: Wed, 22 Apr 2020 10:32:18 +0200
In-Reply-To: <86368wfp6d.fsf@HIDDEN> (Derek Zhou's message of "Tue, 21
 Apr 2020 22:29:30 +0000 (UTC)")
Message-ID: <m2ftcvvs31.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: -1.0 (-)

>>>>> On Tue, 21 Apr 2020 22:29:30 +0000 (UTC), Derek Zhou <derek@HIDDEN> said:

    Derek> Version 3, add safty guard for tls read detection. Please use this one.
    Derek> You may want to review this carefully.

I haven't tested it yet, but what about wait_proc?

Robert




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

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


Received: (at 40665) by debbugs.gnu.org; 21 Apr 2020 22:29:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 21 18:29:39 2020
Received: from localhost ([127.0.0.1]:50904 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jR1Oc-0006xG-TO
	for submit <at> debbugs.gnu.org; Tue, 21 Apr 2020 18:29:39 -0400
Received: from xtrwkkxd.outbound-mail.sendgrid.net ([167.89.17.173]:39079)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jR1Oa-0006x1-OW
 for 40665 <at> debbugs.gnu.org; Tue, 21 Apr 2020 18:29:37 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type;
 s=s1; bh=NBgo14djU+xbyqz28zVHqrShZHO2OdXZY9XXczChZEw=;
 b=P8Z0Kj95H/QG38n14Sb/Nzxvf5ROwm+mz8nziO1d9n0blL5gL/gQ4L7IJ2FKjoVDl3Wx
 pVs0TXH7BOjTSDX435edSxiRn8NOpY4mUEtyLHR7X030jBGhZpXIAIOZA605XEu5w/eZqO
 OmpSXp1fHaY0KGiggYyzbfGLjnQ9IyuI0=
Received: by filter0072p3las1.sendgrid.net with SMTP id
 filter0072p3las1-6642-5E9F73CA-FE
 2020-04-21 22:29:30.879111203 +0000 UTC m=+520055.018223618
Received: from mail.3qin.us (unknown) by ismtpd0013p1las1.sendgrid.net (SG)
 with ESMTP id EOxmKH4XTnK3mCCv0GDLiA
 Tue, 21 Apr 2020 22:29:30.687 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jR1OU-0007Jy-6h; Tue, 21 Apr 2020 18:29:30 -0400
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
 <m2tv1dwan3.fsf@HIDDEN> <86zhb5q7sw.fsf@HIDDEN>
 <m28sipvstt.fsf@HIDDEN> <86y2qorj76.fsf@HIDDEN>
 <m2wo68vq08.fsf@HIDDEN> <86368w1tge.fsf@HIDDEN>
 <864ktcfpm5.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 27.0.91
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <864ktcfpm5.fsf@HIDDEN>
Date: Tue, 21 Apr 2020 22:29:30 +0000 (UTC)
Message-ID: <86368wfp6d.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?AmF8iln4V4Yw=2FcI7KRgFe7RkZP9gwF=2FIq9UCax7?=
 =?us-ascii?Q?4AOehJQOR=2FLFNj37gImnZYCxnju92TPoE0R4xMQ?=
 =?us-ascii?Q?WV1eiVYuKuqxI+e5TfqVfWkUaiLXupa1I4C0XBU?=
 =?us-ascii?Q?tWVxi0sjkLB0wMmUbqVqi2ErMEmx84Kc0=2FtELZx?=
 =?us-ascii?Q?HVvr=2F0U2HVtcUapGk=3D?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Derek Zhou writes: > Derek Zhou writes: > >> Robert Pluim
   writes: >> >>> Thatʼs always possible. You'd have to stick some instrumentation
    in >>> things like connect_network_socket and wait_reading_process_output
    to >>> [...] 
 
 Content analysis details:   (1.2 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in
                             bl.spamcop.net
               [Blocked - see <https://www.spamcop.net/bl.shtml?167.89.17.173>]
  0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
                             blocked.  See
                             http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
                              for more information.
                             [URIs: 3qin.us]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [167.89.17.173 listed in wl.mailspike.net]
  0.0 UNPARSEABLE_RELAY      Informational: message has unparseable relay
                             lines
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: 0.2 (/)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


Derek Zhou writes:

> Derek Zhou writes:
>
>> Robert Pluim writes:
>>
>>> That=CA=BCs always possible. You'd have to stick some instrumentation i=
n
>>> things like connect_network_socket and wait_reading_process_output to
>>> narrow it down.
>>>
>> I think what happened is gnutls's internal buffering exhausts the
>> available data from the socket, so select blocks. There is an comment in
>> the code said gnutls leave one byte in the socket for select, but I
>> don't think it is doing this anymore. The following patch move the check
>> before the select and skip the select if there is data to be read in
>> gnutls. It fixed the occational stall in https.
>
> Sorry, the previous patch was wrong. Cannot reuse the fd_set intended
> for select. Corrected:
>
Version 3, add safty guard for tls read detection. Please use this one.
You may want to review this carefully.


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=check_pending_before_select.patch

diff --git a/src/process.c b/src/process.c
index 91d426103d..683c28b3fd 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5566,7 +5566,38 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 	    }
 #endif
 
-/* Non-macOS HAVE_GLIB builds call thread_select in xgselect.c.  */
+#ifdef HAVE_GNUTLS
+          /* GnuTLS buffers data internally. We need to check if some
+             data is available in the buffers manually before the select.
+	     And if so, we need to skip the select which could block */
+	  {
+	    fd_set tls_available;
+	    FD_ZERO (&tls_available);
+	    nfds = 0;
+	    for (channel = 0; channel < FD_SETSIZE; ++channel)
+	      if (! NILP (chan_process[channel]) && FD_ISSET(channel, &Available))
+		{
+		  struct Lisp_Process *p =
+		    XPROCESS (chan_process[channel]);
+		  if (p && p->gnutls_p && p->gnutls_state
+		      && ((emacs_gnutls_record_check_pending
+			   (p->gnutls_state))
+			  > 0))
+		    {
+		      nfds++;
+		      eassert (p->infd == channel);
+		      FD_SET (p->infd, &tls_available);
+		    }
+		}
+	  /* don't select if we have something here */
+	    if (nfds > 0) {
+	      Available = tls_available;
+	      goto SELECT_END;
+	    }
+	  }
+#endif
+
+	  /* Non-macOS HAVE_GLIB builds call thread_select in xgselect.c.  */
 #if defined HAVE_GLIB && !defined HAVE_NS
 	  nfds = xg_select (max_desc + 1,
 			    &Available, (check_write ? &Writeok : 0),
@@ -5582,65 +5613,9 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 				(check_write ? &Writeok : 0),
 				NULL, &timeout, NULL);
 #endif	/* !HAVE_GLIB */
-
-#ifdef HAVE_GNUTLS
-          /* GnuTLS buffers data internally.  In lowat mode it leaves
-             some data in the TCP buffers so that select works, but
-             with custom pull/push functions we need to check if some
-             data is available in the buffers manually.  */
-          if (nfds == 0)
-	    {
-	      fd_set tls_available;
-	      int set = 0;
-
-	      FD_ZERO (&tls_available);
-	      if (! wait_proc)
-		{
-		  /* We're not waiting on a specific process, so loop
-		     through all the channels and check for data.
-		     This is a workaround needed for some versions of
-		     the gnutls library -- 2.12.14 has been confirmed
-		     to need it.  */
-		  for (channel = 0; channel < FD_SETSIZE; ++channel)
-		    if (! NILP (chan_process[channel]))
-		      {
-			struct Lisp_Process *p =
-			  XPROCESS (chan_process[channel]);
-			if (p && p->gnutls_p && p->gnutls_state
-			    && ((emacs_gnutls_record_check_pending
-				 (p->gnutls_state))
-				> 0))
-			  {
-			    nfds++;
-			    eassert (p->infd == channel);
-			    FD_SET (p->infd, &tls_available);
-			    set++;
-			  }
-		      }
-		}
-	      else
-		{
-		  /* Check this specific channel.  */
-		  if (wait_proc->gnutls_p /* Check for valid process.  */
-		      && wait_proc->gnutls_state
-		      /* Do we have pending data?  */
-		      && ((emacs_gnutls_record_check_pending
-			   (wait_proc->gnutls_state))
-			  > 0))
-		    {
-		      nfds = 1;
-		      eassert (0 <= wait_proc->infd);
-		      /* Set to Available.  */
-		      FD_SET (wait_proc->infd, &tls_available);
-		      set++;
-		    }
-		}
-	      if (set)
-		Available = tls_available;
-	    }
-#endif
 	}
 
+    SELECT_END:
       xerrno = errno;
 
       /* Make C-g and alarm signals set flags again.  */

--=-=-=--




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

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


Received: (at 40665) by debbugs.gnu.org; 21 Apr 2020 22:20:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 21 18:20:11 2020
Received: from localhost ([127.0.0.1]:50885 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jR1FS-0006ik-Rs
	for submit <at> debbugs.gnu.org; Tue, 21 Apr 2020 18:20:11 -0400
Received: from o50314941.outbound-mail.sendgrid.net ([50.31.49.41]:21741)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jR1FR-0006iR-2c
 for 40665 <at> debbugs.gnu.org; Tue, 21 Apr 2020 18:20:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type;
 s=s1; bh=Xl+N1P8hd2xWf0gFwpqfD00uZRfTdJtb1CkgGx6EgPk=;
 b=o7tcbawtXhlCgaQqs7MotiJyxZ7BOnxNrvkvAETz2mY6vEbjCjZPFBtKwm9tsNNrmCLi
 MMEAy6yE5mNWoIFpIUFHanxvogrTcoqqgMCRopaOhrS7yw9DSIiEZUcz0lHwpaa9SUgO09
 oDHCLindSu8PoqO0FSpflviCcukTE7t6A=
Received: by filterdrecv-p3iad2-8ddf98858-285bn with SMTP id
 filterdrecv-p3iad2-8ddf98858-285bn-19-5E9F7193-5B
 2020-04-21 22:20:03.5482922 +0000 UTC m=+2322760.146725181
Received: from mail.3qin.us (unknown) by ismtpd0003p1sjc2.sendgrid.net (SG)
 with ESMTP id TZGGQ2FUTo2Gi9Qr3yJGng
 Tue, 21 Apr 2020 22:20:03.232 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jR1FK-0007Fg-D6; Tue, 21 Apr 2020 18:20:02 -0400
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
 <m2tv1dwan3.fsf@HIDDEN> <86zhb5q7sw.fsf@HIDDEN>
 <m28sipvstt.fsf@HIDDEN> <86y2qorj76.fsf@HIDDEN>
 <m2wo68vq08.fsf@HIDDEN> <86368w1tge.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 27.0.91
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <86368w1tge.fsf@HIDDEN>
Date: Tue, 21 Apr 2020 22:20:03 +0000 (UTC)
Message-ID: <864ktcfpm5.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?AmZ7BFZy6zOPCEh=2FasvQqjvmsrD8TVaTpTw4W7M?=
 =?us-ascii?Q?uqqMPkhly1kobTDsFdGRFQAQV+PcBUkYIm6xXdX?=
 =?us-ascii?Q?dgYXAzC6OIR2NoK6yOokAAM+zfjwsO1+zvyN7Sb?=
 =?us-ascii?Q?CL5Q9814y5IXzSFjCi+LyS3nc2tHIaLMPMdZjdP?=
 =?us-ascii?Q?jefZqgTHQQoZX68HEM9WGt9qyjUPER3XA0fXrP?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


Derek Zhou writes:

> Robert Pluim writes:
>
>> That=CA=BCs always possible. You'd have to stick some instrumentation in
>> things like connect_network_socket and wait_reading_process_output to
>> narrow it down.
>>
> I think what happened is gnutls's internal buffering exhausts the
> available data from the socket, so select blocks. There is an comment in
> the code said gnutls leave one byte in the socket for select, but I
> don't think it is doing this anymore. The following patch move the check
> before the select and skip the select if there is data to be read in
> gnutls. It fixed the occational stall in https.

Sorry, the previous patch was wrong. Cannot reuse the fd_set intended
for select. Corrected:


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=check_pending_before_select.patch

diff --git a/src/process.c b/src/process.c
index 91d426103d..49b034b1a7 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5566,7 +5566,38 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 	    }
 #endif
 
-/* Non-macOS HAVE_GLIB builds call thread_select in xgselect.c.  */
+#ifdef HAVE_GNUTLS
+          /* GnuTLS buffers data internally. We need to check if some
+             data is available in the buffers manually before the select.
+	     And if so, we need to skip the select which could block */
+	  {
+	    fd_set tls_available;
+	    FD_ZERO (&tls_available);
+	    nfds = 0;
+	    for (channel = 0; channel < FD_SETSIZE; ++channel)
+	      if (! NILP (chan_process[channel]))
+		{
+		  struct Lisp_Process *p =
+		    XPROCESS (chan_process[channel]);
+		  if (p && p->gnutls_p && p->gnutls_state
+		      && ((emacs_gnutls_record_check_pending
+			   (p->gnutls_state))
+			  > 0))
+		    {
+		      nfds++;
+		      eassert (p->infd == channel);
+		      FD_SET (p->infd, &tls_available);
+		    }
+		}
+	  /* don't select if we have something here */
+	    if (nfds > 0) {
+	      Available = tls_available;
+	      goto SELECT_END;
+	    }
+	  }
+#endif
+
+	  /* Non-macOS HAVE_GLIB builds call thread_select in xgselect.c.  */
 #if defined HAVE_GLIB && !defined HAVE_NS
 	  nfds = xg_select (max_desc + 1,
 			    &Available, (check_write ? &Writeok : 0),
@@ -5582,65 +5613,9 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 				(check_write ? &Writeok : 0),
 				NULL, &timeout, NULL);
 #endif	/* !HAVE_GLIB */
-
-#ifdef HAVE_GNUTLS
-          /* GnuTLS buffers data internally.  In lowat mode it leaves
-             some data in the TCP buffers so that select works, but
-             with custom pull/push functions we need to check if some
-             data is available in the buffers manually.  */
-          if (nfds == 0)
-	    {
-	      fd_set tls_available;
-	      int set = 0;
-
-	      FD_ZERO (&tls_available);
-	      if (! wait_proc)
-		{
-		  /* We're not waiting on a specific process, so loop
-		     through all the channels and check for data.
-		     This is a workaround needed for some versions of
-		     the gnutls library -- 2.12.14 has been confirmed
-		     to need it.  */
-		  for (channel = 0; channel < FD_SETSIZE; ++channel)
-		    if (! NILP (chan_process[channel]))
-		      {
-			struct Lisp_Process *p =
-			  XPROCESS (chan_process[channel]);
-			if (p && p->gnutls_p && p->gnutls_state
-			    && ((emacs_gnutls_record_check_pending
-				 (p->gnutls_state))
-				> 0))
-			  {
-			    nfds++;
-			    eassert (p->infd == channel);
-			    FD_SET (p->infd, &tls_available);
-			    set++;
-			  }
-		      }
-		}
-	      else
-		{
-		  /* Check this specific channel.  */
-		  if (wait_proc->gnutls_p /* Check for valid process.  */
-		      && wait_proc->gnutls_state
-		      /* Do we have pending data?  */
-		      && ((emacs_gnutls_record_check_pending
-			   (wait_proc->gnutls_state))
-			  > 0))
-		    {
-		      nfds = 1;
-		      eassert (0 <= wait_proc->infd);
-		      /* Set to Available.  */
-		      FD_SET (wait_proc->infd, &tls_available);
-		      set++;
-		    }
-		}
-	      if (set)
-		Available = tls_available;
-	    }
-#endif
 	}
 
+    SELECT_END:
       xerrno = errno;
 
       /* Make C-g and alarm signals set flags again.  */

--=-=-=--




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

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


Received: (at 40665) by debbugs.gnu.org; 21 Apr 2020 20:20:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 21 16:20:58 2020
Received: from localhost ([127.0.0.1]:50830 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jQzO5-0003nz-NU
	for submit <at> debbugs.gnu.org; Tue, 21 Apr 2020 16:20:58 -0400
Received: from o1678912x138.outbound-mail.sendgrid.net ([167.89.12.138]:24514)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jQzO3-0003nl-Nk
 for 40665 <at> debbugs.gnu.org; Tue, 21 Apr 2020 16:20:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type;
 s=s1; bh=atX0swCz7EAGRdFFdhsYDBiqCBrNN2jSyULDpiySK1s=;
 b=i/G6qDRXW25DoWqiNFE2lkjmxK7lGWKH8mLLO7wB2bM7CUvctx3EWbaHflfZZ3R69AJZ
 +eXw6n7D+wmMFhGnsfkSmvYFpk77a06QRJ70uC9L0/VqTwlEZKaia5o5udtZmOMGa+OxxQ
 wcJZsKO7HuLGg9o1EnLbEXJisx+1QD9hg=
Received: by filter0073p3las1.sendgrid.net with SMTP id
 filter0073p3las1-3640-5E9F55A1-116
 2020-04-21 20:20:49.871623823 +0000 UTC m=+512307.139325855
Received: from mail.3qin.us (unknown) by ismtpd0010p1sjc2.sendgrid.net (SG)
 with ESMTP id jjSAbGZGRVKomZCMHjYlzg
 Tue, 21 Apr 2020 20:20:49.740 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jQzNx-00067g-2l; Tue, 21 Apr 2020 16:20:49 -0400
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
 <m2tv1dwan3.fsf@HIDDEN> <86zhb5q7sw.fsf@HIDDEN>
 <m28sipvstt.fsf@HIDDEN> <86y2qorj76.fsf@HIDDEN>
 <m2wo68vq08.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 26.3
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <m2wo68vq08.fsf@HIDDEN>
Date: Tue, 21 Apr 2020 20:20:49 +0000 (UTC)
Message-ID: <86368w1tge.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?Am6s6uo2BAkzkfQs81PqtoaWU7Ve5l5TE98sZ28?=
 =?us-ascii?Q?2xuT376BwccynlR4gHEdguOcuc+o5HSVgdQNKTs?=
 =?us-ascii?Q?QNeSb=2F5Gl20zycEVAaCUdP71uZiiYE3BW9jcuMR?=
 =?us-ascii?Q?N6QcDwgb=2FKXbqd6LzHQ2HEvrae+m3udHRaEZtNh?=
 =?us-ascii?Q?oFttONQuVyi03eL3k=3D?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Robert Pluim writes: > Thatʼs always possible. You'd have
    to stick some instrumentation in > things like connect_network_socket and
    wait_reading_process_output to > narrow it down. > I think what happened
   is gnutls's int [...] 
 
 Content analysis details:   (1.2 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in
                             bl.spamcop.net
               [Blocked - see <https://www.spamcop.net/bl.shtml?167.89.12.138>]
  0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
                             blocked.  See
                             http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
                              for more information.
                             [URIs: 3qin.us]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [167.89.12.138 listed in wl.mailspike.net]
  0.0 UNPARSEABLE_RELAY      Informational: message has unparseable relay
                             lines
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: 0.2 (/)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


Robert Pluim writes:

> That=CA=BCs always possible. You'd have to stick some instrumentation in
> things like connect_network_socket and wait_reading_process_output to
> narrow it down.
>
I think what happened is gnutls's internal buffering exhausts the
available data from the socket, so select blocks. There is an comment in
the code said gnutls leave one byte in the socket for select, but I
don't think it is doing this anymore. The following patch move the check
before the select and skip the select if there is data to be read in
gnutls. It fixed the occational stall in https.


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=check_pending_before_select.patch
Content-Description: patch

diff --git a/src/process.c b/src/process.c
index 91d426103d..afbe861533 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5566,7 +5566,32 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 	    }
 #endif
 
-/* Non-macOS HAVE_GLIB builds call thread_select in xgselect.c.  */
+#ifdef HAVE_GNUTLS
+          /* GnuTLS buffers data internally. We need to check if some
+             data is available in the buffers manually before the select.
+	     And if so, we need to skip the select which could block */
+	  nfds = 0;
+	  for (channel = 0; channel < FD_SETSIZE; ++channel)
+	    if (! NILP (chan_process[channel]))
+	      {
+		struct Lisp_Process *p =
+		  XPROCESS (chan_process[channel]);
+		if (p && p->gnutls_p && p->gnutls_state
+		    && ((emacs_gnutls_record_check_pending
+			 (p->gnutls_state))
+			> 0))
+		  {
+		    nfds++;
+		    eassert (p->infd == channel);
+		    FD_SET (p->infd, &Available);
+		  }
+	      }
+	  /* don't select if we have something here */
+	  if (nfds > 0)
+	    goto SELECT_END;
+#endif
+
+	  /* Non-macOS HAVE_GLIB builds call thread_select in xgselect.c.  */
 #if defined HAVE_GLIB && !defined HAVE_NS
 	  nfds = xg_select (max_desc + 1,
 			    &Available, (check_write ? &Writeok : 0),
@@ -5582,65 +5607,9 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 				(check_write ? &Writeok : 0),
 				NULL, &timeout, NULL);
 #endif	/* !HAVE_GLIB */
-
-#ifdef HAVE_GNUTLS
-          /* GnuTLS buffers data internally.  In lowat mode it leaves
-             some data in the TCP buffers so that select works, but
-             with custom pull/push functions we need to check if some
-             data is available in the buffers manually.  */
-          if (nfds == 0)
-	    {
-	      fd_set tls_available;
-	      int set = 0;
-
-	      FD_ZERO (&tls_available);
-	      if (! wait_proc)
-		{
-		  /* We're not waiting on a specific process, so loop
-		     through all the channels and check for data.
-		     This is a workaround needed for some versions of
-		     the gnutls library -- 2.12.14 has been confirmed
-		     to need it.  */
-		  for (channel = 0; channel < FD_SETSIZE; ++channel)
-		    if (! NILP (chan_process[channel]))
-		      {
-			struct Lisp_Process *p =
-			  XPROCESS (chan_process[channel]);
-			if (p && p->gnutls_p && p->gnutls_state
-			    && ((emacs_gnutls_record_check_pending
-				 (p->gnutls_state))
-				> 0))
-			  {
-			    nfds++;
-			    eassert (p->infd == channel);
-			    FD_SET (p->infd, &tls_available);
-			    set++;
-			  }
-		      }
-		}
-	      else
-		{
-		  /* Check this specific channel.  */
-		  if (wait_proc->gnutls_p /* Check for valid process.  */
-		      && wait_proc->gnutls_state
-		      /* Do we have pending data?  */
-		      && ((emacs_gnutls_record_check_pending
-			   (wait_proc->gnutls_state))
-			  > 0))
-		    {
-		      nfds = 1;
-		      eassert (0 <= wait_proc->infd);
-		      /* Set to Available.  */
-		      FD_SET (wait_proc->infd, &tls_available);
-		      set++;
-		    }
-		}
-	      if (set)
-		Available = tls_available;
-	    }
-#endif
 	}
 
+    SELECT_END:
       xerrno = errno;
 
       /* Make C-g and alarm signals set flags again.  */

--=-=-=--




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

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


Received: (at 40665) by debbugs.gnu.org; 21 Apr 2020 15:05:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 21 11:05:05 2020
Received: from localhost ([127.0.0.1]:50535 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jQuSP-0004MW-Fb
	for submit <at> debbugs.gnu.org; Tue, 21 Apr 2020 11:05:05 -0400
Received: from mail-wr1-f50.google.com ([209.85.221.50]:46940)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1jQuSN-0004Lw-VX
 for 40665 <at> debbugs.gnu.org; Tue, 21 Apr 2020 11:05:04 -0400
Received: by mail-wr1-f50.google.com with SMTP id f13so16820158wrm.13
 for <40665 <at> debbugs.gnu.org>; Tue, 21 Apr 2020 08:05:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :mime-version:content-transfer-encoding;
 bh=nkWpwNin37JlAlob/C3qmutWoZbKrwDHZ2FuOydqcbc=;
 b=pp6EbxHEp7XAgtTOnenYr8nG6QQHBUMuvbB6UJGHAW//4CfArQJQ39ryv6wPiqtaW7
 ecdznJVqJZGXUkNcBuNNTRpUt/gQbvac1g78dqI87oCDchJ70jfGssZw+fOqa3rAJSMy
 crakRsWhQwHAE9buUnWhsF6tIxSkMuB35UVfLJAO68VKKF+EBrvyKfXjDKjpgNAt2GqX
 qZRIabdanVu4ZqPTGrP+N3OOAybZ1CujsXQ8oQ9CjwcioIIBG4wPSsay/FZZXZGTxpRM
 +5cx8yq+Ke2Fh0sysTJS6w3kwIfNQGuFRUv2djymOuU4fALV3NGM8lsHrhDyiVO4Z8ti
 jfFw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:mime-version:content-transfer-encoding;
 bh=nkWpwNin37JlAlob/C3qmutWoZbKrwDHZ2FuOydqcbc=;
 b=XP+g6+Ua/CGqsk5FE9V4cC/v3TpKzPqoahEwC3VJrHnK1B039YhNPK8HwwlY9eJREu
 M0/YiTZ7jWtKl0Yi6B9g/cTbkNSSm8+mEH726orhuR7dqyOFYhnmafaySnOt+ylxHlql
 4Cw4I5vhn6TLeW40ibY7X4a22nh+AjtVaODRbLfX8uYFgmaN7yFPwtlTARXvbBv1jpJE
 MPXVNlTgMmaMouDrFh9+Mkp3GmJ0HaU/oq1MwLCj0zykaFgPOHnj1qmfMupIRE5OCthe
 1AWQruds9PKpA5OiuF85QJpHFjBzhW6H8AiqeYeAreGd1kUB7aAaKB6senZEs0LT/wbM
 CLAA==
X-Gm-Message-State: AGi0PubYiQJ/7FzwueY24y/yXQj86DgjOMCBn0+n0HQVxZz3p7f0Gloi
 cTQgNeHqC7ocJdi+ebnXaRPDQ57p
X-Google-Smtp-Source: APiQypI1ScVM8XVplDSCyV21cLX11FJ7LlypkkedyI4wt4quzpL25sTcnadvyn8e6DiA/QuMAeo0ww==
X-Received: by 2002:a5d:4ac6:: with SMTP id y6mr24283382wrs.212.1587481497654; 
 Tue, 21 Apr 2020 08:04:57 -0700 (PDT)
Received: from rpluim-mac ([2a01:e34:ecfc:a860:f038:efd9:aa5f:7833])
 by smtp.gmail.com with ESMTPSA id s8sm3870178wru.38.2020.04.21.08.04.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 21 Apr 2020 08:04:56 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
 <m2tv1dwan3.fsf@HIDDEN> <86zhb5q7sw.fsf@HIDDEN>
 <m28sipvstt.fsf@HIDDEN> <86y2qorj76.fsf@HIDDEN>
Date: Tue, 21 Apr 2020 17:04:55 +0200
In-Reply-To: <86y2qorj76.fsf@HIDDEN> (Derek Zhou's message of "Tue, 21
 Apr 2020 14:45:34 +0000 (UTC)")
Message-ID: <m2wo68vq08.fsf@HIDDEN>
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: 40665
Cc: 40665 <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: -1.0 (-)

>>>>> On Tue, 21 Apr 2020 14:45:34 +0000 (UTC), Derek Zhou <derek@HIDDEN> =
said:

    >> With emacs-26 or emacs-27? The GnuTLS code between the two is quite
    >> different, mainly things like:
    >>=20
    >> commit e87e6a24c49542111e669b7d0f1a412024663f8e
    >> Author: Paul Eggert <eggert@HIDDEN>
    >> Date:   Tue Jan 15 23:51:45 2019 -0800
    >>=20
    >> Fix unlikely races with GnuTLS, datagrams
    >>=20
    >> which despite the comment are perhaps not that unlikely.

    Derek> With emacs-26. maybe I should just use emacs-27 from now on.
    Derek> emacs-27 don't have this indefinite stall, however, it still sta=
lls for
    Derek> a few seconds. The network is not that slow; it feels like somet=
hing
    Derek> wasn't happening in time and was only being triggered later by s=
ome
    Derek> fallback mechanism.

That=CA=BCs always possible. You'd have to stick some instrumentation in
things like connect_network_socket and wait_reading_process_output to
narrow it down.

Robert




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

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


Received: (at 40665) by debbugs.gnu.org; 21 Apr 2020 15:02:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 21 11:02:21 2020
Received: from localhost ([127.0.0.1]:50531 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jQuPl-0004I7-1s
	for submit <at> debbugs.gnu.org; Tue, 21 Apr 2020 11:02:21 -0400
Received: from xtrwkvxq.outbound-mail.sendgrid.net ([167.89.24.164]:19076)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jQuPj-0004Hr-9E
 for 40665 <at> debbugs.gnu.org; Tue, 21 Apr 2020 11:02:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=9qK873KlpQKN5jaGk0PH2qcRPrGXL756FQ2s4Y2ZIKw=;
 b=WF7m9hIf8V604mTa8YHwPG7in60+1tRakO6XcaAKgy3hsSKcozrwFG3FFQQwlO/ZP7xq
 d4CR+wBJDHDCuonRSBt38AJeQX2HilJm5MDTEm1ZX34tUPD1+WU1exYHbpK1molyFACIWp
 J0UFtCkoEbTKPkAjeE0av8jrpcnzGDdvk=
Received: by filter0073p3las1.sendgrid.net with SMTP id
 filter0073p3las1-3640-5E9F0AF5-1ED
 2020-04-21 15:02:13.418098754 +0000 UTC m=+493190.685801252
Received: from mail.3qin.us (unknown) by ismtpd0003p1sjc2.sendgrid.net (SG)
 with ESMTP id LpnRppkFSi-DXDgHUacMxw
 Tue, 21 Apr 2020 15:02:13.208 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jQuPc-0000kZ-P7; Tue, 21 Apr 2020 11:02:12 -0400
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
 <m2tv1dwan3.fsf@HIDDEN> <86zhb5q7sw.fsf@HIDDEN>
 <m28sipvstt.fsf@HIDDEN> <86y2qorj76.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 26.3
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <86y2qorj76.fsf@HIDDEN>
Date: Tue, 21 Apr 2020 15:02:13 +0000 (UTC)
Message-ID: <86wo68riff.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?AmurDYrqNGnqy4kxdCZk5vGBTl7pk4fKiNYsEEb?=
 =?us-ascii?Q?tsGOEISsE8VIeMtfZKZLHtPjYctEwSIXVdXUdmt?=
 =?us-ascii?Q?hq+O9kiGQDVkGRgSVVTbulLhFmbmaT+F=2Fnu9PG3?=
 =?us-ascii?Q?YbxLFmYvz3cxyuDNR43OZvvXkAPE+9vsckUseOf?=
 =?us-ascii?Q?KLLWw6BqOQrufh58U=3D?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Derek Zhou writes: > > With emacs-26. maybe I should just
 use emacs-27 from now on. > emacs-27 don't have this indefinite stall, however,
 it still stalls for > a few seconds. The network is not that s [...] 
 Content analysis details:   (1.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in
 bl.spamcop.net
 [Blocked - see <https://www.spamcop.net/bl.shtml?167.89.24.164>]
 0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
 blocked.  See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
 for more information. [URIs: 3qin.us]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [167.89.24.164 listed in wl.mailspike.net]
 0.0 UNPARSEABLE_RELAY      Informational: message has unparseable relay
 lines
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: 0.2 (/)


Derek Zhou writes:
>
> With emacs-26. maybe I should just use emacs-27 from now on.
> emacs-27 don't have this indefinite stall, however, it still stalls for
> a few seconds. The network is not that slow; it feels like something
> wasn't happening in time and was only being triggered later by some
> fallback mechanism.
>
Robert,

One of the website that has strange stall is https://www.opensource.com
It loads in sub-second in w3m, curl or wget. However, I have
multi-second stall in emacs-27. Can you repo?

Derek





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

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


Received: (at 40665) by debbugs.gnu.org; 21 Apr 2020 14:45:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 21 10:45:42 2020
Received: from localhost ([127.0.0.1]:50496 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jQu9e-0003po-Ex
	for submit <at> debbugs.gnu.org; Tue, 21 Apr 2020 10:45:42 -0400
Received: from xtrwkvxq.outbound-mail.sendgrid.net ([167.89.24.164]:20524)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jQu9c-0003pY-Ay
 for 40665 <at> debbugs.gnu.org; Tue, 21 Apr 2020 10:45:41 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=gqeU9pDWZiWH5nw+tyM780AHxIJ3qouE38gOVmrILA8=;
 b=iOy36iHcKfWnmD+3rH2NxXtueadcvdgwDsckX1Uemnw7G/Id/XJ1Iy6LA7fePcxtoIOT
 zzAWNInx9h0+MENHoEfMI3StsMfHpcSl2cRNiF3iVgK1EwFwtqKPbzDGaJ3uRD1BXHCyIw
 EbyRrhPfEqL2dfjcGCfj6uIWmlgfEnlLE=
Received: by filter0073p3las1.sendgrid.net with SMTP id
 filter0073p3las1-3640-5E9F070E-1A9
 2020-04-21 14:45:34.338907687 +0000 UTC m=+492191.606609763
Received: from mail.3qin.us (unknown) by ismtpd0001p1las1.sendgrid.net (SG)
 with ESMTP id MP3xcUGvTOeLP-rwbNmaQQ
 Tue, 21 Apr 2020 14:45:34.181 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jQu9V-0000iY-KE; Tue, 21 Apr 2020 10:45:33 -0400
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
 <m2tv1dwan3.fsf@HIDDEN> <86zhb5q7sw.fsf@HIDDEN>
 <m28sipvstt.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 26.3
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <m28sipvstt.fsf@HIDDEN>
Date: Tue, 21 Apr 2020 14:45:34 +0000 (UTC)
Message-ID: <86y2qorj76.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?Am9yzVzXiZk3akdaLdi9mHo4Nv8z7rh3RVtN+eM?=
 =?us-ascii?Q?f5nLnOXXpilSF+5I76x7o1gC4cY5RGhOSMApGzX?=
 =?us-ascii?Q?WtC384gF6yXGwr8HAEOWXyMu9B=2F+lWbS5r2+EO=2F?=
 =?us-ascii?Q?Cbu8xuEbAlq+qy2LGDkRIhu7ZuNpwiY3ci+xswb?=
 =?us-ascii?Q?649aOxwjlRZ7thPdk=3D?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: Robert Pluim writes: > With emacs-26 or emacs-27? The GnuTLS
 code between the two is quite > different, mainly things like: > > commit
 e87e6a24c49542111e669b7d0f1a412024663f8e > Author: Paul Eggert
 <eggert@HIDDEN> > [...] 
 Content analysis details:   (1.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
 blocked.  See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
 for more information. [URIs: 3qin.us]
 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in
 bl.spamcop.net
 [Blocked - see <https://www.spamcop.net/bl.shtml?167.89.24.164>]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [167.89.24.164 listed in wl.mailspike.net]
 0.0 UNPARSEABLE_RELAY      Informational: message has unparseable relay
 lines
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: 0.2 (/)


Robert Pluim writes:

> With emacs-26 or emacs-27? The GnuTLS code between the two is quite
> different, mainly things like:
>
>     commit e87e6a24c49542111e669b7d0f1a412024663f8e
>     Author: Paul Eggert <eggert@HIDDEN>
>     Date:   Tue Jan 15 23:51:45 2019 -0800
>
>         Fix unlikely races with GnuTLS, datagrams
>
> which despite the comment are perhaps not that unlikely.

With emacs-26. maybe I should just use emacs-27 from now on.
emacs-27 don't have this indefinite stall, however, it still stalls for
a few seconds. The network is not that slow; it feels like something
wasn't happening in time and was only being triggered later by some
fallback mechanism.

Derek




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

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


Received: (at 40665) by debbugs.gnu.org; 21 Apr 2020 14:04:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 21 10:04:09 2020
Received: from localhost ([127.0.0.1]:50454 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jQtVR-0002pU-Du
	for submit <at> debbugs.gnu.org; Tue, 21 Apr 2020 10:04:09 -0400
Received: from mail-wm1-f41.google.com ([209.85.128.41]:50199)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1jQtVO-0002ol-NX
 for 40665 <at> debbugs.gnu.org; Tue, 21 Apr 2020 10:04:07 -0400
Received: by mail-wm1-f41.google.com with SMTP id x25so3716949wmc.0
 for <40665 <at> debbugs.gnu.org>; Tue, 21 Apr 2020 07:04:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :mime-version:content-transfer-encoding;
 bh=rIw60VJCnSbbuk0Tl9yzgnqj7tLAM0e2LvxX8fSThrQ=;
 b=ZEVR40J1V6BjiIyH/Q6OBvjcpqeayOF2kjkczNa6q6kpOn1Se3oBs2qU/L3PO1QB+m
 vvmzuzSB11e+ClgIpwGv79JAXoGfeMB+pOoTkTRnt50+q2dkVEGqDLFhrLvlTrIwl+FW
 /qUtBDXrQFCgvP4H1OpMgRCWUl6FtvI5MEE/kX5noIWxBoH7pFdXn6DOYUTBJA5v4bcK
 fAid/SpUvfNWWodCXYgDmR2SfbsNRiC2+MPXOGhmFyUk+CK0K2AXGxq3C4cPvvgiU/oa
 s8UnbAfp+q2TgAIrZ5SIvgrNqPs9mjFn5tqPPp+ybwVgbU4ovvCqA3KBV6FrPI1Xv0bO
 NXHQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:mime-version:content-transfer-encoding;
 bh=rIw60VJCnSbbuk0Tl9yzgnqj7tLAM0e2LvxX8fSThrQ=;
 b=lvL9ssaE/m4m7ANJPq5i6xzVr1zYMUyDK6ClWzZkXsg7cEcU7FmFpiFNLZSdO1dIvL
 vpj1cOX+EouVN9KrXzQ0lfZHfsBRhpcPPRdVjzhXOHa7aFaZG6184UeW4Io7590DcfrY
 qDXBDJVDt4C8MM82JTTTC0PGQnM9Hzzw3XZ54VctRduea2cXEosaIYf5EeTdBvq8Mciv
 u61QwI9FeUfO9CdU7/mXa5Lda+tiefv+He/QQowuvzzF3mMdKgnSoOHi8gpjApE/+2Nd
 SVhFng2T8DgDozax8zNtDrI9WCa+LhKxAGkg+fy5Xye4rwjQAz6UERyHWwm9vhVlUaIV
 bymw==
X-Gm-Message-State: AGi0PuZ2xT4TKXr8CzCaac7EFLRRMYYBq6zYsSKkf9kE3ea6/oRbgAuQ
 jT7p+D9e2ZudF7X70R+M0YUno6ka
X-Google-Smtp-Source: APiQypK0u0z/j5Re3eVziSYc1hkbQzzSaoG1x0IFHQghi5n6FZJ8l9Z3X/cWL2cuuUE+hdHNdP33cQ==
X-Received: by 2002:a7b:c4d0:: with SMTP id g16mr5466374wmk.154.1587477840276; 
 Tue, 21 Apr 2020 07:04:00 -0700 (PDT)
Received: from rpluim-mac ([2a01:e34:ecfc:a860:f038:efd9:aa5f:7833])
 by smtp.gmail.com with ESMTPSA id q184sm3709491wma.25.2020.04.21.07.03.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 21 Apr 2020 07:03:59 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
 <m2tv1dwan3.fsf@HIDDEN> <86zhb5q7sw.fsf@HIDDEN>
Date: Tue, 21 Apr 2020 16:03:58 +0200
In-Reply-To: <86zhb5q7sw.fsf@HIDDEN> (Derek Zhou's message of "Tue, 21
 Apr 2020 13:37:04 +0000 (UTC)")
Message-ID: <m28sipvstt.fsf@HIDDEN>
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: 40665
Cc: 40665 <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: -1.0 (-)

>>>>> On Tue, 21 Apr 2020 13:37:04 +0000 (UTC), Derek Zhou <derek@HIDDEN> =
said:

    Derek> Robert Pluim writes:

    >>>>>>> On Tue, 21 Apr 2020 01:41:21 +0000 (UTC), Derek Zhou <derek@3qi=
n.us> said:
    >>=20
    Derek> Derek Zhou writes:
    >>=20
    >> >> Robert Pluim writes:
    >> >>=20
    >> >>> I assume you=CA=BCre running with the change locally. If you con=
tinue to do
    >> >>> so, and don=CA=BCt see any issues, then that raises my confidenc=
e in the
    >> >>> change being correct.
    >> >>>=20
    >> >>> I=CA=BCll update this bug when I push a change.
    >> >> Hold on. This break a lot of other https sites. I'll debug more, =
if
    >> >> someone is more familiar with this case please also look into thi=
s.
    >>=20
    Derek> False alarm. I was backporting the patch to 26.3, which does not=
 have
    Derek> the other change:
    >>=20
    >> See my earlier note about dragons in the code :-)

    Derek> I still see some https site stalled with no content displayed. H=
owever,
    Derek> as soon as I type something on the keyboard, content would come =
in;
    Derek> Strongly suggested that there are some problem in the emacs proc=
ess
    Derek> layer. Will dig deeper.

With emacs-26 or emacs-27? The GnuTLS code between the two is quite
different, mainly things like:

    commit e87e6a24c49542111e669b7d0f1a412024663f8e
    Author: Paul Eggert <eggert@HIDDEN>
    Date:   Tue Jan 15 23:51:45 2019 -0800

        Fix unlikely races with GnuTLS, datagrams

which despite the comment are perhaps not that unlikely.

Robert




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

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


Received: (at 40665) by debbugs.gnu.org; 21 Apr 2020 13:37:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 21 09:37:11 2020
Received: from localhost ([127.0.0.1]:49227 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jQt5L-0001uD-H4
	for submit <at> debbugs.gnu.org; Tue, 21 Apr 2020 09:37:11 -0400
Received: from o1678912x138.outbound-mail.sendgrid.net ([167.89.12.138]:55285)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jQt5J-0001u1-UF
 for 40665 <at> debbugs.gnu.org; Tue, 21 Apr 2020 09:37:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=vks7JptxV56Or+dmi65qvqAXMViOs7wBRp2Yiq+a8sY=;
 b=ZfZIk8Mwqk/3uwZZyGiZNuDUEhv675tlU2qyg6Sb6bUQwsRdhh9N0Du4kDdFCSX+4FBu
 8/b7vYooR1o7EqYyEQGvtE3mlGrEAZAr1wTWon12jh3hB45Yo54Wsh+kCE3ZWUq4GyF20M
 Yr/c/ZKD85w5BzbCZm/uwv2kGG5sXxBRY=
Received: by filterdrecv-p3mdw1-6dbfd75bfd-br5mk with SMTP id
 filterdrecv-p3mdw1-6dbfd75bfd-br5mk-18-5E9EF700-14
 2020-04-21 13:37:04.277685095 +0000 UTC m=+2291388.048208623
Received: from mail.3qin.us (unknown) by ismtpd0004p1sjc2.sendgrid.net (SG)
 with ESMTP id bPcuwtthT42EGmsEPf8xTA
 Tue, 21 Apr 2020 13:37:04.037 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jQt5D-0000bQ-H4; Tue, 21 Apr 2020 09:37:03 -0400
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
 <m2tv1dwan3.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 26.3
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <m2tv1dwan3.fsf@HIDDEN>
Date: Tue, 21 Apr 2020 13:37:04 +0000 (UTC)
Message-ID: <86zhb5q7sw.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?AmIiPlgJYDk66K+X2OGvx+uqEaLa2MkwFlzst5m?=
 =?us-ascii?Q?B3=2FH+5w7A1LGWyWkWNcWlAASqhh3JPLcRu3IjgM?=
 =?us-ascii?Q?JLiJRB=2FWnuFcs5WifmN930tYnTIS5BDFVcb6yde?=
 =?us-ascii?Q?60rr3iDzc3EsLdB3WDqSC8cI=2FCuBVovVXBM4zcV?=
 =?us-ascii?Q?Ctnz=2FN=2FbYp9dldW3hzgtRg9EdDqewG3DfRtA=2Fy?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Robert Pluim writes: >>>>>> On Tue, 21 Apr 2020 01:41:21 +0000
    (UTC), Derek Zhou <derek@HIDDEN> said: > > Derek> Derek Zhou writes: > >
    >> Robert Pluim writes: > >> > >>> I assume youʼre running with the change
    locally. [...] 
 
 Content analysis details:   (1.2 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in
                             bl.spamcop.net
               [Blocked - see <https://www.spamcop.net/bl.shtml?167.89.12.138>]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [167.89.12.138 listed in list.dnswl.org]
  0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
                             blocked.  See
                             http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
                              for more information.
                             [URIs: 3qin.us]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [167.89.12.138 listed in wl.mailspike.net]
  0.0 UNPARSEABLE_RELAY      Informational: message has unparseable relay
                             lines
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: 0.2 (/)


Robert Pluim writes:

>>>>>> On Tue, 21 Apr 2020 01:41:21 +0000 (UTC), Derek Zhou <derek@HIDDEN>=
 said:
>
>     Derek> Derek Zhou writes:
>
>     >> Robert Pluim writes:
>     >>=20
>     >>> I assume you=CA=BCre running with the change locally. If you cont=
inue to do
>     >>> so, and don=CA=BCt see any issues, then that raises my confidence=
 in the
>     >>> change being correct.
>     >>>=20
>     >>> I=CA=BCll update this bug when I push a change.
>     >> Hold on. This break a lot of other https sites. I'll debug more, i=
f
>     >> someone is more familiar with this case please also look into this=
.
>
>     Derek> False alarm. I was backporting the patch to 26.3, which does n=
ot have
>     Derek> the other change:
>
> See my earlier note about dragons in the code :-)

I still see some https site stalled with no content displayed. However,
as soon as I type something on the keyboard, content would come in;
Strongly suggested that there are some problem in the emacs process
layer. Will dig deeper.

Derek




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

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


Received: (at 40665) by debbugs.gnu.org; 21 Apr 2020 07:39:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 21 03:39:25 2020
Received: from localhost ([127.0.0.1]:48967 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jQnV7-0005O8-7v
	for submit <at> debbugs.gnu.org; Tue, 21 Apr 2020 03:39:25 -0400
Received: from mail-wr1-f46.google.com ([209.85.221.46]:38544)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1jQnV2-0005Nu-8A
 for 40665 <at> debbugs.gnu.org; Tue, 21 Apr 2020 03:39:21 -0400
Received: by mail-wr1-f46.google.com with SMTP id k11so15282934wrp.5
 for <40665 <at> debbugs.gnu.org>; Tue, 21 Apr 2020 00:39:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :mime-version:content-transfer-encoding;
 bh=M6Pl5Nv6DoyHN3djpckFhCCUOMDzbSO9wskErVktFA0=;
 b=m8CFwo06m1BSqTFh26S3rc6WsilaWAk3DUaen3BflQMGGt4Q0p6ycYKjGlohOQ7oEK
 EzPonSRibxNZRJMISTeOVGJ1OR8oVTvzBLEDXNiRWfwrtE1vqiGemlEc2N5ThIwpGH3v
 1Wx14+bO0ms/7KXgiovSG2wn4tiYMj4LqnLKAKgnYKVNfetQTyoR32xTrM1ZLlOZcXIJ
 cT1CdsRaG0YvoQxzuRz2cPEFivrewyY3Y2kuLUcBTwGza5kFq0y73ie4EG9BJEPYp8u0
 KwXbBbvKuC/dqq+Ag8yPlItmkyd+gLHr/6mFGGDczntfDIYCSh0FABSI+lbsLnUJXEpa
 hXUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:mime-version:content-transfer-encoding;
 bh=M6Pl5Nv6DoyHN3djpckFhCCUOMDzbSO9wskErVktFA0=;
 b=uIliTIFQW5fy6GR/+tiDs+efEJH8ys27UYG3NTcahGmKt375iMMQxw6DjxDPIY0F+P
 CDbZpDdVwNiYntGlx1KePN4lOO/M0XF5uL0bQEGIk39igIxBG9Nv7gR4kFJ4nhtCP/45
 p8Si6ufpD6yR6gx6Fkx9OpHL1S6VDxsEkYJQB/AFT0MsSftVvZVBzAdQ8eHiqKOd+STM
 QJquLsD9ZHw/LWfG+WsyN/WbIkokHdwjY11bwsMFBoIrJFe6DQiYhdB0l7w9FQLJinew
 VmC4nBkHRmM9mn0lN7IbmoLBL8KO91VLgX8Uiu4hdYrvPlIWQV4/o8Ybl2eOSsmVso8x
 sl9A==
X-Gm-Message-State: AGi0PuY325kx+MAuPqfR0/nmeUBfY3/wvd3EmQpmyADmgCpyk+NrvR/h
 ahQ/lreGzYb4HTCtVeuNyytL/6jx
X-Google-Smtp-Source: APiQypIIMVNvn1ZmPoweRSiZqJnJ9tpgEYdYN49y6lO+P4ts+/HABY9fS+fs6OkCcCRXMSVKTr2RCw==
X-Received: by 2002:adf:e3ca:: with SMTP id k10mr24377728wrm.53.1587454753895; 
 Tue, 21 Apr 2020 00:39:13 -0700 (PDT)
Received: from rpluim-mac ([2a01:e34:ecfc:a860:4dd7:4da5:1258:da60])
 by smtp.gmail.com with ESMTPSA id v1sm2558952wrv.19.2020.04.21.00.39.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 21 Apr 2020 00:39:13 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN> <86eeshpqdb.fsf@HIDDEN>
Date: Tue, 21 Apr 2020 09:39:12 +0200
In-Reply-To: <86eeshpqdb.fsf@HIDDEN> (Derek Zhou's message of "Tue, 21
 Apr 2020 01:41:21 +0000 (UTC)")
Message-ID: <m2tv1dwan3.fsf@HIDDEN>
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: 40665
Cc: 40665 <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: -1.0 (-)

>>>>> On Tue, 21 Apr 2020 01:41:21 +0000 (UTC), Derek Zhou <derek@HIDDEN> =
said:

    Derek> Derek Zhou writes:

    >> Robert Pluim writes:
    >>=20
    >>> I assume you=CA=BCre running with the change locally. If you contin=
ue to do
    >>> so, and don=CA=BCt see any issues, then that raises my confidence i=
n the
    >>> change being correct.
    >>>=20
    >>> I=CA=BCll update this bug when I push a change.
    >> Hold on. This break a lot of other https sites. I'll debug more, if
    >> someone is more familiar with this case please also look into this.

    Derek> False alarm. I was backporting the patch to 26.3, which does not=
 have
    Derek> the other change:

See my earlier note about dragons in the code :-)

    Derek> commit b34c6d2c9694ec300b92129dbf88fe012837dfe2
    Derek> Author: Robert Pluim <rpluim@HIDDEN>
    Derek> Date:   Mon Jul 15 13:28:25 2019 +0200

    Derek>     Don't delete GnuTLS boot parameters too early
=20=20=20=20
    Derek>     * src/process.c (connect_network_socket): Don't delete the G=
nuTLS
    Derek>     boot parameters until after we've managed to connect at the =
IP
    Derek>     level (bug#36660).


    Derek> So obviously this won't work.

Right, you'll end up calling the sentinel before handshaking has
completed.

    Derek> Right now I am running 26.3 + this + my patch, everything seems =
ok for
    Derek> now.

And it=CA=BCs fine so far for me here as well in emacs-27.

Robert




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

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


Received: (at 40665) by debbugs.gnu.org; 21 Apr 2020 01:41:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 20 21:41:29 2020
Received: from localhost ([127.0.0.1]:48725 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jQhuj-0004us-5d
	for submit <at> debbugs.gnu.org; Mon, 20 Apr 2020 21:41:29 -0400
Received: from o50314941.outbound-mail.sendgrid.net ([50.31.49.41]:52873)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jQhuh-0004ue-DK
 for 40665 <at> debbugs.gnu.org; Mon, 20 Apr 2020 21:41:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=5DwC1CcKNLZT0xtNuw04918d38CmiOFK8l5apLkwFMY=;
 b=lwcZV70eFiCyFhuRYwljdmxISAR11oMEvt4SBk+YXW9hNDmNSXamhEwZv4WmZT+CvItL
 7pmYG0+ZImcOWM2k8d+jJ1YyovDzqIjro1A0RE700YGYdTTe014pnU1Jsh6vNVJjmgeCut
 oUdmNc5yYQGw7r9EEBQ+qDoe00FTAzy3A=
Received: by filter0135p3las1.sendgrid.net with SMTP id
 filter0135p3las1-28320-5E9E4F41-5D
 2020-04-21 01:41:21.443376891 +0000 UTC m=+445137.362330455
Received: from mail.3qin.us (unknown) by ismtpd0003p1sjc2.sendgrid.net (SG)
 with ESMTP id mqD8LaSoT9ii8kMWuWK5xQ
 Tue, 21 Apr 2020 01:41:21.293 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jQhua-0005g2-R9; Mon, 20 Apr 2020 21:41:20 -0400
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
 <86zhb5hecx.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 26.3
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <86zhb5hecx.fsf@HIDDEN>
Date: Tue, 21 Apr 2020 01:41:21 +0000 (UTC)
Message-ID: <86eeshpqdb.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?AmWJ1zTT2cKtLFU=2FazqKx471IrfcEMLRb+ADGY2?=
 =?us-ascii?Q?I4H73tkMm6+0AW8AajOfNQGZHYLTuYJCoUwKaGR?=
 =?us-ascii?Q?Eoc6Hw5Q7GqO2ieP68AGxoQWi4hJ1pUd2ZySp9K?=
 =?us-ascii?Q?OzOknGnKoX0eQbBU=2Fd=2FxxxPcoS2hkN1SvDlMdeD?=
 =?us-ascii?Q?NRT+kXrE3m=2FYu5b7M=3D?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: -1.0 (-)


Derek Zhou writes:

> Robert Pluim writes:
>
>> I assume you=CA=BCre running with the change locally. If you continue to=
 do
>> so, and don=CA=BCt see any issues, then that raises my confidence in the
>> change being correct.
>>
>> I=CA=BCll update this bug when I push a change.
> Hold on. This break a lot of other https sites. I'll debug more, if
> someone is more familiar with this case please also look into this.

False alarm. I was backporting the patch to 26.3, which does not have
the other change:

commit b34c6d2c9694ec300b92129dbf88fe012837dfe2
Author: Robert Pluim <rpluim@HIDDEN>
Date:   Mon Jul 15 13:28:25 2019 +0200

    Don't delete GnuTLS boot parameters too early
   =20
    * src/process.c (connect_network_socket): Don't delete the GnuTLS
    boot parameters until after we've managed to connect at the IP
    level (bug#36660).


So obviously this won't work.
Right now I am running 26.3 + this + my patch, everything seems ok for
now.

Derek




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

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


Received: (at 40665) by debbugs.gnu.org; 21 Apr 2020 00:28:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 20 20:28:08 2020
Received: from localhost ([127.0.0.1]:48678 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jQglk-0003AD-Dt
	for submit <at> debbugs.gnu.org; Mon, 20 Apr 2020 20:28:08 -0400
Received: from o50314941.outbound-mail.sendgrid.net ([50.31.49.41]:49112)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jQglh-00039h-Ic
 for 40665 <at> debbugs.gnu.org; Mon, 20 Apr 2020 20:28:06 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=EyB3Z3Q30oNUYhF4VdfNnmTTSVFf7dK7xbu0gHfJcqo=;
 b=iARMwThCguHNeWHvtMUrpacRqzxJLqochMuB/W4yLBGAvrDPGcvXSrdp18Dmwxqi0DA8
 YOKhGE0Ytf1oPogf5IaT/lcZVnxk8zuzQpdY+07EWrVe3iHP5sqCMKC5EevPqxQRNlJURZ
 x8UNlduEkU31AEF/UVb+StUEwpDE3dLyk=
Received: by filter0073p3las1.sendgrid.net with SMTP id
 filter0073p3las1-3640-5E9E3E0F-76
 2020-04-21 00:27:59.479441411 +0000 UTC m=+440736.747143586
Received: from mail.3qin.us (unknown) by ismtpd0003p1sjc2.sendgrid.net (SG)
 with ESMTP id UAcPkAZSQDa-qnajpAUB-A
 Tue, 21 Apr 2020 00:27:59.239 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jQgla-0003gi-4p; Mon, 20 Apr 2020 20:27:58 -0400
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN> <m2y2qr5u9t.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 26.3
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <m2y2qr5u9t.fsf@HIDDEN>
Date: Tue, 21 Apr 2020 00:27:59 +0000 (UTC)
Message-ID: <86zhb5hecx.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?AmvuwJFZieZ6RK2WPZQII3Tk98+VsfhRbMzMz+S?=
 =?us-ascii?Q?lCGhY9bAFglQwbGl4jSUk+NJGyE5MctCe8v7Hj7?=
 =?us-ascii?Q?fXZ2Wo2Vy=2FV8vZ9lf3YjwRQyyyOU5kjiOmYEsbO?=
 =?us-ascii?Q?GQz84NMXx+7H8kFJpWoE5jPwIgUiAXEs8a3YxYL?=
 =?us-ascii?Q?BWkm3mlL5k8foZV74=3D?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: -1.0 (-)


Robert Pluim writes:

> I assume you=CA=BCre running with the change locally. If you continue to =
do
> so, and don=CA=BCt see any issues, then that raises my confidence in the
> change being correct.
>
> I=CA=BCll update this bug when I push a change.
Hold on. This break a lot of other https sites. I'll debug more, if
someone is more familiar with this case please also look into this.

Derek





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

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


Received: (at 40665) by debbugs.gnu.org; 19 Apr 2020 16:13:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 19 12:13:00 2020
Received: from localhost ([127.0.0.1]:45737 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jQCZ2-0001o6-2f
	for submit <at> debbugs.gnu.org; Sun, 19 Apr 2020 12:13:00 -0400
Received: from mail-wr1-f46.google.com ([209.85.221.46]:45419)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1jQCYz-0001ns-0a
 for 40665 <at> debbugs.gnu.org; Sun, 19 Apr 2020 12:12:58 -0400
Received: by mail-wr1-f46.google.com with SMTP id t14so8944539wrw.12
 for <40665 <at> debbugs.gnu.org>; Sun, 19 Apr 2020 09:12:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :mime-version:content-transfer-encoding;
 bh=OvXsTVa9eJkrDS9Nt0YO9riCOAou9MQb8PfccVW96mA=;
 b=UAX0QStFm3X0xmQOxWp6LFHQhgnLXdR0hDbhk2tWzUXrcpibf0oR1qvqM8jRUC/3MV
 Dvm96HJ1lqDZM2isIuJsksJN8/4fL+LTH2Q/GHYN3jtgTL93OGGep3iuext7HuZHLF+3
 81siUIMTP3jxloR0SUunTUSumRJgbaxcqDzTs/s1yNoTiwcvd6BsUbug7L5eA7N1ocLw
 wbUgmjN9hn0W1/iZa8pilUmAJDj999f34K04a1ryC346FswS3SqIJeNFCaoNFZW7WV66
 ntX2fk/zkWS8lEiInVxzJfWMZUGIE2T0SyuT6S2ZIXT+yuBSO4GOGJWsiA9nh091NJTo
 1Big==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:mime-version:content-transfer-encoding;
 bh=OvXsTVa9eJkrDS9Nt0YO9riCOAou9MQb8PfccVW96mA=;
 b=HPeCJ2kWqpKXFiU5Cgv6uvvlFGhAKiu5y5Nvz1zckEV7D5WmjqGMQ914ve18Y94/C3
 5ovangyvH3QGk9mWVByqqZluzW4c8Uhr3c/UePRaFFXM5OCt1b2lXM7vcxseZ+3IKUBb
 LlV3Ovcn6Rz3kXVGmF0d0lY2y4/QeABms2ltZPmDmq6DLYXGZL/GqtSKpqZqlnkxCUwZ
 R/eqaHHCVjlIjGcQ/40xRj5BDM7TULtz7SkuV9npjcZmL+RGMiaaBM8MNLfP6dtig+OM
 gr5h/0bHJIWQKg9dQpyJW20VVfyVWlqemikDCN/S0p+3wcwXhXtxH5nzDegxGkJkZo01
 qEnw==
X-Gm-Message-State: AGi0Puan4rU8uvk8Faqrs780YdA/DMb+V2skB1M6ZPG+R8JgqSh424vJ
 J3QESAXCyy1k4SEFXfam4rD/3Xus
X-Google-Smtp-Source: APiQypJattKPBjstPJOAsoCW6Pe9ch55f28KzhCkV26EPQLj6Eryydl2ahXhUS+mNllBAXdYluZTWA==
X-Received: by 2002:adf:d0ca:: with SMTP id z10mr15391619wrh.172.1587312770491; 
 Sun, 19 Apr 2020 09:12:50 -0700 (PDT)
Received: from rpluim-mac ([2a01:e34:ecfc:a860:4dd7:4da5:1258:da60])
 by smtp.gmail.com with ESMTPSA id a187sm16033792wmh.40.2020.04.19.09.12.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 19 Apr 2020 09:12:49 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
 <86blnnebh3.fsf@HIDDEN>
Date: Sun, 19 Apr 2020 18:12:46 +0200
In-Reply-To: <86blnnebh3.fsf@HIDDEN> (Derek Zhou's message of "Sun, 19
 Apr 2020 15:34:01 +0000 (UTC)")
Message-ID: <m2y2qr5u9t.fsf@HIDDEN>
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: 40665
Cc: 40665 <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: -1.0 (-)

>>>>> On Sun, 19 Apr 2020 15:34:01 +0000 (UTC), Derek Zhou <derek@HIDDEN> =
said:

    Derek> Robert Pluim writes:

    >> One change we could make is to set p->gnutls_boot_parameters to nil
    >> here, so that in the sequence
    >>=20
    >> Fgnutls_boot, handshake does not complete
    >> handshake succeeds first time in wait_reading_process_output
    >> delete_write_fd then checks p->gnutls_boot_parameters
    >>=20
    >> the sentinel ends up getting run, but I=CA=BCve not seen the handsha=
ke ever
    >> succeed straight away before the delete_write_fd, and if it ever has
    >> in the wild we would have seen bug reports (and this is dragon-filled
    >> code, so I don=CA=BCt want to make changes to it if I can help it :-=
))
    >>=20
    >> In short: I think the change is ok. It passes the network-stream
    >> tests, so I=CA=BCll run with it for a while, and push it in a week o=
r so.

    Derek> Will be glad to test anything on this issue. Just let me know
    Derek> if you pushed any change.

I assume you=CA=BCre running with the change locally. If you continue to do
so, and don=CA=BCt see any issues, then that raises my confidence in the
change being correct.

I=CA=BCll update this bug when I push a change.

Thanks

Robert




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

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


Received: (at 40665) by debbugs.gnu.org; 19 Apr 2020 15:34:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 19 11:34:08 2020
Received: from localhost ([127.0.0.1]:45707 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jQBxQ-0007HR-34
	for submit <at> debbugs.gnu.org; Sun, 19 Apr 2020 11:34:08 -0400
Received: from o50314941.outbound-mail.sendgrid.net ([50.31.49.41]:9904)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jQBxO-0007Gx-IP
 for 40665 <at> debbugs.gnu.org; Sun, 19 Apr 2020 11:34:07 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=kyHgg/YLlT+wIRqtQABP26dgvHk+x18nCCEHT9Xm6zM=;
 b=FBlmG54bibrq8kkK2ILF2LO/9vRdo27Cjdd6jXYkDbNeiv3NweUg/cFHXOr1YQfhq/iG
 E5C85E7r7JsgSwBPF14L46WteyFAZw7OfLDcO+0lZHTtqaHcR3tSx09S/dUiTVWjS8+dy/
 6Vcl6X64GsjteoBeEnNLTu1B80Gm+MQJg=
Received: by filterdrecv-p3mdw1-6dbfd75bfd-kcw86 with SMTP id
 filterdrecv-p3mdw1-6dbfd75bfd-kcw86-18-5E9C6F68-3A
 2020-04-19 15:34:00.989974526 +0000 UTC m=+2125591.203172031
Received: from mail.3qin.us (unknown) by ismtpd0019p1las1.sendgrid.net (SG)
 with ESMTP id jtucc2NtSfqeNvyvpGNaow
 Sun, 19 Apr 2020 15:34:00.683 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jQBxI-00050I-1y; Sun, 19 Apr 2020 15:34:00 +0000
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN> <m24kthgh28.fsf@HIDDEN>
User-agent: mu4e 1.0; emacs 26.1
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <m24kthgh28.fsf@HIDDEN>
Date: Sun, 19 Apr 2020 15:34:01 +0000 (UTC)
Message-ID: <86blnnebh3.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?AmdFTmAftiSy=2FOTlLl25AS3vjop5V8nNUQEwGM=2F?=
 =?us-ascii?Q?rtTWoBQPvk5rqytn9bJvgonZV5LjYkcfeHCwrMH?=
 =?us-ascii?Q?FHBvHoB0MrriHpn10atrjKcQ4DiRwG8bMxbU+0m?=
 =?us-ascii?Q?jytuCxwAE3oOBMXXtYASeV=2F1N+orCuBKw=2Farv8C?=
 =?us-ascii?Q?wXjPWTvU48wvWgs5MbuI0gLl3EWhS8hoLb+clg?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: -1.0 (-)


Robert Pluim writes:

> One change we could make is to set p->gnutls_boot_parameters to nil
> here, so that in the sequence
>
>     Fgnutls_boot, handshake does not complete
>     handshake succeeds first time in wait_reading_process_output
>     delete_write_fd then checks p->gnutls_boot_parameters
>
> the sentinel ends up getting run, but I=CA=BCve not seen the handshake ev=
er
> succeed straight away before the delete_write_fd, and if it ever has
> in the wild we would have seen bug reports (and this is dragon-filled
> code, so I don=CA=BCt want to make changes to it if I can help it :-))
>
> In short: I think the change is ok. It passes the network-stream
> tests, so I=CA=BCll run with it for a while, and push it in a week or so.

Will be glad to test anything on this issue. Just let me know
if you pushed any change.

Derek





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

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


Received: (at 40665) by debbugs.gnu.org; 19 Apr 2020 14:34:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 19 10:34:48 2020
Received: from localhost ([127.0.0.1]:45678 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jQB1z-0003qO-Mj
	for submit <at> debbugs.gnu.org; Sun, 19 Apr 2020 10:34:47 -0400
Received: from mail-wr1-f46.google.com ([209.85.221.46]:42716)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1jQB1y-0003qA-EX
 for 40665 <at> debbugs.gnu.org; Sun, 19 Apr 2020 10:34:46 -0400
Received: by mail-wr1-f46.google.com with SMTP id j2so8769211wrs.9
 for <40665 <at> debbugs.gnu.org>; Sun, 19 Apr 2020 07:34:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:message-id:references:date:mime-version
 :content-transfer-encoding;
 bh=sJjmis/yT/OpPEXYZdJqET5vUGIpPdBjKO1QWOdc22U=;
 b=kg+gs63pOZmTTYMlmiUluWhIMqOhbQebVyrniRJ9Y1Lje9gtQ4HNDTroxXGexh7two
 ULuwdYV9PxWbUu8IdH5uGHpeqReTsvxEbrtEii6JjgXXBWNImXeFyDQ5ad905fGrRp2+
 ML/RAyNrOg3MJ4AQ51dhCy05k22v7fUs2kts+eqNYoTtZ3BA8hxo05Y8XHctVNjggIc/
 OPQWeI9OSNE5M1P2zAfnAACo9986dpFoqCRuSXksQt5jFxtSCD0qnn77XDJ8Rz/NWYSC
 Kh3Lbi9xRA41A4biCg1pQMv78mChKx2JhgG6xPvq2JhrG0cJfXGAWC+J1BGLqvVPG2p4
 qHUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:message-id:references:date
 :mime-version:content-transfer-encoding;
 bh=sJjmis/yT/OpPEXYZdJqET5vUGIpPdBjKO1QWOdc22U=;
 b=TxQciLkOgt2jWIR93jgoHi1jVFjWjLmnB2yGDxh82+jxjW5eFRSyZmuvDrjdxOD0Qt
 z5xSscrgkUgakVcvS1WHRRMBWG53h3Xo6TmqOFFjh5EDkZCftox0OQJAXv2aC2M5dCjw
 VWvXqjmRYHk5KQMa6Rd428URJfLqVPP+s9UoDnRnsrku3lkdzU+Bz/70MR+Pgb2BDlF+
 py5dqU0FB04tQCrBMphWcyGra0Fd0VHAaReSB1aMMYBrxBSNRd9KYLOvkN5mw7BeeNHH
 1eNpbf55HKUSrVBwsP63ngLwk6jP65P6PYK8HzhBiPWu/nDu3BWdQWlDb0QBh9TyjbEK
 MbWA==
X-Gm-Message-State: AGi0PuZ9uOLIW67QuXTCbom0PXYibfNgHXsBkMRyliniftbIxK28gFBB
 KJ1PtHlStPtjlQR54Tpb7BS4CMzR
X-Google-Smtp-Source: APiQypKTdPxXwbkc3ploxMCOjKSPUEsTvdIRZOc18srCEGplrgNlbdIT7tqYA5SzYZdh/Fz5eRjghw==
X-Received: by 2002:adf:a15d:: with SMTP id r29mr13113173wrr.134.1587306880031; 
 Sun, 19 Apr 2020 07:34:40 -0700 (PDT)
Received: from rpluim-mac ([2a01:e34:ecfc:a860:4dd7:4da5:1258:da60])
 by smtp.gmail.com with ESMTPSA id x18sm10498927wrv.12.2020.04.19.07.34.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 19 Apr 2020 07:34:39 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
Message-ID: <m24kthgh28.fsf@HIDDEN>
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
 <86eeslecnf.fsf@HIDDEN>
Date: Sun, 19 Apr 2020 16:34:38 +0200
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: 40665
Cc: 40665 <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: -1.0 (-)

>>>>> On Sat, 18 Apr 2020 02:44:05 +0000 (UTC), Derek Zhou <derek@HIDDEN> =
said:

    Derek> Derek Zhou writes:

    >> When this thing happens, the tls handshakes are done properly. Howev=
er,
    >> emacs did not write anything into gnutls before starting to read and
    >> obviously cannot get anything out at all. It is not really a hang, b=
ut
    >> write never happen and the display buffer stays empty.
    >>=20
    >> Derek

    Derek> Took my nearly the whole day to debug, but this one-line patch f=
ixed my
    Derek> problem.
    Derek> My server finishes tls handshake within the gnutls_boot itself, =
and if the
    Derek> sentinel is not called right after, it will never be called so w=
rite
    Derek> will not happen. Someone should review this carefully.

    Derek> diff --git a/src/process.c b/src/process.c
    Derek> index 91d426103d..6d497ef854 100644
    Derek> --- a/src/process.c
    Derek> +++ b/src/process.c
    Derek> @@ -5937,8 +5937,7 @@ wait_reading_process_output (intmax_t time=
_limit, int nsecs, int read_kbd,
    Derek>  		  /* If we have an incompletely set up TLS connection,
    Derek>  		     then defer the sentinel signaling until
    Derek>  		     later. */
    Derek> -		  if (NILP (p->gnutls_boot_parameters)
    Derek> -		      && !p->gnutls_p)
    Derek> +		  if (NILP (p->gnutls_boot_parameters))
    Derek>  #endif
    Derek>  		    {
    Derek>  		      pset_status (p, Qrun);

Here=CA=BCs what I think is happening:

The only way for p->gnutls_boot_parameters to become nil is here in
connect_network_socket:

      if (p->gnutls_initstage =3D=3D GNUTLS_STAGE_READY)
        {
          p->gnutls_boot_parameters =3D Qnil;
	  /* Run sentinels, etc. */
	  finish_after_tls_connection (proc);
        }

and finish_after_tls_connection should call the sentinel, but
NON_BLOCKING_CONNECT_FD is still set, so it doesn=CA=BCt.

The next chance to call the sentinel would be from
wait_reading_process_output, but only if handshaking has been tried
and not completed, except it is complete already.

wait_reading_process_output then calls delete_write_fd, which clears
NON_BLOCKING_CONNECT_FD, and doesn=CA=BCt run the sentinel because
p->gnutls_boot_parameters is nil and p->gnutls_p is true

finish_after_tls_connection never gets another chance to run, since
the socket is connected and handshaking is complete.

After your change, you've fixed this case:

    if p->gnutls_boot_parameters is nil, that means the handshake
    completed already and the TLS connection is up, so
    calling the sentinel is ok.

In other cases where the handshake does not complete straight away in
Fgnutls_boot, it will complete here in wait_reading_process_output

		/* Continue TLS negotiation. */
		if (p->gnutls_initstage =3D=3D GNUTLS_STAGE_HANDSHAKE_TRIED
		    && p->is_non_blocking_client)
		  {
		    gnutls_try_handshake (p);
		    p->gnutls_handshakes_tried++;

		    if (p->gnutls_initstage =3D=3D GNUTLS_STAGE_READY)
		      {
			gnutls_verify_boot (aproc, Qnil);
			finish_after_tls_connection (aproc);
		      }

which always happens after delete_write_fd has been called, which
clears NON_BLOCKING_CONNECT_FD, so finish_after_tls_connection calls
the sentinel.

One change we could make is to set p->gnutls_boot_parameters to nil
here, so that in the sequence

    Fgnutls_boot, handshake does not complete
    handshake succeeds first time in wait_reading_process_output
    delete_write_fd then checks p->gnutls_boot_parameters

the sentinel ends up getting run, but I=CA=BCve not seen the handshake ever
succeed straight away before the delete_write_fd, and if it ever has
in the wild we would have seen bug reports (and this is dragon-filled
code, so I don=CA=BCt want to make changes to it if I can help it :-))

In short: I think the change is ok. It passes the network-stream
tests, so I=CA=BCll run with it for a while, and push it in a week or so.

Robert




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

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


Received: (at 40665) by debbugs.gnu.org; 18 Apr 2020 02:46:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 17 22:46:55 2020
Received: from localhost ([127.0.0.1]:41903 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jPdVO-00023K-TH
	for submit <at> debbugs.gnu.org; Fri, 17 Apr 2020 22:46:55 -0400
Received: from xtrwkvxq.outbound-mail.sendgrid.net ([167.89.24.164]:29617)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jPdVN-000236-84
 for 40665 <at> debbugs.gnu.org; Fri, 17 Apr 2020 22:46:53 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=qjRJga56sIFckKCW1fX33V4Dckt1iBQLBla+tgBvcJ4=;
 b=BQ80qh+jO8vTRuDtgumzEFF/dtsjbPXT2JIYeKQWpOVtcQabh8xtYDFvKvgYjBxffwCm
 WqM/3JUXZ7/rU5TorbORG8UUxw2DGqV2rAwEkgyrC2Krm3rMw1Ozx/GdiP+v34mQhlsDKY
 3yvaSau2/I/aH3lbZJoXXMFJgrLJzazMQ=
Received: by filterdrecv-p3iad2-8ddf98858-5j4tk with SMTP id
 filterdrecv-p3iad2-8ddf98858-5j4tk-19-5E9A6A17-27
 2020-04-18 02:46:47.696286548 +0000 UTC m=+1993160.766657089
Received: from mail.3qin.us (unknown) by ismtpd0038p1las1.sendgrid.net (SG)
 with ESMTP id FwdfOycHRECYlk3NueW2lg
 Sat, 18 Apr 2020 02:46:47.481 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jPdVG-00027R-Of; Sat, 18 Apr 2020 02:46:46 +0000
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <m2wo6eh5lo.fsf@HIDDEN>
User-agent: mu4e 1.0; emacs 26.1
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <m2wo6eh5lo.fsf@HIDDEN>
Date: Sat, 18 Apr 2020 02:46:47 +0000 (UTC)
Message-ID: <86d085ecix.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?Am3PPjw+GOzCKqZQxf0iNinn6VyVWD+SH+WBg8B?=
 =?us-ascii?Q?zwYKe5JqPkkzW92hdJPsU=2FRSw0EabsSOTsRrIBe?=
 =?us-ascii?Q?ZM1PIrXegSegbFzuI+wYGP9NPgmQ=2F=2F1DZhrcA=2FA?=
 =?us-ascii?Q?f7VZw9X7m4c1n5N71DtUq3J0ea3ltcMWYFH=2FTY8?=
 =?us-ascii?Q?7Jje5Q+ksAVrtQoim4NaOCCW1mViRwQisbc7+Z?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.4 (/)
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: -0.6 (/)


Robert Pluim writes:

>>>>>> On Thu, 16 Apr 2020 18:22:10 +0000 (UTC), Derek Zhou <derek@HIDDEN> said:
>     >> Which version exactly of GnuTLS are you running? Is it possible for
>     >> you to do a local install of a newer version and try that with emacs?
>     Derek> I am using Debian 10, standard gnutls version
>     Derek> ii  libgnutls-openssl27:amd64          3.6.7-4+deb10u2                amd64        GNU TLS library - OpenSSL wrapper
>     Derek> ii  libgnutls28-dev:amd64              3.6.7-4+deb10u2                amd64        GNU TLS library - development files
>     Derek> I don't want to mess up system libraries; if there is a way to compile a
>     Derek> gnutls locally and link emacs with it statically, I can try.
>
> You should be able to install GnuTLS to a local directory and then
> use PKG_CONFIG_PATH to point emacs' configure at it. At runtime you'd
> need to use LD_LIBRARY_PATH
Tried some later version of gnutls, does not help. 

Derek





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

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


Received: (at 40665) by debbugs.gnu.org; 18 Apr 2020 02:44:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 17 22:44:12 2020
Received: from localhost ([127.0.0.1]:41899 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jPdSm-0001zC-G4
	for submit <at> debbugs.gnu.org; Fri, 17 Apr 2020 22:44:12 -0400
Received: from o1678912x138.outbound-mail.sendgrid.net ([167.89.12.138]:14284)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jPdSk-0001z0-Q0
 for 40665 <at> debbugs.gnu.org; Fri, 17 Apr 2020 22:44:11 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type;
 s=s1; bh=jWFjfEJx+LhwnEq7r/lkNbJq/EuI6rgTpu+CsEVTIL4=;
 b=aMsyRfFG58pXoyuh8Pr5GnZ02J5n5STfZgp8bTMSc92pTPdjPfqjK8pzWr6+Bbrg+Luy
 Jz5eydHlWUTDUtfyo0/c7anweKPtAxd/28dZsC7pL9blk5W01YHyt1SSN69Eo7RN8lB5Qd
 NloMqKKuc7LUxILxqig57VtvsN87mMefI=
Received: by filterdrecv-p3mdw1-6dbfd75bfd-rd7m8 with SMTP id
 filterdrecv-p3mdw1-6dbfd75bfd-rd7m8-20-5E9A6975-5
 2020-04-18 02:44:05.129228123 +0000 UTC m=+1993005.641738422
Received: from mail.3qin.us (unknown) by ismtpd0006p1sjc2.sendgrid.net (SG)
 with ESMTP id TEnJfGdERSyvH8KgACG9tg
 Sat, 18 Apr 2020 02:44:04.870 +0000 (UTC)
Received: from derek by mail.3qin.us with local (Exim 4.92)
 (envelope-from <derek@HIDDEN>)
 id 1jPdSe-00027A-EY; Sat, 18 Apr 2020 02:44:04 +0000
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN> <86d086dkgq.fsf@HIDDEN>
User-agent: mu4e 1.0; emacs 26.1
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <86d086dkgq.fsf@HIDDEN>
Date: Sat, 18 Apr 2020 02:44:05 +0000 (UTC)
Message-ID: <86eeslecnf.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?Amq5AyGWLPUDaRkD+QfvSr+RXfByyPaD7OLqEII?=
 =?us-ascii?Q?SWeWOglqx2xlTqm1YcwufoSWSMKzYDKx+CNx8+0?=
 =?us-ascii?Q?skQk4RJM15OBrV2zYNiN9Zthfqyf6A7P2s8y9bp?=
 =?us-ascii?Q?2k6JuNNxigJlEaMmquzYOxEwTAzsBKXlFlwAJGf?=
 =?us-ascii?Q?6r=2FCuGtsOcowK38RGLQdHras7o2Nz8fYEn0j0C?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.8 (/)
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: -1.8 (-)

--=-=-=
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Derek Zhou writes:

> When this thing happens, the tls handshakes are done properly. However,
> emacs did not write anything into gnutls before starting to read and
> obviously cannot get anything out at all. It is not really a hang, but
> write never happen and the display buffer stays empty.
>
> Derek

Took my nearly the whole day to debug, but this one-line patch fixed my
problem.
My server finishes tls handshake within the gnutls_boot itself, and if the
sentinel is not called right after, it will never be called so write
will not happen. Someone should review this carefully.


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=tls_fast_boot_bug.patch
Content-Description: bug fix

diff --git a/src/process.c b/src/process.c
index 91d426103d..6d497ef854 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5937,8 +5937,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 		  /* If we have an incompletely set up TLS connection,
 		     then defer the sentinel signaling until
 		     later. */
-		  if (NILP (p->gnutls_boot_parameters)
-		      && !p->gnutls_p)
+		  if (NILP (p->gnutls_boot_parameters))
 #endif
 		    {
 		      pset_status (p, Qrun);

--=-=-=--




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

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


Received: (at 40665) by debbugs.gnu.org; 17 Apr 2020 18:41:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 17 14:41:59 2020
Received: from localhost ([127.0.0.1]:41660 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jPVw7-0001EJ-8B
	for submit <at> debbugs.gnu.org; Fri, 17 Apr 2020 14:41:59 -0400
Received: from xtrwkvxq.outbound-mail.sendgrid.net ([167.89.24.164]:47119)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jPVw4-0001E3-To
 for 40665 <at> debbugs.gnu.org; Fri, 17 Apr 2020 14:41:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=Mn8XtNjwq9838b8Ve004SBtRHvBT6U6KHNaxuuLQHis=;
 b=hpCyQLfPAVF1dFpYqnTdz0osi9u1LNyLZuKEFs68GW5xXaoTTeVz/QDPdBjE4HzVdJHs
 WNYqtb/7vQj7quPrY9WpqkmKMf2kDt1E2rRDgwu56iX08XrLHVUAV2j6uGbM34CXDt4yyR
 U4rWMSd7Kpgy08DnVGONDjW0soW9iPGXs=
Received: by filterdrecv-p3iad2-8ddf98858-lwgxm with SMTP id
 filterdrecv-p3iad2-8ddf98858-lwgxm-19-5E99F86F-27
 2020-04-17 18:41:51.327095323 +0000 UTC m=+1964060.564790885
Received: from mail.3qin.us (unknown) by ismtpd0014p1las1.sendgrid.net (SG)
 with ESMTP id eRgMYVEcRkS4QgzZus5vFQ
 Fri, 17 Apr 2020 18:41:50.881 +0000 (UTC)
Received: from localhost ([127.0.0.1]:37158 helo=mail.3qin.us)
 by mail.3qin.us with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <derek@HIDDEN>)
 id 1jPVvy-0000Kv-CN; Fri, 17 Apr 2020 18:41:50 +0000
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
 <86ftd35930.fsf@HIDDEN>
User-agent: mu4e 1.0; emacs 26.1
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <86ftd35930.fsf@HIDDEN>
Date: Fri, 17 Apr 2020 18:41:51 +0000 (UTC)
Message-ID: <86d086dkgq.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?AmqhMatRdPATw4+5qVHeorcbMIagY3KcqAoooAs?=
 =?us-ascii?Q?k5ijauviXXbcTmcXlYyGGy0IgoE+j=2F=2FYNy9wOLw?=
 =?us-ascii?Q?rWLs3=2FXQzn1kN7XQmubf=2FaSXEtYywjUK4XHihhe?=
 =?us-ascii?Q?61LOdsSLumAqMF4JVsxLawB+jCQil9ca3jE7hdZ?=
 =?us-ascii?Q?WTjqsElRAFwmwhg8gWimoz3ltXllfZz7VhRO=2F2?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.4 (/)
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: -0.6 (/)

When this thing happens, the tls handshakes are done properly. However,
emacs did not write anything into gnutls before starting to read and
obviously cannot get anything out at all. It is not really a hang, but
write never happen and the display buffer stays empty.

Derek




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

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


Received: (at 40665) by debbugs.gnu.org; 17 Apr 2020 08:35:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 17 04:35:57 2020
Received: from localhost ([127.0.0.1]:39916 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jPMTc-0007JV-Rn
	for submit <at> debbugs.gnu.org; Fri, 17 Apr 2020 04:35:57 -0400
Received: from mail-wm1-f49.google.com ([209.85.128.49]:52674)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1jPMTa-0007J5-U2
 for 40665 <at> debbugs.gnu.org; Fri, 17 Apr 2020 04:35:55 -0400
Received: by mail-wm1-f49.google.com with SMTP id o81so2057863wmo.2
 for <40665 <at> debbugs.gnu.org>; Fri, 17 Apr 2020 01:35:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :mime-version; bh=3VJqvQsqBs+96VzwaUEyCbgNREF7T8SR1Rr6xP9mI2U=;
 b=K7Hh641HFdvZvbQpSlb3/OKjX0lfOWl370fR4Rt6BDqf0zBL8hYf+RnVu8zvAQtBBB
 zdYXgijbaouy/YpPWObveo91cFai/9J8kHSmueDG+4nJaITUfSh1SOWgOvzgjW/EEeKK
 jBqtFBzKKhC6SEuGd2ApFvmuUo4disD1EfInhJQWRlwCzQrYdj6Z9JuxYPyuj8uoD9fT
 phjUH3yvr/I+mIUG1Qfaig+nOpsX18pABvo79iyolKV0T0hwf2zfMIjTTZV4R42hHeyz
 Z+gJ11k4FN+VmyF4A3wfbik8mCSkESr78YB0UKq3em9XnEYr10X/4dV8gsePImUT3Img
 6vdw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:mime-version;
 bh=3VJqvQsqBs+96VzwaUEyCbgNREF7T8SR1Rr6xP9mI2U=;
 b=BM6C4opd+2P+JrCVF9nJjAw1aKc8I6TYHEsY+U3pXC46jUVSTfwJw0Rogr3kbGVpkY
 Oe5oKgfILoNORZ4ISTrtHIWXpueS97N6Z+JYOigmyuiP/dvkSk1yNdCGPmiC/m/kpa4V
 2Kefwsnb4mFqq73vJyjUcFmAqwo0M/pj8yWNxjiPgLKMrcbM865Fwt2rWakBRuBS7tXh
 RmLKXoVJCcTLE9U/VPW74ZPVGuh3Is4QJg6J39KuP9paD3jNcIC743c6/CrPd4Ivk2rk
 22xyZ4Z0wkdO5MtMhhm2ocORNYt1ZH8m+ccCGCoIU7Tc4xDzGydHfG3oHuc1g9sTASvs
 PvNw==
X-Gm-Message-State: AGi0PuZIpECJbVGHPNnaaoBN47gK5+HdKFpLN3RpLn5rTjOsfGmoWo3k
 kVCwt+ymDq8O5LaNoIVcbAN/8lar
X-Google-Smtp-Source: APiQypKZvpvCLabPfBAFmQP+q2l8WvUyeTjkJjis4+Zdwo+k0z2FQJYHuxaqsMy4FCQVcA8jL8tXiQ==
X-Received: by 2002:a1c:2e91:: with SMTP id u139mr2162065wmu.18.1587112548589; 
 Fri, 17 Apr 2020 01:35:48 -0700 (PDT)
Received: from rpluim-mac ([2a01:e34:ecfc:a860:384e:c682:f3e3:6663])
 by smtp.gmail.com with ESMTPSA id s17sm6855526wmc.48.2020.04.17.01.35.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 17 Apr 2020 01:35:48 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN>
Date: Fri, 17 Apr 2020 10:35:47 +0200
In-Reply-To: <86imhz5m0f.fsf@HIDDEN> (Derek Zhou's message of "Thu, 16
 Apr 2020 18:22:10 +0000 (UTC)")
Message-ID: <m2wo6eh5lo.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.8 (/)
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: -1.8 (-)

>>>>> On Thu, 16 Apr 2020 18:22:10 +0000 (UTC), Derek Zhou <derek@HIDDEN> said:
    >> Which version exactly of GnuTLS are you running? Is it possible for
    >> you to do a local install of a newer version and try that with emacs?
    Derek> I am using Debian 10, standard gnutls version
    Derek> ii  libgnutls-openssl27:amd64          3.6.7-4+deb10u2                amd64        GNU TLS library - OpenSSL wrapper
    Derek> ii  libgnutls28-dev:amd64              3.6.7-4+deb10u2                amd64        GNU TLS library - development files
    Derek> I don't want to mess up system libraries; if there is a way to compile a
    Derek> gnutls locally and link emacs with it statically, I can try.

You should be able to install GnuTLS to a local directory and then
use PKG_CONFIG_PATH to point emacs' configure at it. At runtime you'd
need to use LD_LIBRARY_PATH

Robert




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

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


Received: (at 40665) by debbugs.gnu.org; 16 Apr 2020 23:01:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 16 19:01:32 2020
Received: from localhost ([127.0.0.1]:39555 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jPDVk-0003Uf-JP
	for submit <at> debbugs.gnu.org; Thu, 16 Apr 2020 19:01:32 -0400
Received: from o50314941.outbound-mail.sendgrid.net ([50.31.49.41]:29935)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jPDVi-0003UR-Vk
 for 40665 <at> debbugs.gnu.org; Thu, 16 Apr 2020 19:01:31 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=8pUocMt3NvzQy/dv6k5BFFBD1RII/CDdykS3XMmsKNM=;
 b=Y247OD2W+SOkqtM79mtK+vLYqBxQQ0P3ATEMfpPF7y7w1p5fs8aHMlnm1UHIn/0SWLeM
 2CtrdBtMBoSukiPI2OwW5hFWJiCWHjSh0H0mbT8RHee6Dkm9xsFIMLS/bnm8uhyPvxc3AO
 NJn4s2aUtWbNyT2cUxPUJtQ2dIR3tu7so=
Received: by filterdrecv-p1iad2-asgard1-688d55b576-jcp7g with SMTP id
 filterdrecv-p1iad2-asgard1-688d55b576-jcp7g-17-5E98E3C5-2C
 2020-04-16 23:01:25.391142886 +0000 UTC m=+93569.990897020
Received: from mail.3qin.us (unknown) by ismtpd0008p1sjc2.sendgrid.net (SG)
 with ESMTP id vCpl_MNEQlGVT_ocbPTghg
 Thu, 16 Apr 2020 23:01:25.056 +0000 (UTC)
Received: from localhost ([127.0.0.1]:35988 helo=mail.3qin.us)
 by mail.3qin.us with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <derek@HIDDEN>)
 id 1jPDVb-0005hs-Ru; Thu, 16 Apr 2020 23:01:23 +0000
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN> <86h7xj5fae.fsf@HIDDEN>
User-agent: mu4e 1.0; emacs 26.1
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <86h7xj5fae.fsf@HIDDEN>
Date: Thu, 16 Apr 2020 23:01:25 +0000 (UTC)
Message-ID: <86ftd35930.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?AmGxpuotnam7aP7SjmyVI4EIPJI75ARvl57F5mU?=
 =?us-ascii?Q?CNOVo70cVZdupTfZrMV2EG3o6zyfLNn7lUut+H+?=
 =?us-ascii?Q?v1UGdA=2FHKUOvVjm0GCIKh1WQAS5+VlD4pz4LHZb?=
 =?us-ascii?Q?aQ4xjiTUihOLcCO9qA3Nt3sFEpj0=2Fsw81qs4sFd?=
 =?us-ascii?Q?j5HDP9gaRTZdcmLq1R1Z55QIbMngVx3hejCQHb4?=
 =?us-ascii?Q?25b9WgjrPv1VfQvxnapGg=3D=3D?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.8 (/)
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: -1.8 (-)


Derek Zhou writes:

> Derek Zhou writes:
>
>> gnutls.c: [1] (Emacs) non-fatal error: Resource temporarily unavailable,
>> try again.
>
> I debug a bit; if I undefine GNUTLS_NONBLOCK everything works. However,
> I still cannot make the non-blocking operation work without possibility
> of hang or pre-mature stop on reading or writing. It is either gnutls
> has some problem in non-blocking operation or the handling of it in emacs
> code. Will try more tonight.

I take this back. now I cannot make anything work any more. Very
strange.

Derek





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

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


Received: (at 40665) by debbugs.gnu.org; 16 Apr 2020 20:47:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 16 16:47:30 2020
Received: from localhost ([127.0.0.1]:39453 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jPBQ2-0006eK-Ft
	for submit <at> debbugs.gnu.org; Thu, 16 Apr 2020 16:47:30 -0400
Received: from xtrwkvxq.outbound-mail.sendgrid.net ([167.89.24.164]:62717)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jPBQ0-0006e7-62
 for 40665 <at> debbugs.gnu.org; Thu, 16 Apr 2020 16:47:28 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=Gf14DkzN7zNrM5T330orVb6orQm+kpexpPJeVh8dXv0=;
 b=AZEeqiVhn+62CpDenFAia1A4EV+PSgCPzo4/48Oij1XvSnXWAmqzoIXaEtM8cACO4XEa
 gLBRmCqBMfihbaRFf/hMM+GNKZeRQOruy/cWWlJXxhNmRVMr8oASAR8yaR0Ou6pake7Wra
 GK+wd96LG/OHbOS3mKjq/gof0NRZ+r7Xw=
Received: by filterdrecv-p3mdw1-6dbfd75bfd-rd7m8 with SMTP id
 filterdrecv-p3mdw1-6dbfd75bfd-rd7m8-20-5E98C45A-A0
 2020-04-16 20:47:22.738027647 +0000 UTC m=+1885203.250537968
Received: from mail.3qin.us (unknown) by ismtpd0034p1las1.sendgrid.net (SG)
 with ESMTP id r-GAjLY6StG1kyfX2Nn9Rg
 Thu, 16 Apr 2020 20:47:22.618 +0000 (UTC)
Received: from localhost ([127.0.0.1]:35950 helo=mail.3qin.us)
 by mail.3qin.us with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <derek@HIDDEN>)
 id 1jPBPt-0006MF-Ol; Thu, 16 Apr 2020 20:47:21 +0000
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
 <86imhz5m0f.fsf@HIDDEN>
User-agent: mu4e 1.0; emacs 26.1
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <86imhz5m0f.fsf@HIDDEN>
Date: Thu, 16 Apr 2020 20:47:22 +0000 (UTC)
Message-ID: <86h7xj5fae.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?Amqnju6A38nefTyi=2FDE13yzN2K1zzjF=2FwMsf4Pw?=
 =?us-ascii?Q?BNdSPqe7MS9Nj5H36OpV5EVIsUOkft=2FHkIYg+Cv?=
 =?us-ascii?Q?lJkdq=2FKCP7TVrJB=2FWCyJ2x6UhvFOgbVXL3dfzE9?=
 =?us-ascii?Q?RjVKUFEc+NTXS2XnTqs9qKfsORIRw5N0CVXYybF?=
 =?us-ascii?Q?5KU2FvK=2Fh0ioR7I53wip71sSR7qI82u5GlwDCM?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.4 (/)
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: -0.6 (/)


Derek Zhou writes:

> gnutls.c: [1] (Emacs) non-fatal error: Resource temporarily unavailable,
> try again.

I debug a bit; if I undefine GNUTLS_NONBLOCK everything works. However,
I still cannot make the non-blocking operation work without possibility
of hang or pre-mature stop on reading or writing. It is either gnutls
has some problem in non-blocking operation or the handling of it in emacs
code. Will try more tonight.

Derek




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

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


Received: (at 40665) by debbugs.gnu.org; 16 Apr 2020 19:04:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 16 15:04:17 2020
Received: from localhost ([127.0.0.1]:39408 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jP9o8-00046t-FO
	for submit <at> debbugs.gnu.org; Thu, 16 Apr 2020 15:04:17 -0400
Received: from o50314941.outbound-mail.sendgrid.net ([50.31.49.41]:42809)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-ec3c-40665=debbugs.gnu.org@HIDDEN>)
 id 1jP99T-00010v-Kt
 for 40665 <at> debbugs.gnu.org; Thu, 16 Apr 2020 14:22:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=references:from:subject:in-reply-to:mime-version:to:cc:content-type:
 content-transfer-encoding;
 s=s1; bh=FfDh+Vo6PBSsBaf2MMepZH2D1dP7AWZDH7rboRy/NjM=;
 b=bEDwbDk8ss7XANwyL7onm/j6U/z7cy2qxH9RF1ehVJLhUdWCTyjfRU8xCSr9vynq7A2k
 DaVfgXMAwBQaZ7ug14P3Ki2LMXEmfi+lZXQXrYkZn/zHpb6MacQJ8lZyEomxV2uxyAa3v6
 GcQUvXbgcTgoksaHQOxyKZCcd3gbQZVwE=
Received: by filterdrecv-p1iad2-asgard1-688d55b576-vtrml with SMTP id
 filterdrecv-p1iad2-asgard1-688d55b576-vtrml-16-5E98A251-16
 2020-04-16 18:22:09.993392921 +0000 UTC m=+76816.114964483
Received: from mail.3qin.us (unknown) by ismtpd0014p1las1.sendgrid.net (SG)
 with ESMTP id _fhPuByJTZ6nu4c3RxtUNQ
 Thu, 16 Apr 2020 18:22:09.843 +0000 (UTC)
Received: from localhost ([127.0.0.1]:35836 helo=mail.3qin.us)
 by mail.3qin.us with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <derek@HIDDEN>)
 id 1jP99M-00031N-TC; Thu, 16 Apr 2020 18:22:08 +0000
References: <86wo6fo78r.fsf@HIDDEN> <m24ktjienb.fsf@HIDDEN>
User-agent: mu4e 1.0; emacs 26.1
From: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
In-reply-to: <m24ktjienb.fsf@HIDDEN>
Date: Thu, 16 Apr 2020 18:22:10 +0000 (UTC)
Message-ID: <86imhz5m0f.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?AmETf6sDtcDUsOafLuQvTshSGa0Sg3S=2FiDpRFP5?=
 =?us-ascii?Q?y7wlaZOlj4EPzucsBHPMl3HUQM44JavdvBt34nW?=
 =?us-ascii?Q?9oot525Eguc8fvWcri=2FvGpruv3Q2WFcJMc8B=2FSB?=
 =?us-ascii?Q?ozDfoFWxHGbKMlHPyC=2FhR51uxw9SIHgwXJjWLwM?=
 =?us-ascii?Q?rly47=2FvSb2xAFkrFpMuynxNAVyNgzoILidUHgd4?=
 =?us-ascii?Q?3ILeUwBj687iJiZu=2FI9oQ=3D=3D?=
To: Robert Pluim <rpluim@HIDDEN>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.8 (/)
X-Debbugs-Envelope-To: 40665
X-Mailman-Approved-At: Thu, 16 Apr 2020 15:04:15 -0400
Cc: 40665 <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: -1.8 (-)


Robert Pluim writes:

>>>>>> On Thu, 16 Apr 2020 14:06:30 +0000 (UTC), Derek Zhou <derek@HIDDEN> said:
>
>     Derek> I have a vps that have ssl cert from let's encrypt. If I run emacs on
>     Derek> that machine and use eww to open the local url through proper DNS name,
>     Derek> it hangs. This only happen with gnutls 3.6+ I believe. w3m works.
>
> w3m uses OpenSSL rather than GnuTLS, I think.
True, however, wget works, which use gnutls.
>
>     Derek> recipe:
>     Derek> emacs -q
>     Derek> M-x eww
>     Derek> https://u15789687.ct.sendgrid.net/ls/click?upn=5u6PACFCQRlPqbnHSU4z2Xlc-2BdngjKawFESXJ7OrOF8M0VhErToh587OqGs4rdXCYpHS-2BTJCwQlyeoYpCGakF7HeU0y-2ByPTUfBl7m1gchyt8f9DppJ79-2BiI84YXNxbHvWRJyYFbi8O0HbKvvdS1ddux3ZjncA02WH4UyER8c34I-2BD7sN4tF1vdNkjAh9119T1Vnevpw0iFcIaCldIwi3pFMJra8DmFvLPm-2FF8zihX-2Bst0h8NJYZr3qoni6nP4cpeyRUK7caO86OxFnwGl-2FDd-2BC2aJe2MQ3-2BUedR5rO98PGM2qC9CmZpHC6LeditpbEMg30SLXsj-2B-2F7LCBhBfjmHD0OLTr-2BHtEiIkdcnftf1TZuxGU-2FLZzlzKMdeUjJElVAwbHa6NnmjFvW6U1NyGilkkC-2FutAlHDaF8hwDB5aRdmIV7VO9hYnp0sJL2jW76MLyjoD3UMd0cndm-2FfRdMPrnhiDAQlj-2F2atQr-2F0YiEMsOTdF034xF-2BsahDF55iuCkyKFQEQPKTIBSn6j76ME2zRj4-2BVw-3D-3D_U2j_S71vn-2BdJ969jmJsMZjcAVQ4Mbh84GRhJ0erfBn5ySXu1Uwk8oEkEaLtN1f5KRaKw1GkGOL1TU5kIB15t6oXeTDhu8J6Q7nTz-2FKhR7YJaupyvWQhgCTiCw1iDgSo5HtcOHBVcSQpRwOWOSozqTdtwd1pCWcPFeLcdQ1RBNsisdkYedrggCQGsUES4VBHJOYw-2FYGjkvEi2iyte2vifaqFXX2XlbbjnToTO6WQMa2ynzhPCWiWpfoD2XIbEMU3FUeNA
Sorry, the crazy sendgrid munge links. it was mail.3qin.us
>
>     Derek> This only happens when running on mail.3qin.us itself; from across the
>     Derek> network it is ok. I believe it is timing related and worsen by very
>     Derek> short network latency and small files.
>
> Which version exactly of GnuTLS are you running? Is it possible for
> you to do a local install of a newer version and try that with emacs?
I am using Debian 10, standard gnutls version
ii  libgnutls-openssl27:amd64          3.6.7-4+deb10u2                amd64        GNU TLS library - OpenSSL wrapper
ii  libgnutls28-dev:amd64              3.6.7-4+deb10u2                amd64        GNU TLS library - development files
I don't want to mess up system libraries; if there is a way to compile a
gnutls locally and link emacs with it statically, I can try.
>
> Otherwise, maybe turning off TLS1.3 will help:
>
>     (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
>
Does not help.

> Another thing to try is setting 'gnutls-log-level' to progressively
> higher values, to see if it resolves the timing issues.
1 or 2 will give me more informational prints; with or without the
following; but always hang. 3 does not seem to have any effect.

gnutls.c: [1] (Emacs) non-fatal error: Resource temporarily unavailable,
try again.

I've tried 26.3, latest git (28.0.??) latest emacs-27 (27.0.9?) and they
all behave the same.

Derek





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

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


Received: (at 40665) by debbugs.gnu.org; 16 Apr 2020 16:23:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 16 12:23:00 2020
Received: from localhost ([127.0.0.1]:39204 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jP7I4-0004I0-6K
	for submit <at> debbugs.gnu.org; Thu, 16 Apr 2020 12:23:00 -0400
Received: from mail-wr1-f49.google.com ([209.85.221.49]:35102)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1jP7I1-0004Hl-ST
 for 40665 <at> debbugs.gnu.org; Thu, 16 Apr 2020 12:22:58 -0400
Received: by mail-wr1-f49.google.com with SMTP id x18so5603846wrq.2
 for <40665 <at> debbugs.gnu.org>; Thu, 16 Apr 2020 09:22:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :mime-version; bh=lpV8uYd1FOjidEsJK9kq1Nwp+/NVLV9vdeY14di9zYE=;
 b=OiKikdVSjh0vguYst/0ezQD2YMseodXk0PtkA/Yq/KfgAgfvJYn8rHvLEt9I3DSPw4
 Wdy3d/y9+6Cmq2tkLLI8uSBmEJPiAeKxxbAE/ja4+H1Jy8yJ47RouZceGKs+xiFUDQBC
 170OOB/DehpaaLOQO6TkOqwC0GhdIiGhiXZee+MN5IJKOeRAvdoXtsVJl2N9oBvGFvhy
 DQ6503jPqOUEkXf4R8kk4IK/WSb+Umaaj1uQw2zT4t3T70B57BVDCnuRqlWddU5uW5lV
 COZOZxFa1ai+lFEcYjAj0lK7rxNb5lvOhprQ5OAHlsXj8+sDsd0PSCoSN+KtYPEmWszS
 9WJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:mime-version;
 bh=lpV8uYd1FOjidEsJK9kq1Nwp+/NVLV9vdeY14di9zYE=;
 b=j29OqS41mh4mQ0adKOW1r6KRka2Tl+2UMEhngD77qnOkXzYHR9hhtj6iyxeIJtZSZo
 eNA3+53noTBRaCbm7J8QMn7Q0oV5zWOp0qyuJ9D1prKIFu8Lt5SBV2Wn2t1demSUXdC3
 4AczUlt8LRB9uefPpD8wZpECPD4GyUlyl4h44IrygxOKNP3xpFr0sAp1Qq8mGGdkZA9G
 I7LxlbmOjSUcVY8rOByitR7s9FT8LfzJFLQ4F/KXAaUy0raxDtRVVDzRVa3cCoeVVUFc
 Ho6qOevUO4H8A1dnbkreXk/Z+Yfw/zJj5e4qmRHBE8PrAGmAJDZ3aW2hyuTz840RZW6k
 114A==
X-Gm-Message-State: AGi0PuZtDHHluzoqe5ij8FgYVyrXa4qgv5sfpVrbPWgtYi8xyO+I4XVe
 IS79yhTB3ZPF2FEGT5zzk62EQJK1
X-Google-Smtp-Source: APiQypIhQrvgxUrjOLxKbieakVA9PJgOtlAHOe3UpKgWYl9mpx7J0pAgw8N6P0bU4AV0JYiDdSi85w==
X-Received: by 2002:adf:de8b:: with SMTP id w11mr8391343wrl.48.1587054171631; 
 Thu, 16 Apr 2020 09:22:51 -0700 (PDT)
Received: from rpluim-mac ([2a01:e34:ecfc:a860:384e:c682:f3e3:6663])
 by smtp.gmail.com with ESMTPSA id z18sm21962689wrw.41.2020.04.16.09.22.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 16 Apr 2020 09:22:51 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Derek Zhou <derek@HIDDEN>
Subject: Re: bug#40665: 28.0.50; tls hang on local ssl
References: <86wo6fo78r.fsf@HIDDEN>
Date: Thu, 16 Apr 2020 18:22:48 +0200
In-Reply-To: <86wo6fo78r.fsf@HIDDEN> (Derek Zhou's message of "Thu, 16
 Apr 2020 14:06:30 +0000 (UTC)")
Message-ID: <m24ktjienb.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.8 (/)
X-Debbugs-Envelope-To: 40665
Cc: 40665 <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: -1.8 (-)

>>>>> On Thu, 16 Apr 2020 14:06:30 +0000 (UTC), Derek Zhou <derek@HIDDEN> said:

    Derek> I have a vps that have ssl cert from let's encrypt. If I run emacs on
    Derek> that machine and use eww to open the local url through proper DNS name,
    Derek> it hangs. This only happen with gnutls 3.6+ I believe. w3m works.

w3m uses OpenSSL rather than GnuTLS, I think.

    Derek> recipe:
    Derek> emacs -q
    Derek> M-x eww
    Derek> https://u15789687.ct.sendgrid.net/ls/click?upn=5u6PACFCQRlPqbnHSU4z2cQ21VoDRd3GIiP45VZkVss-3DZL1J_BeaubjMha5v6Ct1PCBdNXS7c-2B4F-2FiYml2FeMaPqPFw6mlPCBFCAdA-2BJhSopciFrXarTStvJH7F2cC8M4I5-2BSIuHrtbPlXdAWJ2PCGsvuTDU6kkpVZ5JAYurFBfbu8uG6PzR-2BqkNWc1EoW8kPIdIY9NymfSyaiKNcH-2F4DHCP9GFBvbUhtpcMZmq3z0U-2FWPsThxiaP-2BlzG2O8BI46NDehudn-2FKUS7g-2FjrNI0N1zBKjqzV6MI7ge8846jUqXY-2FUQ3jE

    Derek> This only happens when running on mail.3qin.us itself; from across the
    Derek> network it is ok. I believe it is timing related and worsen by very
    Derek> short network latency and small files.

Which version exactly of GnuTLS are you running? Is it possible for
you to do a local install of a newer version and try that with emacs?

Otherwise, maybe turning off TLS1.3 will help:

    (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")

Another thing to try is setting 'gnutls-log-level' to progressively
higher values, to see if it resolves the timing issues.

Robert




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

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


Received: (at submit) by debbugs.gnu.org; 16 Apr 2020 16:00:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 16 12:00:12 2020
Received: from localhost ([127.0.0.1]:39160 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jP6w0-0003fP-Eu
	for submit <at> debbugs.gnu.org; Thu, 16 Apr 2020 12:00:12 -0400
Received: from lists.gnu.org ([209.51.188.17]:33619)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bounces+15789687-84ec-bug-gnu-emacs=gnu.org@HIDDEN>)
 id 1jP5Aa-0000xg-Uo
 for submit <at> debbugs.gnu.org; Thu, 16 Apr 2020 10:07:09 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:38065)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <bounces+15789687-84ec-bug-gnu-emacs=gnu.org@HIDDEN>)
 id 1jP5AZ-0007hb-7P
 for bug-gnu-emacs@HIDDEN; Thu, 16 Apr 2020 10:07:08 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE,
 UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <bounces+15789687-84ec-bug-gnu-emacs=gnu.org@HIDDEN>)
 id 1jP5AX-0001VA-DY
 for bug-gnu-emacs@HIDDEN; Thu, 16 Apr 2020 10:07:07 -0400
Received: from o50314941.outbound-mail.sendgrid.net ([50.31.49.41]:62452)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <bounces+15789687-84ec-bug-gnu-emacs=gnu.org@HIDDEN>)
 id 1jP5AV-0001Rt-V3
 for bug-gnu-emacs@HIDDEN; Thu, 16 Apr 2020 10:07:04 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=3qin.us;
 h=from:subject:mime-version:to:content-type:content-transfer-encoding;
 s=s1; bh=DhRBrXW1d21BQXkLfQv+Z9bbRXFLZn8o6LIbbhUGcmQ=;
 b=l3m4Jto0o8u4pfExqVADo4y339ZRrATkFrsymH4b7imPwoXnpYQA0ZrsddDpPItfGeOT
 WwbOtSBBOeGJR0T9BB77rTQZ3HxmXnQ19hclzFx2TUr5ptWAAdXjujMAULkPk9I3WEEU0u
 pR16DyZW/wL9c6wMwVWnskHxENHK27FC4=
Received: by filterdrecv-p3iad2-8ddf98858-fmgmf with SMTP id
 filterdrecv-p3iad2-8ddf98858-fmgmf-19-5E986666-115
 2020-04-16 14:06:30.775552174 +0000 UTC m=+1861141.180560219
Received: from mail.3qin.us (unknown) by ismtpd0040p1las1.sendgrid.net (SG)
 with ESMTP id TDjXIJdgRhaG-tY3Im9BfQ for <bug-gnu-emacs@HIDDEN>;
 Thu, 16 Apr 2020 14:06:30.376 +0000 (UTC)
Received: from localhost ([127.0.0.1]:34772 helo=mail.3qin.us)
 by mail.3qin.us with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <derek@HIDDEN>) id 1jP59x-0008Ri-Mj
 for bug-gnu-emacs@HIDDEN; Thu, 16 Apr 2020 14:06:29 +0000
From: Derek Zhou <derek@HIDDEN>
Subject: 28.0.50; tls hang on local ssl
Date: Thu, 16 Apr 2020 14:06:30 +0000 (UTC)
Message-ID: <86wo6fo78r.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog=2F9eXX7sL09U?=
 =?us-ascii?Q?AmMX1pDCa7BYnaBehQiDy+tFduHUZas0Xt4ngoE?=
 =?us-ascii?Q?85QtclCWSHB3t5W450gEnEfoAzxZEw3AZ8LKkj2?=
 =?us-ascii?Q?8UhJvbytorbfJQ8GlTU=2FLmZO=2FbXVye9jUlj9wwk?=
 =?us-ascii?Q?kRzVA7qKr0z+vRXA2hbZQRfBAiygsNykPtLd1AW?=
 =?us-ascii?Q?MPg3aOcqzd3MnlI86nE5AI7e2VoBrNX=2FpdGirv?=
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-Received-From: 50.31.49.41
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Thu, 16 Apr 2020 12:00:10 -0400
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: -0.7 (/)


I have a vps that have ssl cert from let's encrypt. If I run emacs on
that machine and use eww to open the local url through proper DNS name,
it hangs. This only happen with gnutls 3.6+ I believe. w3m works.

recipe:
emacs -q
M-x eww
https://u15789687.ct.sendgrid.net/ls/click?upn=5u6PACFCQRlPqbnHSU4z2cQ21VoDRd3GIiP45VZkVss-3DZL1J_BeaubjMha5v6Ct1PCBdNXS7c-2B4F-2FiYml2FeMaPqPFw6mlPCBFCAdA-2BJhSopciFrXarTStvJH7F2cC8M4I5-2BSIuHrtbPlXdAWJ2PCGsvuTDU6kkpVZ5JAYurFBfbu8uG6PzR-2BqkNWc1EoW8kPIdIY9NymfSyaiKNcH-2F4DHCP9GFBvbUhtpcMZmq3z0U-2FWPsThxiaP-2BlzG2O8BI46NDehudn-2FKUS7g-2FjrNI0N1zBKjqzV6MI7ge8846jUqXY-2FUQ3jE

This only happens when running on mail.3qin.us itself; from across the
network it is ok. I believe it is timing related and worsen by very
short network latency and small files.


In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu)
 of 2020-04-16 built on mail.3qin.us
Repository revision: d5a7df8c02f04102d50a5cd2290262f59f2b1415
Repository branch: master
System Description: Debian GNU/Linux 9 (stretch)

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Contacting host: mail.3qin.us:443
Quit
Making completion list... [2 times]

Configured using:
 'configure --prefix=/usr/local/stow/emacs-git'

Configured features:
SOUND NOTIFY INOTIFY GNUTLS LIBXML2 ZLIB MODULES THREADS PDUMPER GMP

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: eww

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired dired-loaddefs rfc822 mml
mml-sec epa derived epg epg-config mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader sendmail gnutls network-stream url-http
mail-parse rfc2231 url-gw nsm rmc url-cache url-auth regexp-opt eww
easymenu mm-url gnus nnheader gnus-util rmail tool-bar rmail-loaddefs
rfc2047 rfc2045 ietf-drums time-date mail-utils wid-edit mm-util
mail-prsvr thingatpt url-queue url url-proxy url-privacy url-expand
url-methods url-history mailcap shr text-property-search url-cookie
url-domsuf url-util url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache json subr-x map url-vars puny
image svg xml seq dom browse-url format-spec cl-loaddefs cl-lib
term/xterm xterm byte-opt gv bytecomp byte-compile cconv tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type tabulated-list
replace newcomment text-mode elisp-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch timer select mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame minibuffer
cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese composite
charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev
obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp
files text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads inotify
multi-tty make-network-process emacs)

Memory information:
((conses 16 80381 6214)
 (symbols 48 9811 1)
 (strings 32 28375 1106)
 (string-bytes 1 862248)
 (vectors 16 12526)
 (vector-slots 8 146194 6312)
 (floats 8 58 333)
 (intervals 56 186 0)
 (buffers 992 13))




Acknowledgement sent to Derek Zhou <derek@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#40665; 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: Fri, 24 Apr 2020 14:30:02 UTC

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