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: Sun, 15 Oct 2023 13:36:26 -0500

The reproduction instructions included in my bug report are all that
is required. The linked GitHub repo contains Dockerfiles that allow
the bug to be reproduced exactly, but does not have any information
that is missing from this bug report.

Here is a minimal HCL file that I can confirm causes the SIGABRT when parsed:

resource "example" "literals" {
  attr1 = "val1"
}

Here is the output of the build and configuration from the most
minimal environment in which I reproduced the crash:

In GNU Emacs 29.1.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.17.8) of 2023-10-15 built on 904443610a26
Repository revision: 07c45f20fd3828548d5f0c110034e9857a94ccaf
Repository branch: emacs-29
System Description: Fedora Linux 38 (Container Image)

Configured using:
 'configure --with-tree-sitter --with-pgtk CFLAGS=-g'

Configured features:
CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBSELINUX
LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PGTK PNG SECCOMP SOUND THREADS
TIFF TOOLKIT_SCROLL_BARS TREE_SITTER XIM GTK3 ZLIB

Important settings:
  locale-coding-system: nil

Major mode:

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow emacsbug message mailcap yank-media puny dired dired-loaddefs
rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config
gnus-util text-property-search time-date subr-x mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
print-emacs-info treesit cl-seq cl-loaddefs cl-lib rmc iso-transl
tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win
term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer
select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads
dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk pgtk multi-tty make-network-process
emacs)

Memory information:
((conses 16 33150 6495)
 (symbols 48 4828 0)
 (strings 32 12214 589)
 (string-bytes 1 358015)
 (vectors 16 6670)
 (vector-slots 8 90660 16834)
 (floats 8 21 39)
 (intervals 56 4 11)
 (buffers 984 7))

The libtree-sitter version is 0.20.8

I will provide a full GDB backtrace in the next message. The linked
GitHub repo also provides an environment with which to debug the
crash.




On 10/15/23, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Erik Overdahl <erik.overdahl@gmail.com>
>> 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
>
> Please repeat them here, so that this report is complete.
>
> Please also post the details of your build and configuration as
> collected by "M-x report-emacs-bug".
>
> Last but not least, please post here the full GDB backtrace from the
> abort.  Without the backtrace it is very hard to start reasoning about
> the causes of this bug.
>
> Thanks.
>


-- 
Erik Overdahl
St. Olaf class of 2018
B.A. Economics and Mathematics with Statistics concentration





reply via email to

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