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: Sat, 14 Oct 2023 15:19:46 -0500 Message-ID: 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="32795"; mail-complaints-to="usenet@ciao.gmane.io" To: 66549@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 14 23:36:51 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 1qrmJW-0008NL-GW for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Oct 2023 23:36:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrmJM-0003gp-Ve; Sat, 14 Oct 2023 17:36:40 -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 1qrmJL-0003gh-9S for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 17:36:39 -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 1qrmJK-0005kz-OD for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 17:36:39 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qrmJi-0005uM-GO for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 17:37: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: Sat, 14 Oct 2023 21:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66549 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169731938022644 (code B ref -1); Sat, 14 Oct 2023 21:37:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Oct 2023 21:36:20 +0000 Original-Received: from localhost ([127.0.0.1]:50755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrmIy-0005t4-Tm for submit@debbugs.gnu.org; Sat, 14 Oct 2023 17:36:20 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:45272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrl7V-0000iQ-NZ for submit@debbugs.gnu.org; Sat, 14 Oct 2023 16:20:22 -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 1qrl72-0002kF-20 for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 16:19:52 -0400 Original-Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrl6z-0008UV-Hm for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 16:19:51 -0400 Original-Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-692d2e8c003so3258337b3a.1 for ; Sat, 14 Oct 2023 13:19:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697314787; x=1697919587; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=bl532ldwG7bSmV3YNwzvCO8hThpwMYBtRjoJKyg2mnI=; b=fWGwIQj9ziTjb17SWHy/YZLklwzCgBujkrhgOgCBJqM4x/UE1jiPMOTfBdpqhbbBUz UbTxCLWEBzUh3KfuPO1DDXcKe41/gqTp+3WuNG3gmPRAYN6hjLTn5Bay6TuoZygTFnNd ph3CDVA2oUvuQ49U/8/wm2IfE2qeRrrx3P6eF0XKQhRZlSeQf+n59bSYdVKbLIH5Brqv 0L0Wyr99qcZQLgw2cZkIUX8ZorIz84C3PxXFm36AZCGm6b/wEGoBdG+ovjREjByqodJX 6dmf4W/Z7mVcNf2VbYsUmRRd/HIPNOVYg0LRlHco6xz0r6CvFyCrzJj6HvVw8/YvvYab p2Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697314787; x=1697919587; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bl532ldwG7bSmV3YNwzvCO8hThpwMYBtRjoJKyg2mnI=; b=NS7se5NqdcDfsoT9Ht/rrGlkOI+IA9Se+8/lBSbgPeCQEAkfrdBZG9Y2TlmztzIhJ+ IrAmu3bgJdX8EpuuPnEuxrdMA68b6nRYukF6l/3tfFYW0DGYlfnHL2Wuf2fmhUxpDBPB zN0XIGcrGn0bRKY9Pfe4P2bx07JECs6mD7BUu1IuBykdb5vI2cHpQ5ZTVnBicrt8rTAf gDHXBc3b414yuVcoOTMLVXW7txKfG0u4oIaZrQ+/YSzFQYSEItxiznKRGlG4vaCZKghC s54JuEwCtjeyoS1c/IV3bZTwY1RoEVFeBlV/8mQjU7Tw2KSSC5zPUtOyzIZiegAOpx0W 91jw== X-Gm-Message-State: AOJu0YxyjKzemutu+6E6Hkq7wstYgB1Grfh5rKQrti5AkkItIlxnATx3 6kAcCke5hOSWfex8JptxbRjdI5I/XJ8abiCO7r4zsV4R X-Google-Smtp-Source: AGHT+IHk3jxe3KOGUG1j4kWGaG+YxXXQRHn46q0+xvKlvghNEGtC6xZNQ8CGZfOHEmbIfu94RiwoYplfUrJHuCoeIpQ= X-Received: by 2002:a05:6a21:3395:b0:15e:b253:269f with SMTP id yy21-20020a056a21339500b0015eb253269fmr5215920pzb.28.1697314787302; Sat, 14 Oct 2023 13:19:47 -0700 (PDT) Original-Received: by 2002:a05:7022:c8b:b0:6c:6ee4:26de with HTTP; Sat, 14 Oct 2023 13:19:46 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=erik.overdahl@gmail.com; helo=mail-pf1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 14 Oct 2023 17:36:16 -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:272472 Archived-At: 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.