all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Wiegley <johnw@newartisans.com>
To: eliz@gnu.org
Cc: 30322@debbugs.gnu.org
Subject: bug#30322: Emacs 26 seems to have entered an infinite loop during GC on macOS
Date: Thu, 01 Feb 2018 12:09:59 -0800	[thread overview]
Message-ID: <1517515799.3889240.1256382320.18166E1D@webmail.messagingengine.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1251 bytes --]

Hi Eli,

I was writing an e-mail to a colleague today when my Emacs window completely froze up, taking 100% CPU constantly.  Since it's still in that state now, I decided to fire up the stochastic profiler to see what it's doing.  I've attached the screenshot.

It claims to be spending all its time in `lisp_align_free', behaving as if there's a CPU busy loop now taking place inside that function. Since very little time is being assigned to its callees, I believe an infinite loop has occurred here:

      int i = 0;
      bool aligned = busy;
      struct ablock **tem = &free_ablock;
      struct ablock *atop = &abase->blocks[aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1];

      while (*tem)
	{
	  if (*tem >= (struct ablock *) abase && *tem < atop)
	    {
	      i++;
	      *tem = (*tem)->x.next_free;
	    }
	  else
	    tem = &(*tem)->x.next_free;
	}

I would like to suggest that before entering this loop, we record the initial value of *tem, and if we encounter again (or if we encounter it again X number of times), we report a non-fatal error and exit this function.  That way I could save my work and restart Emacs.

I've noticed such a "lock up until I force quit" happening before, but it's very rare. Maybe a few times a year?

John

[-- Attachment #2: Screen Shot 2018-02-01 at 12.03.14 PM.png --]
[-- Type: image/png, Size: 1304254 bytes --]

             reply	other threads:[~2018-02-01 20:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01 20:09 John Wiegley [this message]
2019-10-09 21:33 ` bug#30322: Emacs 26 seems to have entered an infinite loop during GC on macOS Lars Ingebrigtsen
2020-08-16 16:49   ` Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=1517515799.3889240.1256382320.18166E1D@webmail.messagingengine.com \
    --to=johnw@newartisans.com \
    --cc=30322@debbugs.gnu.org \
    --cc=eliz@gnu.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.