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: Mon, 24 Jun 2019 22:20:08 +0300 Message-ID: <834l4en63b.fsf@gnu.org> References: <83mvicebin.fsf@gnu.org> <83d1j8e9c0.fsf@gnu.org> <83shg5z32d.fsf@gnu.org> <87efrp2qw0.fsf@mouse> <83tw0lxjt3.fsf@gnu.org> <6e9f3b6c-43df-bf95-d346-56c93c61b4d7@cs.ucla.edu> <83o9kk96ez.fsf@gnu.org> <83h8qc92hc.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="24869"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 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 Mon Jun 24 21:21:31 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 1hfUWw-0006Ey-UO for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jun 2019 21:21:31 +0200 Original-Received: from localhost ([::1]:54114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfUWq-0005lV-99 for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jun 2019 15:21:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45979) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfUWW-0005l8-3X for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 15:21:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfUWU-00050P-AE for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 15:21:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44460) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfUWU-000509-6S for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 15:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hfUWU-0003mi-0E for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 15:21: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: Mon, 24 Jun 2019 19:21:01 +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.156140403114486 (code B ref 24201); Mon, 24 Jun 2019 19:21:01 +0000 Original-Received: (at 24201) by debbugs.gnu.org; 24 Jun 2019 19:20:31 +0000 Original-Received: from localhost ([127.0.0.1]:58004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfUVz-0003la-2m for submit@debbugs.gnu.org; Mon, 24 Jun 2019 15:20:31 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfUVx-0003lL-2H for 24201@debbugs.gnu.org; Mon, 24 Jun 2019 15:20:29 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hfUVr-00045F-Df; Mon, 24 Jun 2019 15:20:23 -0400 Original-Received: from [176.228.60.248] (port=1603 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hfUVp-00049k-9d; Mon, 24 Jun 2019 15:20:23 -0400 In-reply-to: (message from Lars Ingebrigtsen on Mon, 24 Jun 2019 15:25:52 +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:161267 Archived-At: > From: Lars Ingebrigtsen > Cc: 24201@debbugs.gnu.org, eggert@cs.ucla.edu > Date: Mon, 24 Jun 2019 15:25:52 +0200 > > I've now started looking at this again, and is running Emacs under gdb. Thanks. > Last night, I got the hang again. I C-z'd in gdb (i.e., SIGTSTP), and > then did "finish" until it returned sufficiently that we got back to the > hang, and the I repeated, the procedure a couple of times, until the > file "finish" returned to Emacs and Emacs was un-hung. > > These hangs usually last for about a minute or so, with intervention > with gdb or not, so I would guess that the code stops hanging when the > peer finally gives up on the connection and hangs up or something. > > Does the output from gdb have any smoking gun about what's making this > semi-infloop in accept-process-output? It doesn't loop in accept-process-output, it loops several stack frames above that. accept-process-output returns when you type "finish", so it by itself is not the culprit. > (gdb) finish > Run till exit from #0 Ffuncall (nargs=4, args=args@entry=0x7fffffffb420) > at eval.c:2826 > 0x0000555555720e60 in exec_byte_code (bytestr=, > vector=, maxdepth=, > args_template=, nargs=nargs@entry=5, args=, > args@entry=0x34) at bytecode.c:633 > 633 TOP = Ffuncall (op + 1, &TOP); > Value returned is $13 = (union Lisp_X *) 0x0 > (gdb) finish > Run till exit from #0 0x0000555555720e60 in exec_byte_code ( > bytestr=, vector=, maxdepth=, > args_template=, nargs=nargs@entry=5, args=, > args@entry=0x34) at bytecode.c:633 > > ^Z Each time "finish" doesn't return you have a call to funcall and 2 calls to exec_byte_code above it. Can you tell what function is being called by funcall? It's easy: after you get to that frame, and see this: Ffuncall (nargs=4, args=args@entry=0x7fffffffb420) at eval.c:2826 2826 lisp_eval_depth--; Value returned is $12 = (union Lisp_X *) 0x0 don't type "finish", but instead do this: (gdb) p args[0] (gdb) xsymbol You should see one of the Lisp functions you see in the Lisp backtrace: "accept-process-output" (0xffffb498) "network-stream-get-response" (0xffffb728) "network-stream-open-starttls" (0xffffbbd8) "open-network-stream" (0xffffbec0) "nntp-open-connection" (0xffffc3a0) "nntp-possibly-change-group" (0xffffca50) "nntp-with-open-group-function" (0xffffccf0) "nntp-request-article" (0xffffcf60) "gnus-request-article" (0xffffd228) "gnus-async-prefetch-article" (0xffffd538) "apply" (0xffffd648) "timer-event-handler" (0xffffd8f8) Once you see the name of that function, look at its caller's code, and try to figure out what are the two levels of exec_byte_code above Ffuncall doing, and through this why they might loop.