From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24201: 25.1.50; TLS connections sometimes hang Date: Fri, 05 Jul 2019 11:21:51 +0300 Message-ID: <83v9wgao2o.fsf@gnu.org> References: <87efrp2qw0.fsf@mouse> <83tw0lxjt3.fsf@gnu.org> <6e9f3b6c-43df-bf95-d346-56c93c61b4d7@cs.ucla.edu> <83o9kk96ez.fsf@gnu.org> <83h8qc92hc.fsf@gnu.org> <834l4en63b.fsf@gnu.org> <83h88cjoiv.fsf@gnu.org> <87ftntkc53.fsf@tcd.ie> <83sgrthih6.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="58839"; mail-complaints-to="usenet@blaine.gmane.org" Cc: contovob@tcd.ie, 24201@debbugs.gnu.org, eggert@cs.ucla.edu To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 05 10:23:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hjJUu-000FAU-4M for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Jul 2019 10:23:12 +0200 Original-Received: from localhost ([::1]:50432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjJUt-0006vk-6J for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Jul 2019 04:23:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55050) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjJUn-0006ta-Q9 for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2019 04:23:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjJUm-0005gP-PG for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2019 04:23:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43503) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjJUk-0005eu-9K for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2019 04:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hjJUk-0004Ff-4l for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2019 04:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Jul 2019 08:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24201 X-GNU-PR-Package: emacs Original-Received: via spool by 24201-submit@debbugs.gnu.org id=B24201.156231497916318 (code B ref 24201); Fri, 05 Jul 2019 08:23:02 +0000 Original-Received: (at 24201) by debbugs.gnu.org; 5 Jul 2019 08:22:59 +0000 Original-Received: from localhost ([127.0.0.1]:52324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hjJUg-0004F7-P0 for submit@debbugs.gnu.org; Fri, 05 Jul 2019 04:22:59 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hjJUf-0004Ev-7G for 24201@debbugs.gnu.org; Fri, 05 Jul 2019 04:22:57 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hjJTk-00050h-Kb; Fri, 05 Jul 2019 04:22:49 -0400 Original-Received: from [176.228.60.248] (port=1165 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hjJTk-0000YN-2I; Fri, 05 Jul 2019 04:22:00 -0400 In-reply-to: (message from Lars Ingebrigtsen on Thu, 04 Jul 2019 15:04:54 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:162108 Archived-At: > From: Lars Ingebrigtsen > Cc: "Basil L. Contovounesios" , 24201@debbugs.gnu.org, eggert@cs.ucla.edu > Date: Thu, 04 Jul 2019 15:04:54 +0200 > > I think this code looks suspicious: > > if (NILP (wait_for_cell) && just_wait_proc >= 0 > && timespec_valid_p (timer_delay) > && timespec_cmp (timer_delay, timeout) < 0) > { > if (!timespec_valid_p (now)) > now = current_timespec (); > struct timespec timeout_abs = timespec_add (now, timeout); > if (!timespec_valid_p (got_output_end_time) > || timespec_cmp (timeout_abs, got_output_end_time) < 0) > got_output_end_time = timeout_abs; > timeout = timer_delay; > } > else > got_output_end_time = invalid_timespec (); > > This is done only if JUST-THIS-ONE is set. There's also this: /* Wait till there is something to do. */ if (wait_proc && just_wait_proc) { if (wait_proc->infd < 0) /* Terminated. */ break; FD_SET (wait_proc->infd, &Available); check_delay = 0; check_write = 0; } In your case, wait_proc is non-NULL. Can you tell which of the various conditions cause accept-process-output to return after a timeout when you apply the patch to network-stream.el? Then we'd know for sure which part helps avoid the loop when JUST-THIS-ONE is non-nil. But what I'm missing is some description of the traffic that happens on the wire. Is the remote responding or isn't it, and if not, then do we have any idea why?