From: Felix via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Yuan Fu <casouri@gmail.com>, 70059@debbugs.gnu.org
Subject: bug#70059: 30.0.50; c-ts-mode crashes emacs
Date: Wed, 17 Apr 2024 15:13:30 +0200 [thread overview]
Message-ID: <87zftsnnd1.fsf@web.de> (raw)
In-Reply-To: <868r1oytlt.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 08 Apr 2024 14:35:58 +0300")
I think this problem posted on reddit might be related to this issue:
https://www.reddit.com/r/emacs/comments/1c3wpbt/emacs_crashes_with_treesitter_update/
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Sun, 7 Apr 2024 23:32:01 -0700
>> Cc: Felix <felix.dick@web.de>,
>> 70059@debbugs.gnu.org
>>
>> > On Apr 2, 2024, at 11:34 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> >
>> >> I mean tree-sitter (the library) runs in the main thread, if it triggers a segfault, AFAIK Emacs currently can’t really do anything. Is that right Eli?
>> >
>> > You are right. But these crashes seem to be inside GC, which
>> > processes our objects, so if tree-sitter somehow causes us to create
>> > invalid Lisp objects, it's our fault, at least to some extent.
>>
>> If the crash happens in ts_node_delete, ts_parser_delete or
>> ts_tree_delete, would the backtrace record that? (Given that the
>> tree-sitter library probably isn’g compile with symbols.) If the
>> crash happens in those functions I think it’s not our fault.
>
> Even if tree-sitter was not compiled with debug symbols, we'd see the
> library name in the backtrace. Like here:
>
> #14 0x0000723f608fd770 in <signal handler called> () at /usr/lib/libc.so.6
> #15 0x000062534d063429 in process_mark_stack ()
> #16 0x000062534d1649f1 in traverse_intervals_noorder ()
> #17 0x000062534d063e5e in process_mark_stack ()
> #18 0x000062534d063ceb in process_mark_stack ()
> #19 0x000062534d063ceb in process_mark_stack ()
> #20 0x000062534d064fab in mark_char_table ()
> #21 0x000062534d0650f6 in mark_char_table ()
>
> As you see, the fact that the crash happened in libc is shown, even
> though we have no symbols for libc.
>
> Looking at the two backtraces posted in this bug, I see that each time
> the crashes were while processing some char-table. I don't think
> treesit-related code manipulates char-table's, does it? So I don't
> think treesit-related code is to blame here, it just so happened that
> calling treesit-pattern-expand triggered GC; the invalid object was
> probably created by some unrelated code.
next prev parent reply other threads:[~2024-04-17 13:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-28 20:36 bug#70059: 30.0.50; c-ts-mode crashes emacs Felix via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-29 5:39 ` Eli Zaretskii
2024-03-29 10:51 ` Felix via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-29 11:25 ` Eli Zaretskii
2024-03-29 11:37 ` Felix via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-29 12:08 ` Eli Zaretskii
2024-03-31 5:52 ` Yuan Fu
2024-03-31 7:43 ` Eli Zaretskii
2024-04-02 18:20 ` Yuan Fu
2024-03-31 8:09 ` Felix via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-02 18:22 ` Yuan Fu
2024-04-02 18:34 ` Eli Zaretskii
2024-04-08 6:32 ` Yuan Fu
2024-04-08 11:35 ` Eli Zaretskii
2024-04-17 13:13 ` Felix via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-04-17 13:18 ` Eli Zaretskii
2024-03-30 14:29 ` Andrea Corallo
2024-03-30 11:26 ` Andrea Corallo
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zftsnnd1.fsf@web.de \
--to=bug-gnu-emacs@gnu.org \
--cc=70059@debbugs.gnu.org \
--cc=casouri@gmail.com \
--cc=eliz@gnu.org \
--cc=felix.dick@web.de \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).