renzmann / treesit-auto

Automatic installation, usage, and fallback for tree-sitter major modes in Emacs 29
GNU General Public License v3.0
353 stars 27 forks source link

Running M-x treesit-auto-install-all eventually causes emacs to crash with a segementation fault #95

Open jawadcode opened 3 months ago

jawadcode commented 3 months ago

I thought I'd preface this with some information about my emacs setup:

I'm using the emacs-wayland package from the pacman extra repository, which is currently at version 29.3-2.

The build flags, as defined by system-configuration-options are:

--with-pgtk --with-native-compilation=aot --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib --with-tree-sitter --localstatedir=/var --with-cairo --disable-build-details --with-harfbuzz --with-libsystemd --with-modules 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/emacs/src=/usr/src/debug/emacs -flto=auto' 'LDFLAGS=-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now          -Wl,-z,pack-relative-relocs -flto=auto' 'CXXFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/emacs/src=/usr/src/debug/emacs -flto=auto

My configuration (using elpaca as the package manager, if that's relevant) is as follows:

(use-package treesit-auto
  :config (global-treesit-auto-mode))

This happened for the first time when running M-x treesit-auto-install with an org file open in another window, and also happens on any subsequent attempt to open a file.

I managed to capture the output of the command before emacs crashed:

2024-04-05T19:38:46,952835492+01:00

And this is the backtrace left by emacs in the terminal:

Fatal error 11: Segmentation fault
Backtrace:
emacs(+0x140096)[0x561bc4e4a096]
emacs(+0x20330)[0x561bc4d2a330]
emacs(+0x21153)[0x561bc4d2b153]
emacs(+0x29ad8d)[0x561bc4fa4d8d]
/usr/lib/libc.so.6(+0x3c770)[0x7bbc960fd770]
/home/qak/.config/emacs/tree-sitter/libtree-sitter-org.so(deserialize+0x1c)[0x7bbc84950687]
/home/qak/.config/emacs/tree-sitter/libtree-sitter-yaml.so(tree_sitter_yaml_external_scanner_create+0x31)[0x7bbc856bfd8b]
/usr/lib/libtree-sitter.so.0(ts_parser_set_language+0xda)[0x7bbc986b1aba]
emacs(+0x29b8b7)[0x561bc4fa58b7]
emacs(+0x2488c4)[0x561bc4f528c4]
emacs(+0x1b661e)[0x561bc4ec061e]
/usr/lib/emacs/29.3/native-lisp/29.3-4b59e32f/treesit-37439c61-97df641d.eln(F747265657369742d72656164792d70_treesit_ready_p_0+0x37c)[0x7bbc870f815c]
emacs(+0x1b661e)[0x561bc4ec061e]
/home/qak/.config/emacs/eln-cache/29.3-4b59e32f/treesit-auto-1c20a4e1-50ae776a.eln(F747265657369742d6175746f2d2d72656164792d70_treesit_auto__ready_p_0+0x11f)[0x7bbc871220af]
emacs(+0x1b661e)[0x561bc4ec061e]
/home/qak/.config/emacs/eln-cache/29.3-4b59e32f/treesit-auto-1c20a4e1-50ae776a.eln(F747265657369742d6175746f2d2d6275696c642d6d616a6f722d6d6f64652d72656d61702d616c697374_treesit_auto__build_major_mode_remap_alist_0+0xf9)[0x7bbc87122a19]
emacs(+0x1b661e)[0x561bc4ec061e]
/home/qak/.config/emacs/eln-cache/29.3-4b59e32f/treesit-auto-1c20a4e1-50ae776a.eln(F747265657369742d6175746f2d2d7365742d6d616a6f722d72656d6170_treesit_auto__set_major_remap_0+0x4f)[0x7bbc8712424f]
emacs(+0x1b661e)[0x561bc4ec061e]
emacs(+0x1b74a0)[0x561bc4ec14a0]
emacs(+0x2078be)[0x561bc4f118be]
emacs(+0x1b661e)[0x561bc4ec061e]
/usr/bin/../lib/emacs/29.3/native-lisp/29.3-4b59e32f/preloaded/files-1e8937b2-592f65e7.eln(F7365742d6175746f2d6d6f64652d2d6170706c792d616c697374_set_auto_mode__apply_alist_0+0x375)[0x7bbc91886015]
emacs(+0x1b661e)[0x561bc4ec061e]
/usr/bin/../lib/emacs/29.3/native-lisp/29.3-4b59e32f/preloaded/files-1e8937b2-592f65e7.eln(F7365742d6175746f2d6d6f6465_set_auto_mode_0+0xb77)[0x7bbc91887037]
emacs(+0x1b661e)[0x561bc4ec061e]
/usr/bin/../lib/emacs/29.3/native-lisp/29.3-4b59e32f/preloaded/files-1e8937b2-592f65e7.eln(F6e6f726d616c2d6d6f6465_normal_mode_0+0x36f)[0x7bbc9188573f]
emacs(+0x1b661e)[0x561bc4ec061e]
/usr/bin/../lib/emacs/29.3/native-lisp/29.3-4b59e32f/preloaded/files-1e8937b2-592f65e7.eln(F61667465722d66696e642d66696c65_after_find_file_0+0x191)[0x7bbc918849e1]
emacs(+0x1b661e)[0x561bc4ec061e]
/usr/bin/../lib/emacs/29.3/native-lisp/29.3-4b59e32f/preloaded/files-1e8937b2-592f65e7.eln(F66696e642d66696c652d6e6f73656c6563742d31_find_file_noselect_1_0+0x825)[0x7bbc918842a5]
emacs(+0x1b661e)[0x561bc4ec061e]
/usr/bin/../lib/emacs/29.3/native-lisp/29.3-4b59e32f/preloaded/files-1e8937b2-592f65e7.eln(F66696e642d66696c652d6e6f73656c656374_find_file_noselect_0+0x692)[0x7bbc91882b92]
emacs(+0x1b661e)[0x561bc4ec061e]
/usr/bin/../lib/emacs/29.3/native-lisp/29.3-4b59e32f/preloaded/files-1e8937b2-592f65e7.eln(F66696e642d66696c65_find_file_0+0x5d)[0x7bbc9188025d]
emacs(+0x1b661e)[0x561bc4ec061e]
/home/qak/.config/emacs/eln-cache/29.3-4b59e32f/counsel-95f6ae58-44a0e4f3.eln(F636f756e73656c2d66696e642d66696c652d616374696f6e_counsel_find_file_action_0+0x162)[0x7bbc86e26f32]
emacs(+0x1b661e)[0x561bc4ec061e]
/home/qak/.config/emacs/eln-cache/29.3-4b59e32f/ivy-e0023031-9dd606c0.eln(F6976792d63616c6c_ivy_call_0+0x34a)[0x7bbc86edd55a]
emacs(+0x1b661e)[0x561bc4ec061e]
/home/qak/.config/emacs/eln-cache/29.3-4b59e32f/ivy-e0023031-9dd606c0.eln(F6976792d72656164_ivy_read_0+0x16b7)[0x7bbc86ee3187]
...
fish: Job 1, 'emacs' terminated by signal SIGSEGV (Address boundary error)

Apologies if this is not the relevant place to file this issue, or if I've been too verbose, I'm fairly new to emacs and am setting it up from scratch.