GNU bug report logs - #59426
29.0.50; [tree-sitter] Some functions exceed maximum recursion limit

Previous Next

Package: emacs;

Reported by: Yuan Fu <casouri <at> gmail.com>

Date: Mon, 21 Nov 2022 00:54:02 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #104 received at 59426 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Po Lu <luangruo <at> yahoo.com>,
 Mattias EngdegÄrd <mattiase <at> acm.org>,
 Stefan Kangas <stefankangas <at> gmail.com>, 59426 <at> debbugs.gnu.org
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
Date: Sat, 26 Nov 2022 18:36:45 -0800

> On Nov 24, 2022, at 11:28 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: Yuan Fu <casouri <at> gmail.com>
>> Date: Thu, 24 Nov 2022 11:25:58 -0800
>> Cc: Eli Zaretskii <eliz <at> gnu.org>,
>> Po Lu <luangruo <at> yahoo.com>,
>> Stefan Kangas <stefankangas <at> gmail.com>,
>> 59426 <at> debbugs.gnu.org
>> 
>> That brings us back to the original question: what limit should we use? I suggest we use a smaller number since normal tree should never be very tall. Running the following code tells me the height of the tree for xdisp.c is 30:
>> 
>> (defun measure-height (node)
>>  (let ((children (treesit-node-children node t)))
>>    (if children
>>        (1+ (apply #'max (mapcar #'measure-height children)))
>>      1)))
>> ;; In xdisp.c:
>> (measure-height (treesit-buffer-root-node))
>> 
>> Maybe a limit in the range of hundreds or thousands? 800?
> 
> I suggest 1000.

Ok, I added the default limit in cc086f37e89.

Yuan



This bug report was last modified 2 years and 174 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.