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: Fri, 16 Sep 2022 09:40:50 +0300 Message-ID: <83mtaz4ya5.fsf@gnu.org> References: <2b58b8f5429a6e3aecda@heytings.org> <834jx85tyv.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22550"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gregory@heytings.org, 57804@debbugs.gnu.org, larsi@gnus.org To: Paul Pogonyshev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 16 08:42:29 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 1oZ53V-0005hZ-5l for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Sep 2022 08:42:29 +0200 Original-Received: from localhost ([::1]:60946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZ53T-0006zP-M3 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Sep 2022 02:42:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZ536-0006yY-Ro for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 02:42:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42231) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZ534-0002NH-RB for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 02:42:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZ533-00027C-M5 for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 02:42:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 06:42:01 +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.16633104678067 (code B ref 57804); Fri, 16 Sep 2022 06:42:01 +0000 Original-Received: (at 57804) by debbugs.gnu.org; 16 Sep 2022 06:41:07 +0000 Original-Received: from localhost ([127.0.0.1]:41309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ52A-000262-Mh for submit@debbugs.gnu.org; Fri, 16 Sep 2022 02:41:07 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZ527-00025P-2o for 57804@debbugs.gnu.org; Fri, 16 Sep 2022 02:41:05 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50594) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZ521-0002DB-Nz; Fri, 16 Sep 2022 02:40:57 -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=2F/MpNvnPj55ygUKsGIAIbXCz16mYtIRfJOyQvsAi74=; b=jR1bdXLmoiKf k0EaC/Q1UMEGz6E5qjKPQcvpl63zUjmaePXMTl/XZh5kLMatOQYjA/kzgpvMdDbg8WWk9S9yFDsZK Bn7W5PeIxZfkRrkr7RlM48ktJXmNObWr9QJ0WVDzvJPi9kv713YBmWYlRNJvp85L/YVY1Wp68UuiW TfARR4FXiky6XJOWNqY8PTbq9Viva332BrDH25CsYme5oGrY/2acq9fokUHf6up8Bg3lfQ7mMFmY1 kqXuQZ0ea1gPYbsQZGi/+PVUc6TP/NKjsR8HHqBArIvAF0FjJqVwCyxxXphuzn7LATU31l5FK7UJg gmwQxocrDbTSYMR3BqyIGg==; Original-Received: from [87.69.77.57] (port=1157 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 1oZ521-00011Y-6R; Fri, 16 Sep 2022 02:40:57 -0400 In-Reply-To: (message from Paul Pogonyshev on Fri, 16 Sep 2022 00:53:37 +0200) 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:242698 Archived-At: > 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!