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: Fri, 16 Sep 2022 12:08:49 +0200 Message-ID: References: <2b58b8f5429a6e3aecda@heytings.org> <834jx85tyv.fsf@gnu.org> <83mtaz4ya5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001b189305e8c88d35" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31602"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gregory Heytings , 57804@debbugs.gnu.org, Lars Ingebrigtsen To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 16 12:11:38 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 1oZ8Jt-00086U-Rz for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Sep 2022 12:11:37 +0200 Original-Received: from localhost ([::1]:34054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZ8Js-0005vO-P1 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Sep 2022 06:11:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZ8IU-0004cG-1W for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 06:10:11 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42694) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZ8IM-0005jC-U2 for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 06:10:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZ8IM-0003ca-Oi for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 06:10: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: Fri, 16 Sep 2022 10:10: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.166332296013859 (code B ref 57804); Fri, 16 Sep 2022 10:10:02 +0000 Original-Received: (at 57804) by debbugs.gnu.org; 16 Sep 2022 10:09:20 +0000 Original-Received: from localhost ([127.0.0.1]:41771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ8Hg-0003bR-FR for submit@debbugs.gnu.org; Fri, 16 Sep 2022 06:09:20 -0400 Original-Received: from mail-ot1-f47.google.com ([209.85.210.47]:45973) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ8HT-0003aq-IY for 57804@debbugs.gnu.org; Fri, 16 Sep 2022 06:09:19 -0400 Original-Received: by mail-ot1-f47.google.com with SMTP id ck2-20020a056830648200b0065603aef276so9073399otb.12 for <57804@debbugs.gnu.org>; Fri, 16 Sep 2022 03:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=QpoUcYvgHH2iwW2stExvD/Zi3tv8gP57v46U+Ymp4ic=; b=aUZ4gKOpId2LDcWR3oSKsSH8cDD3FsAoB1SUQOezFHrVmD7xvCw/fNP+l0wTDFeB5x 69/4u2lD0q52H1AWzgwaTGnOYVLrmOcaPPLk6guEEyDdXHkUwu+wmyi576g3/7fMTMpV XkLYLjjEJQQWBoT/cQOByhRRU7glrSQkEqPR1fewhkaSb/C5tIl20c8Y66esqKiW+oB+ pS0K0sc4NGI0iYrMDBArGgAHrh7Yif0FtBoaH93h+VMbAIKp5QrW7/We9T/1IVkjfAQF ixa3CnkGqq703pNBkeQJbyaYytKDdFNBCT/ec5k35O2caQmEv0O8aKpvKZSMNLt+d9dU boUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=QpoUcYvgHH2iwW2stExvD/Zi3tv8gP57v46U+Ymp4ic=; b=Bh0/8FNnQRr6c43Mu50+6DFt5OF57554jjB9AIiuB1xoWQQMRqYOzpnjZpwB/BrytC MgxEpqGhQVCLhnFvmn4ojAQpQ2EZKYt0WOx9zGrksl2twsz5qLIB8IqARJgKTcX3e6Ew QgBVywDnuFRgY6qIJIqCPvUjMPv6rcihe+58P4AnhJOH32ACsm8+4Cz/xIfO2O2Nd9Db bLQiWf1xkOtRDW7wM6cGvHuZZzQKXJpnj5BEMdXRwKM2lxIMtbxQgV2LABPQQD7B2wu5 IIGZz4ocuuhhqoxCsS3goayqDDc3S+acbvziKVoaDAcSt3jYuXRrvuEogGW/jQRGjV5p S1tQ== X-Gm-Message-State: ACrzQf1Emy7eo4SEL2CdhfbxkLhsF+YJLLt00La1zOttu8k1DGvpkSdU r7pn6h3YFaTwOWZ4n8tbRkUc5VQ+uhpJNINCGQ== X-Google-Smtp-Source: AMsMyM6qAiibOtRNCslq6z0o01yhkzEjzBi18p4DfTgn0qxTshQq0xc5oajid8gIdz/7WIe7S/sDjtuhAIEeXkLsRY8= X-Received: by 2002:a9d:2c3:0:b0:638:d57d:2250 with SMTP id 61-20020a9d02c3000000b00638d57d2250mr1881479otl.143.1663322942018; Fri, 16 Sep 2022 03:09:02 -0700 (PDT) In-Reply-To: <83mtaz4ya5.fsf@gnu.org> 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:242726 Archived-At: --0000000000001b189305e8c88d35 Content-Type: text/plain; charset="UTF-8" I give up. Do as you like. Paul On Fri, 16 Sept 2022 at 08:40, Eli Zaretskii wrote: > > From: Paul Pogonyshev > > Date: Fri, 16 Sep 2022 00:53:37 +0200 > > Cc: Eli Zaretskii , 57804@debbugs.gnu.org, Lars > Ingebrigtsen > > > > > It is for example possible to parse the buffer outside of > > > fontification-functions > > > > You are ignoring that this is not only about fontification. It can > > happen anywhere, because I may need full access to the buffer at any > > time. > > Your mode is requested to be able to run in some kind of "simplified > mode" when long-line-threshold is exceeded, in a way that doesn't > require such full access. > > > > Yet another method would be to use a simpler fontification method in > > > buffers with too long lines. Yet another method would be to turn > > > font locking off in buffers with too long lines. > > > > I don't want to lose fontification in a 10 MB buffer because one line > > somewhere there is over 10000 characters. > > The locked restriction leaves accessible a region of the buffer that > is quite large. So if you are fontifying a line that is not very long > in such a buffer, you should still be able to access enough text > before and after the window to be able to fontify. It is expected > that modes which need to access more than that will be amended to > perform, perhaps sub-optimally, in such cases. In extreme cases, you > can simply not fontify if there's no reasonable way of fontifying even > approximately. (I don't believe such extreme measures should be > necessary, but they are a possibility.) > > IOW, we fully expect that in some cases and with some features, there > will be partial loss of functionality in these cases. We consider > that still much better than a locked-up Emacs that can only be killed. > > > Security against what, for fuck's sake? > > Language! > --0000000000001b189305e8c88d35 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I give up. Do as you like.

Paul

On= Fri, 16 Sept 2022 at 08:40, Eli Zaretskii <eliz@gnu.org> wrote:
> From: Paul Pogonyshev <pogonyshev@gmail.com>
> Date: Fri, 16 Sep 2022 00:53:37 +0200
> Cc: Eli Zaretskii <eliz@gnu.org>, 57804@debbugs.gnu.org, Lars Ingebrigtsen <larsi@gnus.org>
>
> > It is for example possible to parse the buffer outside of
> > fontification-functions
>
> You are ignoring that this is not only about fontification. It can
> happen anywhere, because I may need full access to the buffer at any > time.

Your mode is requested to be able to run in some kind of "simplified mode" when long-line-threshold is exceeded, in a way that doesn't<= br> require such full access.

> > Yet another method would be to use a simpler fontification method= in
> > buffers with too long lines.=C2=A0 Yet another method would be to= turn
> > font locking off in buffers with too long lines.
>
> I don't want to lose fontification in a 10 MB buffer because one l= ine
> somewhere there is over 10000 characters.

The locked restriction leaves accessible a region of the buffer that
is quite large.=C2=A0 So if you are fontifying a line that is not very long=
in such a buffer, you should still be able to access enough text
before and after the window to be able to fontify.=C2=A0 It is expected
that modes which need to access more than that will be amended to
perform, perhaps sub-optimally, in such cases.=C2=A0 In extreme cases, you<= br> can simply not fontify if there's no reasonable way of fontifying even<= br> approximately.=C2=A0 (I don't believe such extreme measures should be necessary, but they are a possibility.)

IOW, we fully expect that in some cases and with some features, there
will be partial loss of functionality in these cases.=C2=A0 We consider
that still much better than a locked-up Emacs that can only be killed.

> Security against what, for fuck's sake?

Language!
--0000000000001b189305e8c88d35--