From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Peter Wang Newsgroups: gmane.emacs.bugs Subject: bug#25156: 26.0.50; `describe-text-properties' hangs with 100% cpu usage when property is a char-table Date: Sat, 10 Dec 2016 21:59:32 +0800 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1141b9a2b4690205434e4790 X-Trace: blaine.gmane.org 1481378548 3253 195.159.176.226 (10 Dec 2016 14:02:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 10 Dec 2016 14:02:28 +0000 (UTC) To: 25156@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 10 15:02:24 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFiEG-0007NG-7Y for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Dec 2016 15:02:20 +0100 Original-Received: from localhost ([::1]:51882 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFiEH-0001WD-2O for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Dec 2016 09:02:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFiE3-0001W5-JY for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2016 09:02:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFiDy-0000rj-HD for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2016 09:02:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49464) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cFiDy-0000rX-F7 for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2016 09:02:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cFiDy-0005V9-5q for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2016 09:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Peter Wang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Dec 2016 14:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25156 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.148137847121077 (code B ref -1); Sat, 10 Dec 2016 14:02:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Dec 2016 14:01:11 +0000 Original-Received: from localhost ([127.0.0.1]:36630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFiD8-0005Tr-3B for submit@debbugs.gnu.org; Sat, 10 Dec 2016 09:01:11 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55111) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFiD5-0005Tc-RP for submit@debbugs.gnu.org; Sat, 10 Dec 2016 09:01:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFiCz-0000Ns-RX for submit@debbugs.gnu.org; Sat, 10 Dec 2016 09:01:02 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:34695) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cFiCz-0000No-OY for submit@debbugs.gnu.org; Sat, 10 Dec 2016 09:01:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFiCy-0001EH-IR for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2016 09:01:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFiCt-0000LD-OK for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2016 09:01:00 -0500 Original-Received: from mail-oi0-f68.google.com ([209.85.218.68]:33812) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cFiCt-0000By-IA for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2016 09:00:55 -0500 Original-Received: by mail-oi0-f68.google.com with SMTP id m75so5727802oig.1 for ; Sat, 10 Dec 2016 06:00:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=RW4xGQ71HtufbkXhSeDJ+THcLENORaZZqA9o69oKNsY=; b=hY/QwcmtP/XjbW7fYBXVl9lVnDhJFf241TQGeyZpNu92C6qlR1Fd0CFtbg6/IlDj2y G8QM5d+f2v3wO/ErfLxQEDHeHI+DevAQsbF9wsqpVvXkK9pmNUbroZYFQnmD44d2Jlej 7aViJF7Y3xR5yuChSklCPf3RXB7vgkdpGXq4woqLLCEjerPXdAXmxksPPFKIXeOWsanv 5p9pc9q9D+n6wqEAoLZmYESF4H/KSnjJvXb9TYi9q5SJpb92X74lM7fcpv0wi/whsult OVAXyPsSf4Plq48Vh11d0EkSRJXgD7AfCKmzcDKuM89ez4VQ57WkQBD4Nhpi2zm2D6CK dETA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=RW4xGQ71HtufbkXhSeDJ+THcLENORaZZqA9o69oKNsY=; b=kmmUuRA4Dqy+yW2udRa6t6Bei9b1+QvWKslxnvU467pV1X924P1Mtpa9wbtQv4KDHS H523/9OccLMn19lUF6I7V6VwjPeGk+v9ieGeQusGhIqyGbp+8p38suuURhFNypnMc6/1 T1OP8X2c/049fmIpuJddCUqg8hczUdWfSXhLCyr52Jzi7Ry2PV94WocFKnkgWqxoYOl5 1z9oPUSJ8UWxFs9+V2U4ckmtF9KLRdgPxzxmJiTzZ7i0GTXi0MSC18v5qAEmveHTrxse B3ifUW7c2S0P4A40NN0bACx5CmvAVPq+k7DAZ5B0/cc9JhByWF8ruvxALAjxKhjYPPUA VlvA== X-Gm-Message-State: AKaTC01JAZFGaIjGJ6c0/QwJaTYybbMau5sydkVg0vhyL44/9omVuaz1WWicvuRh5MsRUfZhc78+6Ku0nhP5fA== X-Received: by 10.157.16.120 with SMTP id o53mr45118672oto.11.1481378373057; Sat, 10 Dec 2016 05:59:33 -0800 (PST) Original-Received: by 10.202.108.137 with HTTP; Sat, 10 Dec 2016 05:59:32 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: 208.118.235.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:126797 Archived-At: --001a1141b9a2b4690205434e4790 Content-Type: text/plain; charset=UTF-8 I came across the problem when I was using `C-u C-x =' on a SLIME presentation. After some debugging, I found out the cause of the problem. Here is it: In a slime REPL buffer, when the evaluation result is rendered, SLIME adds text properties using `slime-add-presentation-properties'. One of the text properties is a syntax-table `slime-presentation-syntax-table'. `C-u C-x =' calls `(describe-char (point))', which in turn calls `describe-text-properties', which hangs with 100% cpu usage. I think a possible fix could be done in `describe-property-list', adding a case in cond to handle the type of syntax-table, something like: diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 6c7983a177..926103f35e 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -90,6 +90,7 @@ describe-property-list 'type 'help-face 'help-args (list value))) ((widgetp value) (describe-text-widget value)) + ((syntax-table-p value) (insert "#")) (t (describe-text-sexp value)))) (insert "\n"))) --001a1141b9a2b4690205434e4790 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I came across the problem when I was using `C-u C-x = =3D' on a SLIME
presentation. After some debugging, I found o= ut the cause of the
problem. Here is it:

In a slime REPL buffer, when the evaluation result is rendered, SLIME
adds text properties using `slime-add-presentation-properties'. O= ne
of the text properties is a syntax-table `slime-presentation-s= yntax-table'.

`C-u C-x =3D' calls `(descri= be-char (point))', which in turn calls
`describe-text-propert= ies', which hangs with 100% cpu usage.

I think= a possible fix could be done in `describe-property-list', adding
=
a case in cond to handle the type of syntax-table, something like:


diff --git a/lisp/descr-text.el b/lisp= /descr-text.el
index 6c7983a177..926103f35e 100644
--- = a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -90,6 = +90,7 @@ describe-property-list
=C2=A0 =C2=A0 =C2=A0 =C2=A0'type = 'help-face 'help-args (list value)))
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0((widgetp value)
=C2=A0 =C2=A0 =C2=A0 (de= scribe-text-widget value))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0((syntax-table-p value) (insert "#<syntax table>"))
=C2=A0 =C2=A0 =C2=A0(t
=C2=A0 =C2=A0 =C2=A0 (describe-text-sexp = value))))
=C2=A0 =C2=A0 =C2=A0(insert "\n")))

--001a1141b9a2b4690205434e4790--