From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Erik Overdahl Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <83bkd0qw8j.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15004"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66549@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 16 00:32:11 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qs9eb-0003g9-E7 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Oct 2023 00:32:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qs9e7-0004lY-DI; Sun, 15 Oct 2023 18:31:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qs9e5-0004ky-Uy for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 18:31:37 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qs9e5-0005nV-NL for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 18:31:37 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qs9eU-00028X-43 for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 18:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Erik Overdahl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Oct 2023 22:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66549 X-GNU-PR-Package: emacs Original-Received: via spool by 66549-submit@debbugs.gnu.org id=B66549.16974090868121 (code B ref 66549); Sun, 15 Oct 2023 22:32:02 +0000 Original-Received: (at 66549) by debbugs.gnu.org; 15 Oct 2023 22:31:26 +0000 Original-Received: from localhost ([127.0.0.1]:54571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qs9dt-00026t-Kf for submit@debbugs.gnu.org; Sun, 15 Oct 2023 18:31:26 -0400 Original-Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]:50229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qs5z0-0000BL-22 for 66549@debbugs.gnu.org; Sun, 15 Oct 2023 14:36:58 -0400 Original-Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-1c0fcbf7ae4so2735880fac.0 for <66549@debbugs.gnu.org>; Sun, 15 Oct 2023 11:36:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697394988; x=1697999788; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bY4w2t8Hdf5PusKOZktSdBNn5P1LfGh+BEWPa+ANjWc=; b=EZ4pw2mTvG91bIzOCW3oJ//OGd2awTFgNJPrw9NUGr/b1q8+k7hfL+8BvzfTOw/+t7 oZwYOVxb4VNbL64nW0hdciUY8z0LCZdUV/QNnBoSScuTg55epENMMTmFF2W9PvLTWajf hmNQ1YAWKnoGPfZtih1IstlSANJZLz4hLjIECz+Xus0uxujFaE0KH6J5LHd7czBKXN6O c6+jzJ7WY2TdNtTej1AXR7c/uKe6dge4JduS/Q77GhqNMLWw8rq2ECH9SVm5Vvj2yo13 cazSqMLG+o8sTKMVwyy1okUVzRpIfX188ZW+LqRStbIJvW/ZkytlcGDh/+X0xDKl4uwN ytcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697394988; x=1697999788; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bY4w2t8Hdf5PusKOZktSdBNn5P1LfGh+BEWPa+ANjWc=; b=rOqRQYB6g7SywaSPmadMHyyz2avd+PhjA7IkvDxe2QuqZpOdr4zM9POK+plqmsKSxN yzigEg8i5vD41kJlOn1TRZdWDBoXjquNjHVMjWr97t4YKhDv5CElFobxXf0+vKcjXHJJ 4C+NFf57GPLlVo815RoCvs7DVuP6waeIOhAdzj23IWWTtRzGITLlDB682ScR1gil6bl8 oebw+DG4jASbgCxLC1UVKElGMBQalFvWbu6WfWUg8zkl0luRV6OjWx9Ej1uUa5qMqr3W kAQPP0ySzyuwMXpVf/ca/lTNSEuv+8OJ3AiAbTJNssBfRzoi0Eeq/AkB0xMzrPYj5SV8 doCQ== X-Gm-Message-State: AOJu0YyU3+uQqouB80Nz9lFgARFgtrsPUV7H77Q750agYCdbzE9luImc VaH5ufxY3S4W6ZaLlu77+9/0uS3O96x8u8qJ9RI= X-Google-Smtp-Source: AGHT+IE54vhzQzKOiitfxAHMKOsuEirLDfJ6ZQc8g7KcZGY7N849pyG/E3Zis/c2N5TgIe0gzowthiaqpPbFFx0uU2Y= X-Received: by 2002:a05:6870:11c5:b0:1ea:4338:20b9 with SMTP id 5-20020a05687011c500b001ea433820b9mr1089972oav.29.1697394987699; Sun, 15 Oct 2023 11:36:27 -0700 (PDT) Original-Received: by 2002:a05:7022:1005:b0:6c:6ee4:26de with HTTP; Sun, 15 Oct 2023 11:36:26 -0700 (PDT) In-Reply-To: <83bkd0qw8j.fsf@gnu.org> X-Mailman-Approved-At: Sun, 15 Oct 2023 18:31:24 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272538 Archived-At: 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 wrote: >> From: Erik Overdahl >> 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