all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* tree-sitter crashes Emacs
@ 2024-04-25  6:58 Joost Kremers
  2024-04-26 14:53 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Joost Kremers @ 2024-04-25  6:58 UTC (permalink / raw)
  To: emacs-devel

Hi list,

A week ago or so, I opened a Python file in Emacs and saw Emacs crash hard.
Bisecting my init file, I found that the culprit was tree-sitter. As it turns
out, some change was made in tree-sitter that caused the ABI to change, and when
I upgraded my distro's tree-sitter package, the new ABI caused Emacs to crash.

There is a thread about this issue on the tree-sitter GitHub page:

https://github.com/tree-sitter/tree-sitter/issues/3296

The consensus there seems to be, however, that the current problem should not be
solved by the tree-sitter project, but rather by the relevant Linux
distributions and/or by Emacs itself.

A bug has been opened for Arch Linux (the distro I'm using):

https://gitlab.archlinux.org/archlinux/packaging/packages/emacs/-/issues/2

That issue, however, is labelled with "status:waiting-upstream", which suggests
that nothing's going to happen until the tree-sitter project does something.
Which is not going to happen, I fear, because the tree-sitter issue has been
closed.

Since I haven't seen the issue mentioned here and given that it was suggested it
might be an Emacs issue, I wanted to ask the opinion of the maintainers: can
this be considered an Emacs bug, or is it really something that should be solved
upstream?

TIA


-- 
Joost Kremers
Life has its moments



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: tree-sitter crashes Emacs
  2024-04-25  6:58 tree-sitter crashes Emacs Joost Kremers
@ 2024-04-26 14:53 ` Eli Zaretskii
  2024-04-28 12:48   ` Joost Kremers
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2024-04-26 14:53 UTC (permalink / raw)
  To: Joost Kremers; +Cc: emacs-devel

> From: Joost Kremers <joostkremers@fastmail.fm>
> Date: Thu, 25 Apr 2024 08:58:45 +0200
> 
> A week ago or so, I opened a Python file in Emacs and saw Emacs crash hard.
> Bisecting my init file, I found that the culprit was tree-sitter. As it turns
> out, some change was made in tree-sitter that caused the ABI to change, and when
> I upgraded my distro's tree-sitter package, the new ABI caused Emacs to crash.
> 
> There is a thread about this issue on the tree-sitter GitHub page:
> 
> https://github.com/tree-sitter/tree-sitter/issues/3296
> 
> The consensus there seems to be, however, that the current problem should not be
> solved by the tree-sitter project, but rather by the relevant Linux
> distributions and/or by Emacs itself.
> 
> A bug has been opened for Arch Linux (the distro I'm using):
> 
> https://gitlab.archlinux.org/archlinux/packaging/packages/emacs/-/issues/2
> 
> That issue, however, is labelled with "status:waiting-upstream", which suggests
> that nothing's going to happen until the tree-sitter project does something.
> Which is not going to happen, I fear, because the tree-sitter issue has been
> closed.
> 
> Since I haven't seen the issue mentioned here and given that it was suggested it
> might be an Emacs issue, I wanted to ask the opinion of the maintainers: can
> this be considered an Emacs bug, or is it really something that should be solved
> upstream?

We cannot do anything about this; see bug#70438.  The tree-sitter
developers changed the ABI without bumping up the ABI version.
Moreover, they think that's perfectly okay, since tree-sitter is
"still in version 0.x".  Because they didn't bump the ABI version,
Linux distros didn't bother to update Emacs they distribute, and the
result is crashes.

The only thing you can do is rebuild Emacs with the updated
tree-sitter (which is AFAIU the distros will do now , and will then
provide fixed packages), or downgrade your tree-sitter library to
version before the ABI change, 0.22.2.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: tree-sitter crashes Emacs
  2024-04-26 14:53 ` Eli Zaretskii
@ 2024-04-28 12:48   ` Joost Kremers
  2024-04-28 13:50     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Joost Kremers @ 2024-04-28 12:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Hi Eli,

Thanks for your reply. Luckily, Arch's Emacs package was updated today and the
problem is resolved.

On Fri, Apr 26 2024, Eli Zaretskii wrote:
> We cannot do anything about this; see bug#70438.

I tried searching the bugs list, but couldn't find anything. Guess my search-foo
is sub-par...

>  The tree-sitter
> developers changed the ABI without bumping up the ABI version.
> Moreover, they think that's perfectly okay, since tree-sitter is
> "still in version 0.x".  Because they didn't bump the ABI version,
> Linux distros didn't bother to update Emacs they distribute, and the
> result is crashes.

From what I understand reading the Github issue, it seems that the tree-sitter
devs are slowly starting to understand that this is not a good idea.


-- 
Joost Kremers
Life has its moments



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: tree-sitter crashes Emacs
  2024-04-28 12:48   ` Joost Kremers
@ 2024-04-28 13:50     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2024-04-28 13:50 UTC (permalink / raw)
  To: Joost Kremers; +Cc: emacs-devel

> From: Joost Kremers <joostkremers@fastmail.fm>
> Cc: emacs-devel@gnu.org
> Date: Sun, 28 Apr 2024 14:48:08 +0200
> 
> >  The tree-sitter
> > developers changed the ABI without bumping up the ABI version.
> > Moreover, they think that's perfectly okay, since tree-sitter is
> > "still in version 0.x".  Because they didn't bump the ABI version,
> > Linux distros didn't bother to update Emacs they distribute, and the
> > result is crashes.
> 
> >From what I understand reading the Github issue, it seems that the tree-sitter
> devs are slowly starting to understand that this is not a good idea.

I do hope that they will come around.  Because it's _definitely_ not a
good idea, for such a popular library.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-28 13:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25  6:58 tree-sitter crashes Emacs Joost Kremers
2024-04-26 14:53 ` Eli Zaretskii
2024-04-28 12:48   ` Joost Kremers
2024-04-28 13:50     ` Eli Zaretskii

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.