From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.bugs Subject: bug#57804: An infinite loop in a `fontify-region' function causes Emacs to hang indefinitely Date: Wed, 14 Sep 2022 17:05:54 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000d613ca05e8a47723" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23246"; mail-complaints-to="usenet@ciao.gmane.io" To: 57804@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 14 17:07:11 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 1oYTyn-0005sk-Vt for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Sep 2022 17:07:10 +0200 Original-Received: from localhost ([::1]:33552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYTyn-00088Y-2M for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Sep 2022 11:07:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYTyg-00088M-Dv for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2022 11:07:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38833) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oYTyg-0002eh-6E for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2022 11:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oYTyg-0000gj-0R for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2022 11:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Sep 2022 15:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57804 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16631679722577 (code B ref -1); Wed, 14 Sep 2022 15:07:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Sep 2022 15:06:12 +0000 Original-Received: from localhost ([127.0.0.1]:55765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYTxs-0000fU-1Q for submit@debbugs.gnu.org; Wed, 14 Sep 2022 11:06:12 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:43330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYTxq-0000fN-RN for submit@debbugs.gnu.org; Wed, 14 Sep 2022 11:06:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYTxq-00082T-BL for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2022 11:06:10 -0400 Original-Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]:41474) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oYTxo-0002ZC-GG for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2022 11:06:10 -0400 Original-Received: by mail-ej1-x636.google.com with SMTP id gh9so35448138ejc.8 for ; Wed, 14 Sep 2022 08:06:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=HfX8oxoz4YK2qJagf1k2ham4M5gdQOD71eP6x7j3nHQ=; b=CGmUftvrxLP1X9x0urz01Ymah8VOhH1LOl6L8o1ubNRg0zpW6TdYQ3J7X/j+Bmtre3 Er4X2qE1PHg75x8ynovSnjFFFq6QvwHVWid9WYtxDv+bWJt0hIaz9REt1B8+SVWrUENF 21kTrLct5eylAlUg2SnvB869oPZyhfJlGgLCb69t3cXouCjvZM/AZvizD4yJyhkgkmqF M69MrGKB9QJjaowKlmOsPAkt/JU65tQlcN4nRFIgK0eZl6suvT5USg/8pkl3BvIgT1sK gHqokwBOQ7SgfpQdM80Ict/m9TPR7o8FiVYtn6ycIcLyfiCmlsm7AV71dlCMFtFUiB1M Sung== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=HfX8oxoz4YK2qJagf1k2ham4M5gdQOD71eP6x7j3nHQ=; b=dsW/w7HbZpkLLJjPfZYkkE8ms40esSEDrLRYjwaUWZ4Wt3F6cK13khZNsjdjayh20B dEbHK08pWDgjx0UlQZRiACMsoZbaGjj9Wq3SDZy+4zLQ1/mAmQZAyGFn5zmBpRpmzoEi GSe03VeWzIvLZOEjPLIBlGNW0zGcV9ivFz6acD01WzRZaqOKO3/ehM2oLGgvQBkbh++N +UTPRIOQUWEbmbAYDBZOx2QNGGehWUT5P5ShZk3tjrra+P5gGk4fhDPTJn6RQjToraL+ XupGjbFOQfYMCJBWr5dm6GgmysJ8iC3h9E40M+o+TsdP1t8PfGyA0MTZtjewIbi8Wm9b oQmg== X-Gm-Message-State: ACgBeo0jJCUgtjEhevjHZFAfLkwhP3xIMw8CPw6buy57QBunIPPTbF8f Uy3z12IYE65GsgEysBP4sK00vyLd37xNmgTm6QVEKalyYw== X-Google-Smtp-Source: AA6agR4EcbrkSB87NITkaBAz5UHLolXeq35e9nvN5zx7nhG3SgjPu399/p17tLI+AmiQ/xbdz0wLgzNJ6k3udx7fj7A= X-Received: by 2002:a17:906:fe09:b0:77a:52b3:da5d with SMTP id wy9-20020a170906fe0900b0077a52b3da5dmr16866687ejb.57.1663167966338; Wed, 14 Sep 2022 08:06:06 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=pogonyshev@gmail.com; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:242480 Archived-At: --000000000000d613ca05e8a47723 Content-Type: multipart/alternative; boundary="000000000000d613c705e8a47721" --000000000000d613c705e8a47721 Content-Type: text/plain; charset="UTF-8" To reproduce, save the attachment as `font-lock-hangs.el' and execute: $ emacs -Q -l font-lock-hangs.el C-g doesn't help anymore. The only thing you can do is to kill and start Emacs anew. Git commit fd1ee05977. To quote a discussion from another bug, the reply is from Eli Zaretski: > > By the way, it would really be nice if Emacs could do something about hangs irrespective of what causes > > that. Even if Elisp code is buggy, Emacs itself should never allow it to fall into an infinite loop and stop > > responding to C-g, leaving full restart as the only way out. > > I think that's impossible in general, unless we restrict what Lisp > programs can do. Every programming language can be used to write a > buggy program. > > However, it should be possible to prevent some cases of such > problematic behavior, certainly so when the infloop is caused by our > bug. But for that we need to know the details of the specific case in > order to investigate. Paul --000000000000d613c705e8a47721 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
To reproduce, save the attachment as `font-lock-hangs= .el' and execute:

=C2=A0 =C2=A0 $ emacs -Q -l = font-lock-hangs.el

C-g doesn't help anymore. The on= ly thing you can do is to kill and start Emacs anew.

Git= commit=C2=A0fd1ee05977.

To quote a discussion fro= m another bug, the reply is from Eli Zaretski:

>= ; > By the way, it would really be nice if Emacs could do something abou= t hangs irrespective of what causes
> > that. Even if Elisp code i= s buggy, Emacs itself should never allow it to fall into an infinite loop a= nd stop
> > responding to C-g, leaving full restart as the only wa= y out.
>
> I think that's impossible in general, unless we= restrict what Lisp
> programs can do.=C2=A0 Every programming langua= ge can be used to write a
> buggy program.
>
> However, = it should be possible to prevent some cases of such
> problematic beh= avior, certainly so when the infloop is caused by our
> bug.=C2=A0 Bu= t for that we need to know the details of the specific case in
> orde= r to investigate.

Paul
--000000000000d613c705e8a47721-- --000000000000d613ca05e8a47723 Content-Type: text/x-emacs-lisp; charset="US-ASCII"; name="font-lock-hangs.el" Content-Disposition: attachment; filename="font-lock-hangs.el" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l81r98p00 KGRlZmluZS1kZXJpdmVkLW1vZGUgYnVnZ3ktbW9kZSBuaWwgImJ1Z2d5IgogIChzZXRmIGZvbnQt bG9jay1kZWZhdWx0cyAnKG5pbCBuaWwgdCBuaWwgKGZvbnQtbG9jay1mb250aWZ5LXJlZ2lvbi1m dW5jdGlvbiAuIGJ1Z2d5LWZvbnRpZmllcikpKQogIChmb250LWxvY2stbW9kZSAxKSkKCihkZWZ1 biBidWdneS1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