unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 24201@debbugs.gnu.org, eggert@cs.ucla.edu
Subject: bug#24201: 25.1.50; TLS connections sometimes hang
Date: Mon, 24 Jun 2019 22:20:08 +0300	[thread overview]
Message-ID: <834l4en63b.fsf@gnu.org> (raw)
In-Reply-To: <m3blynxggv.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon,  24 Jun 2019 15:25:52 +0200)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> 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=<optimized out>, 
>     vector=<optimized out>, maxdepth=<optimized out>, 
>     args_template=<optimized out>, nargs=nargs@entry=5, args=<optimized out>, 
>     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=<optimized out>, vector=<optimized out>, maxdepth=<optimized out>, 
>     args_template=<optimized out>, nargs=nargs@entry=5, args=<optimized out>, 
>     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.





  reply	other threads:[~2019-06-24 19:20 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11 13:20 bug#24201: 25.1.50; TLS connections sometimes hang Lars Ingebrigtsen
2016-08-15  2:35 ` Paul Eggert
2016-10-10 10:36   ` Eli Zaretskii
2016-10-10 10:54     ` Lars Ingebrigtsen
2016-10-10 11:23       ` Eli Zaretskii
2017-09-02 12:40         ` Eli Zaretskii
2017-09-02 13:04           ` Lars Ingebrigtsen
2017-09-02 14:21             ` Eli Zaretskii
2018-02-18 17:57               ` Lars Ingebrigtsen
2018-02-19 16:52                 ` Lars Ingebrigtsen
2018-02-19 17:56                   ` Paul Eggert
2018-02-19 18:16                     ` Lars Ingebrigtsen
2018-02-19 18:32                       ` Eli Zaretskii
2018-02-19 19:06                         ` Lars Ingebrigtsen
2018-02-19 19:57                           ` Eli Zaretskii
2018-02-19 20:39                             ` Lars Ingebrigtsen
2019-06-24 13:25                               ` Lars Ingebrigtsen
2019-06-24 19:20                                 ` Eli Zaretskii [this message]
2019-06-24 20:46                                   ` Lars Ingebrigtsen
2019-06-25 19:15                                     ` Lars Ingebrigtsen
2019-06-25 21:57                                       ` Lars Ingebrigtsen
2019-06-26 16:32                                         ` Eli Zaretskii
2019-06-27 10:34                                           ` Lars Ingebrigtsen
2019-06-27 13:25                                             ` Eli Zaretskii
2019-06-27 19:28                                               ` Lars Ingebrigtsen
2019-06-28  6:19                                                 ` Eli Zaretskii
2019-06-28  8:25                                                   ` Lars Ingebrigtsen
2019-06-28  8:34                                                     ` Eli Zaretskii
2019-06-28  9:55                                                       ` Lars Ingebrigtsen
2019-06-28 12:26                                                         ` Eli Zaretskii
2019-06-28 14:39                                             ` Basil L. Contovounesios
2019-06-28 14:50                                               ` Eli Zaretskii
2019-06-30 19:02                                                 ` Lars Ingebrigtsen
2019-07-04 13:04                                                   ` Lars Ingebrigtsen
2019-07-04 19:05                                                     ` Eli Zaretskii
2019-07-05 12:59                                                       ` Lars Ingebrigtsen
2019-07-05 18:03                                                         ` Eli Zaretskii
2019-07-06 12:16                                                           ` Lars Ingebrigtsen
2019-07-07 18:13                                                             ` Lars Ingebrigtsen
2019-07-07 18:18                                                               ` Eli Zaretskii
2019-07-08 16:38                                                                 ` Lars Ingebrigtsen
2020-08-03  6:00                                                                   ` Lars Ingebrigtsen
2019-07-05  8:21                                                     ` Eli Zaretskii
2019-07-05 13:13                                                       ` Lars Ingebrigtsen
2019-06-26 16:29                                       ` Eli Zaretskii
2018-02-19 18:37                       ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=834l4en63b.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=24201@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).