unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#66549: 29.1.50; SIGABRT received parsing file with tree-sitter in PGTK Emacs
@ 2023-10-14 20:19 Erik Overdahl
  2023-10-15  5:40 ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Erik Overdahl @ 2023-10-14 20:19 UTC (permalink / raw)
  To: 66549

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.





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

end of thread, other threads:[~2023-10-29 11:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-14 20:19 bug#66549: 29.1.50; SIGABRT received parsing file with tree-sitter in PGTK Emacs Erik Overdahl
2023-10-15  5:40 ` Eli Zaretskii
2023-10-15 18:36   ` Erik Overdahl
2023-10-15 19:12     ` Eli Zaretskii
2023-10-15 20:03       ` Erik Overdahl
2023-10-16 11:29         ` Eli Zaretskii
     [not found]           ` <CA+PiuB7EfnM9SG6syhNRGBAMvpr3BH_pgbLtdsU2usVpcvXxyw@mail.gmail.com>
2023-10-17  2:29             ` Eli Zaretskii
2023-10-17 21:24               ` Erik Overdahl
2023-10-18  2:30                 ` Eli Zaretskii
2023-10-29 11:28                   ` Eli Zaretskii
2023-10-15 19:31     ` Erik Overdahl
2023-10-16 11:22       ` Eli Zaretskii

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).