From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#40665: 28.0.50; tls hang on local ssl Date: Wed, 22 Apr 2020 15:12:40 +0200 Message-ID: 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> <86eeslecnf.fsf@mail.3qin.us> <86blnnebh3.fsf@mail.3qin.us> <86zhb5hecx.fsf@mail.3qin.us> <86eeshpqdb.fsf@mail.3qin.us> <86zhb5q7sw.fsf@mail.3qin.us> <86y2qorj76.fsf@mail.3qin.us> <86368w1tge.fsf@mail.3qin.us> <864ktcfpm5.fsf@mail.3qin.us> <86368wfp6d.fsf@mail.3qin.us> <86y2qniu5m.fsf@mail.3qin.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="26529"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40665@debbugs.gnu.org To: Derek Zhou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 22 15:14:49 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 1jRFDD-0006hl-1J for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Apr 2020 15:14:47 +0200 Original-Received: from localhost ([::1]:50376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRFDC-0007En-4a for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Apr 2020 09:14:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49678) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRFBX-0004LQ-Py for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 09:13:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRFBX-0007rL-5f for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 09:13:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRFBW-0007r2-OV for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 09:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jRFBW-0008S2-Ih for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 09:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Apr 2020 13:13:02 +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.158756117332472 (code B ref 40665); Wed, 22 Apr 2020 13:13:02 +0000 Original-Received: (at 40665) by debbugs.gnu.org; 22 Apr 2020 13:12:53 +0000 Original-Received: from localhost ([127.0.0.1]:51548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRFBN-0008Rf-De for submit@debbugs.gnu.org; Wed, 22 Apr 2020 09:12:53 -0400 Original-Received: from mail-wm1-f45.google.com ([209.85.128.45]:54208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRFBL-0008RR-AI for 40665@debbugs.gnu.org; Wed, 22 Apr 2020 09:12:51 -0400 Original-Received: by mail-wm1-f45.google.com with SMTP id t63so2258720wmt.3 for <40665@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) Original-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) In-Reply-To: <86y2qniu5m.fsf@mail.3qin.us> (Derek Zhou's message of "Wed, 22 Apr 2020 12:25:59 +0000 (UTC)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:178789 Archived-At: >>>>> On Wed, 22 Apr 2020 12:25:59 +0000 (UTC), Derek Zhou = said: Derek> Robert Pluim writes: >>>>>>> On Tue, 21 Apr 2020 22:29:30 +0000 (UTC), Derek Zhou 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 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