Subject: bug#71679: 29.3; treesit-node-child function chokes and crashes emacs for nodes with large number of child nodes

From: Eli Zaretskii <[email-masked]>
Date: Thu, 20 Jun 2024 22:10:14 +0300

> From: Mauritz Stenek <[email-masked]>
> Cc: [email-masked]
> Date: Thu, 20 Jun 2024 13:05:03 -0600
> 
> On 2024-06-20 at 12:35, Eli Zaretskii <[email-masked]> wrote:
> 
> > Start Emacs from GDB, run your recipe, and when it crashes and 
> > GDB
> > kicks in, type
> >
> >   (gdb) thread apply all bt
> >
> > and post here everything GDB displays as result.
> 
> I'm doing this:
> 
>     $ gdb -i=mi -p 238975 # the pid of `emacs -q`
> 
> but it freezes Emacs and I can't do anything with it.

You need to say "continue" to let Emacs continue running after you
attach the debugger.

> Is this how you "Start Emacs from GDB"?

No, I usually start GDB first:

  $ gdb ./emacs
  ...
  (gdb) run -Q

But your way should also work, if you say "continue" after attaching
GDB.  And don't use -i=mi, since the MI interface is for another
program to drive GDB, it is not convenient for humans.