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 #83 received at 59426 <at> debbugs.gnu.org (full text, mbox):

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

> On Nov 23, 2022, at 2:40 AM, Mattias Engdegård <mattiase <at> acm.org> wrote:
> 
> 23 nov. 2022 kl. 00.19 skrev Yuan Fu <casouri <at> gmail.com>:
> 
>> It’s a machine generated file with syntax that tree-sitter-c can’t handle very well. The file is from bug#45248.
> 
> If you mean https://gitlab.com/wireshark/wireshark/-/raw/master/epan/dissectors/packet-rrc.c, then the parse tree would certainly be wide but not at all tall as far as I can tell. There is a fairly long array initialiser in there, but I've seen worse -- and it shouldn't be treated recursively, should it?

It shouldn’t, but tree-sitter thinks some closing brackets are erroneous and skips them when parsing (it skips erroneous tokens in the hope to parse the rest of the file despite local errors). So a 10k wide tree becomes 10k tall.

We can submit a bug repot to tree-sitter-c (“maybe don’t skip closing brackets even there is error, or somthing”), but that’s another story.

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.