From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#57804: An infinite loop in a `fontify-region' function causes Emacs to hang indefinitely Date: Thu, 15 Sep 2022 09:27:14 +0300 Message-ID: <831qsd17b1.fsf@gnu.org> References: <834jx93n4p.fsf@gnu.org> <87y1ul501n.fsf@gnus.org> <87wna5xlfw.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3398"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 57804@debbugs.gnu.org, pogonyshev@gmail.com To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 15 08:29:05 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYiMz-0000eV-AN for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Sep 2022 08:29:05 +0200 Original-Received: from localhost ([::1]:51638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYiMx-0003J2-Nd for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Sep 2022 02:29:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYiLy-0003Hp-Vs for bug-gnu-emacs@gnu.org; Thu, 15 Sep 2022 02:28:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39851) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oYiLy-00029r-Jh for bug-gnu-emacs@gnu.org; Thu, 15 Sep 2022 02:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oYiLy-0000Gp-7J for bug-gnu-emacs@gnu.org; Thu, 15 Sep 2022 02:28: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: Thu, 15 Sep 2022 06:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57804 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix Original-Received: via spool by 57804-submit@debbugs.gnu.org id=B57804.16632232581001 (code B ref 57804); Thu, 15 Sep 2022 06:28:02 +0000 Original-Received: (at 57804) by debbugs.gnu.org; 15 Sep 2022 06:27:38 +0000 Original-Received: from localhost ([127.0.0.1]:56783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYiLa-0000G5-0v for submit@debbugs.gnu.org; Thu, 15 Sep 2022 02:27:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYiLY-0000Fr-SI for 57804@debbugs.gnu.org; Thu, 15 Sep 2022 02:27:37 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47954) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYiLS-00027m-ES; Thu, 15 Sep 2022 02:27:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ZUzZYkqUgZbImsfVeTKE3O3HRR9P+ioyu/52L0maymc=; b=UieGRYHKv9PW 64NQvuaVxUKHDDHzXnaUipIWaysy4sk5eWCLzaLkuwveyuDJ31iJBfJu7SPAVOcXa7B0PTvzRPfnx BdejcsvswgI9AU85MqffI4ThT7S3B5KAgd+bpxWtQWhREjTnLV6VafI24QAXNPADsGNEMt1Wurhg6 KV8dmb+KVDWpa8ErCtD0eDJKk+4OGnKJTuR2QSSWGG33dM95/lExjlBLkb8ZJDGt0tcqEtdaoc9bF /+kqphEsZMo7Dv/IWaytKqSd2qdczjR4ZNfO7E77oye7DtlfC2MLz78A3+Dz0IRqvCICN99NeIeLA p0tDGZ8gysBcKCihEAS/WA==; Original-Received: from [87.69.77.57] (port=3993 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYiLM-0002qC-Th; Thu, 15 Sep 2022 02:27:30 -0400 In-Reply-To: <87wna5xlfw.fsf@yahoo.com> (message from Po Lu on Thu, 15 Sep 2022 13:20:51 +0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:242557 Archived-At: > From: Po Lu > Cc: Eli Zaretskii , 57804@debbugs.gnu.org, Paul Pogonyshev > > Date: Thu, 15 Sep 2022 13:20:51 +0800 > > Lars Ingebrigtsen writes: > > > Eli Zaretskii writes: > > > >> This case is exactly one of those which I think we shouldn't try to > >> fix, because it's the case of "buggy Lisp program", a.k.a. "don't do > >> that". There's no reason for any useful Lisp program to have an > >> infloop like this: > >> > >>> (while t > >>> "whoopsie") > > > > You've never accidentally put an infloop into a font locking function? > > Then you've been very lucky. > > > > We should definitely fix this is we can. > > Why isn't jit-lock-debug-mode an option? It definitely is, for the particular use case of debugging font-lock. So is running font-lock-fontify-buffer by hand. So is attaching a debugger when such an infloop is bumped into accidentally without expecting it. There's also the recently-added backtrace-on-redisplay-error feature, which could help with diagnosing such problems, perhaps combined with debug-on-entry or somesuch. IOW, I think we have already several useful tools available for the particular problem of debugging loops in font-lock, if we want to interpret this bug report in that narrow interpretation.