bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66549: 29.1.50; SIGABRT received parsing file with tree-sitter in PG


From: Erik Overdahl
Subject: bug#66549: 29.1.50; SIGABRT received parsing file with tree-sitter in PGTK Emacs
Date: Sat, 14 Oct 2023 15:19:46 -0500

Emacs is receiving a SIGABRT (Fatal Error 6) with error message
~munmap_chunk(): invalid pointer~ when parsing any file with the
tree-sitter-hcl grammar. The crash only occurs when Emacs is built with
PGTK.

I am not sure if this is a bug in the grammar or in Emacs itself.  The
fact that the bug only happens with a PGTK build of Emacs leads me to
believe that the bug is within Emacs. However, the crash does not occur
with the ~v1.1.0~ release of the grammar, and so the bug may lay in the
newly rewritten scanner added to the tree-sitter-hcl repo since that
release.

Full instructions for reproducing the crash can be found at
https://github.com/erik-overdahl/emacs-29-pgtk-ts-crash-bugreport

For a quick explanation in this bug report:

Build emacs with ./configure --with-tree-sitter --with-pgtk. Try to
parse any HashiCorp Configuraiton Language (HCL) file with the following
emacs lisp:

(require 'treesit)

(add-to-list 'treesit-language-source-alist
             '(hcl .
("https://github.com/MichaHoffmann/tree-sitter-hcl"; "main" "src")))

(treesit-install-language-grammar 'hcl)

(with-temp-buffer
  (insert-file-contents "example.hcl")
  ;; `treesit-parser-create' creates a parser for the buffer that is
  ;; then invoked lazily. Using `treesit-parse-string' to force parse.
  (treesit-parse-string (buffer-string) 'hcl))

The result in my Emacs is an immediate crash due to SIGABRT.

I am not including the usual environment information in this report as
I am using Doom Emacs and so the info is a huge amount of irrelevant
noise. Please see
https://github.com/erik-overdahl/emacs-29-pgtk-ts-crash-bugreport for
a minimal environment reproducing this bug.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]