all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 71012@debbugs.gnu.org, Helmut Eller <eller.helmut@gmail.com>
Subject: bug#71012: 30.0.50; tree-sitter crash
Date: Tue, 28 May 2024 22:15:05 -0700	[thread overview]
Message-ID: <FC18A048-3DE1-4C54-9ECC-91DB50280F11@gmail.com> (raw)
In-Reply-To: <6F195712-81CE-4C75-8983-D1D909646CAC@gmail.com>



> On May 27, 2024, at 3:10 PM, Yuan Fu <casouri@gmail.com> wrote:
> 
> 
> 
>> On May 17, 2024, at 11:07 PM, Yuan Fu <casouri@gmail.com> wrote:
>> 
>> 
>> 
>>> On May 17, 2024, at 8:29 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>>> 
>>>> From: Helmut Eller <eller.helmut@gmail.com>
>>>> Date: Fri, 17 May 2024 15:39:27 +0200
>>>> 
>>>> The code in the attached file tries to parse src/lisp.h but crashes
>>>> while printing the result:  emacs --batch -l ts-bug.el
>>> 
>>> Yuan, can you help, please?
>>> 
>>> Btw, why do you use treesit-parse-string?  The Emacs integration with
>>> tree-sitter can parse a buffer without making a string from its
>>> contents.
>> 
>> Yep, I’ll look into it.
>> 
>> Yuan
> 
> Just an update, I didn’t forget about this. If I didn’t reply back today, I will in a few days :-)
> 
> Yuan

From what I can gather, the crash seems to be because the temp buffer is garbage collected—the inserted lisp.h is a large file, so the temp buffer is probably immediately collected, before Emacs tries to print the node in the next line. I replaced the insert-file-content with some smaller file and it didn’t crash.

But that theory has critical flaws: a) Emacs certainly doesn't collect the temp buffer before the with-temp-buffer form returns; b) I can’t crash Emacs in my non-debug build by inserting (garbage-collect) in front of the message line in the example; c) debug build Emacs still crashes even if I enlarge gc-cons-threshold.

Eli, is there anything different regarding temp buffers in debug builds?

Yuan






  reply	other threads:[~2024-05-29  5:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17 13:39 bug#71012: 30.0.50; tree-sitter crash Helmut Eller
2024-05-17 15:29 ` Eli Zaretskii
2024-05-17 15:34   ` Helmut Eller
2024-05-17 16:00     ` Eli Zaretskii
2024-05-18  6:07   ` Yuan Fu
2024-05-27 22:10     ` Yuan Fu
2024-05-29  5:15       ` Yuan Fu [this message]
2024-05-29 12:28         ` Eli Zaretskii
2024-06-01 17:15           ` Yuan Fu
2024-06-01 17:43             ` Yuan Fu
2024-06-06  5:31               ` Yuan Fu
2024-06-07  8:39                 ` Basil L. Contovounesios
2024-06-10  8:12                   ` Basil L. Contovounesios
2024-06-10 18:25                     ` Eli Zaretskii
2024-06-12  5:38                       ` Yuan Fu
2024-06-12  5:38                   ` Yuan Fu
2024-06-13 11:43                     ` Basil L. Contovounesios
2024-06-13 11:53                       ` Basil L. Contovounesios

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FC18A048-3DE1-4C54-9ECC-91DB50280F11@gmail.com \
    --to=casouri@gmail.com \
    --cc=71012@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=eller.helmut@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.