From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Derek Zhou Newsgroups: gmane.emacs.bugs Subject: bug#40665: 28.0.50; tls hang on local ssl Date: Sat, 18 Apr 2020 02:44:05 +0000 (UTC) Message-ID: <86eeslecnf.fsf@mail.3qin.us> References: <86wo6fo78r.fsf@mail.3qin.us> <86imhz5m0f.fsf@mail.3qin.us> <86h7xj5fae.fsf@mail.3qin.us> <86ftd35930.fsf@mail.3qin.us> <86d086dkgq.fsf@mail.3qin.us> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="23919"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.0; emacs 26.1 Cc: 40665@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 18 04:45:56 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jPdUQ-00067V-D7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Apr 2020 04:45:54 +0200 Original-Received: from localhost ([::1]:54168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPdUN-0004UY-9Q for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Apr 2020 22:45:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50621) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPdTd-0004QW-PI for bug-gnu-emacs@gnu.org; Fri, 17 Apr 2020 22:45:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPdTb-0007Zu-9z for bug-gnu-emacs@gnu.org; Fri, 17 Apr 2020 22:45:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58586) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPdTZ-0007S3-VI for bug-gnu-emacs@gnu.org; Fri, 17 Apr 2020 22:45:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jPdTZ-00020T-Rv for bug-gnu-emacs@gnu.org; Fri, 17 Apr 2020 22:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Derek Zhou Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Apr 2020 02:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40665 X-GNU-PR-Package: emacs Original-Received: via spool by 40665-submit@debbugs.gnu.org id=B40665.15871778527642 (code B ref 40665); Sat, 18 Apr 2020 02:45:01 +0000 Original-Received: (at 40665) by debbugs.gnu.org; 18 Apr 2020 02:44:12 +0000 Original-Received: from localhost ([127.0.0.1]:41899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jPdSm-0001zC-G4 for submit@debbugs.gnu.org; Fri, 17 Apr 2020 22:44:12 -0400 Original-Received: from o1678912x138.outbound-mail.sendgrid.net ([167.89.12.138]:14284) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jPdSk-0001z0-Q0 for 40665@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= Original-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 Original-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) Original-Received: from derek by mail.3qin.us with local (Exim 4.92) (envelope-from ) id 1jPdSe-00027A-EY; Sat, 18 Apr 2020 02:44:04 +0000 In-reply-to: <86d086dkgq.fsf@mail.3qin.us> X-SG-EID: nTv1epxWypfl0GRwygk8G5JZcpWJeBCcUM8ly3qzpbbVyfDgYog/9eXX7sL09UAmq5AyGWLPUDaRkD+QfvSr+RXfByyPaD7OLqEIISWeWOglqx2xlTqm1YcwufoSWSMKzYDKx+CNx8+0skQk4RJM15OBrV2zYNiN9Zthfqyf6A7P2s8y9bp2k6JuNNxigJlEaMmquzYOxEwTAzsBKXlFlwAJGf6r/CuGtsOcowK38RGLQdHras7o2Nz8fYEn0j0C X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:178545 Archived-At: --=-=-= 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); --=-=-=--