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

From: Po Lu <luangruo <at> yahoo.com>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 59426 <at> debbugs.gnu.org
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
Date: Mon, 21 Nov 2022 14:40:47 +0800
Yuan Fu <casouri <at> gmail.com> writes:

> Emacs crashed on a very large C file when c-ts-mode is on, because
> the function building the imenu list tries to walk through the whole
> parse tree, and end up recusing ~10k times because of how deep the parse
> tree is. These recursive functions should have a built-in limit. Does
> Emacs already have some way to determined the max recursion limit on
> each system? Or should we come up with some hard-coded numbers?

We _used_ to have max-specpdl-size, which would act as a limit if the
recursion was surrounded by specbind.

But it was deleted in Emacs 29.  Maybe it should be brought back, for
this and other deeply recursive C functions?




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.